• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Rancher
Posts: 4801
50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic