Hello, I have a servlet that is supposed to get the parameters from a JSP page form, set the parameters to a bean, and then save the bean to the session. I then have another JSP page that retrieves the session and displays the parameters in a table. My problem is all of my parameters are showing up null. I can't seem to figure out what is wrong. Here is my code: PageA JSP
I haven't included the Model.Movie Bean code but when I set the variables in my Bean they show up in my Confirmation page so I am assuming that the Bean code is legit.
Thanks for any and all help
There is a slight issue in the flow of your application. You seem to be calling in the JSP directly. This is why the paremeters are wrong since your servlet is never called . The correct flow should be jsp --> servlet --> jsp . For this. You need to specify the name of your servlet here ( the ControllerServlet ) instead of the name of jsp. The name of the servlet must be the one as mapped in your web.xml deployment descriptor.
So change it to
Do post back for any further queries.
Muhammad Saif Asif Mirza
OCJA(5/6) OCJP(6) OCJWCD(6)
Joined: Nov 23, 2012
Okay so I changed my forms action to ControllerServlet. Now I am getting an HTTP Status 404 error, I have admin rights in my application so do I need to change my url pattern in my servlet even though my ControllerServlet is not under any admin folder?
Brooke Maddox wrote:Okay so I changed my forms action to ControllerServlet. Now I am getting an HTTP Status 404 error, I have admin rights in my application so do I need to change my url pattern in my servlet even though my ControllerServlet is not under any admin folder?
The servlet mapping shouldn't depend on any folder hierarchy , it should be mapped properly in the web.xml only, that is from where the container will find your serlvet based on the url pattern you hit. What is your mapping in the web.xml , post it here . Also I would like you to post what change have you made in your form action attribute and lastly the URL that was hit in the browser when you got the 404 error
( must be something like http://<servere_name>:<port>/<context_name>/some/more/paths/ControllerServlet