1

how can i call multiple Servlets from JSP file ? it is set to go for welcome file when it starts in and it navigates it to login and registration page if anyone logins it is navigated to the user.jsp file and in user.jsp page i need to load the information which is in the Servlet doGet method ? and in the servlet i have also used to request dispatch

RequestDispatcher dispatcher = request.getRequestDispatcher("abc.jsp"); 

but it is not working until i am not starting servlet and navigating to user.jsp my own self.

Muhammad Siddique
  • 960
  • 1
  • 14
  • 31
  • Possibly has been already answered before: https://stackoverflow.com/a/5649755/923509 – Guillem Apr 01 '18 at 22:46
  • 1
    i have seen this but it does not solve my problem i have to call simultaneously two servlets – Muhammad Siddique Apr 02 '18 at 14:09
  • dear i have a userIndex.jsp where i wanna to fetch two servlets one is fetching and sending User Information and other is sending the books information. when i am logining it is showing me user information but not books class so how can i call both at same time ?? – Muhammad Siddique Apr 02 '18 at 14:09
  • 1
    One single HTTP request can't be forwarded to two different servlets. Similarly, if you have a login form, it will be sent with POST to one single URL. Maybe you could make user.jsp load the books information related to that logged user? – Guillem Apr 02 '18 at 21:22

0 Answers0