I have simple question about how struts handle jsp page for the first time.
Lets say i have jsp page called index.jsp which has a form with some elements.
I know whenever this form is submitted ActionServlet receives the request and then delegates it to the RequestProcessor which call series of method to get the action path and create mapping,form and action etc.
But how the index.jsp itself is handled for the first time.
Siva Masilamani wrote:is this true,even if i set the URL patttern for jsp to be handled by ActionServlet in web.xml?
Of course not; if you change it, it'll be whatever you changed it to.
Also what about after execute method returns,lets say it has to forward the request to jsp,so even in this case is it the container that handles the request?
Not sure what you're asking--here you're saying you're accessing a JSP *via* an action, as opposed to accessing the JSP directly.
Ideally, a Struts application will never access a JSP directly.
Joined: Sep 19, 2008
Let me put it clearly
ActionServlet is configured in web.xml in such a way that it has to handle request coming in with either .do or .jsp
here is my action mapping
Let's say,the execute method returns the forward name as success,so the request should be forwarded to the jsp page.
Since i have configured that it should be handled by ActionServlet,how struts handles this request ?
If it calls RequestProcessor method it definitely won't find any Action mapping for the path associated with the request as the path ends with .jsp
So in that case how struts handles the request?is there any condition like if the path is for .jsp it should be handled by container?
Also if index.jsp is my home page and when i type the URL as http:/localhost:80/webapp/index.jsp.
Since i have configured that this request should be handled by ActionServlet,how this request is handled?