I've declared two servlets in my jsp project and declared them as follows
<servlet> <servlet-name>bookingServlet</servlet-name> <servlet-class>Pack.BookingServlet</servlet-class> </servlet> <servlet> <servlet-name>ValidateLoginServlet</servlet-name> <servlet-class>Pack.ValidateLoginServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>bookingServlet</servlet-name> <url-pattern>/BookingServlet/*</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>ValidateLoginServlet</servlet-name> <url-pattern>/ValidateLoginServlet/*</url-pattern> </servlet-mapping> both of these servlets are used as controllers for two different forms both in request scope but in two different jsps.
<form name="loginInfo" action="ValidateLoginServlet" scope="request" method="post"> <form name="bookingDetails" scope="request" action="BookingServlet" method="post"> the ValidateLoginServlet is working fine, but when the second form is submitted, though the request url points to the BookingServlet the control doesn't enter the doPost() of the servlet class and the same page is merely reloaded with the new url.
I think this may be due to web.xml not registering the BookingServlet servlet. I'm using netbeans 8.0.2.
No comments:
Post a Comment