Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to connect one servlet to another servlet? Or some other method

 
Edward Kim
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So I built a enterprise web project where the user select multiple courses they want to take. In the results page, each of these courses has a "Remove" button where it is supposed to remove the course and update the results JSP. Here is the relevant portion of the code:

In my index.html where we first select the courses that we want:


In my results.jsp, here is the portion where each of the courses I selected are outputted as well as the "Remove" button next to it:

              

Here is my RemoveClass.java servlet that invokes the "Remove" button and removes the course I selected:



Now, when I ran the code and clicked on the "Remove" button, it gave me an error and this is the message:



Since I am forwarding the request and response from RemoveClass.java servlet to the results.jsp, at the top of the results.jsp, it calls this block of code before the <body> tags:



When I used breakpoint and debugged through the code, returns as .
My question is what else do I need to do to modify my results.jsp to make sure that the parameters that I made in the RemoveClass.java are carried over to the results.jsp? Any help would be appreciated and let me know you require more information about this. Thanks!
 
Dave Tolls
Ranch Hand
Posts: 1908
14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You shouldn't have any code in your JSP.
You should be using el or JSTL tags.

Your immediate issue seems to be that you are setting an 'attribute' on the request, but trying to get it as a 'parameter'.
Since there isn't an 'email' parameter then it will be null.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic