File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes How is a request handled within struts framework Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How is a request handled within struts framework" Watch "How is a request handled within struts framework" New topic
Author

How is a request handled within struts framework

Moses Marfo
Greenhorn

Joined: May 24, 2009
Posts: 27
Hi,

From reading head first JSP and servlet my understanding of request handling is that when a request comes in the container finds the URL pattern that best matches it and uses that to determine which servlet to invoke to handle the request.

Currently I have the following web.xml, struct-config file and login page


Struts-config file



login Page



The value of my action attribute for my login page is "/login" ......it doesn't have an extension of "do" but the container is still able to use the struts-config file to invoke my actionform class to do the validation when I submit the page.

How is this possible and there is no matching url pattern of "/login" in my web.xml file?

I will like to know whether all incoming requests are intercepted by the Struts servlet controller regardless of the specified value of the
action attribute in the form and that one just has to ensure that the request path is specified in the action element of the struts-config file

thanks
Moses
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

No, Struts 1 does not handle all incoming requests--only the ones the action servlet is mapped to.

Look at the generated HTML.
Moses Marfo
Greenhorn

Joined: May 24, 2009
Posts: 27
David Newton wrote:No, Struts 1 does not handle all incoming requests--only the ones the action servlet is mapped to.

Look at the generated HTML.


Thanks David
I looked at the generated HTML. The container does append ".do" to the action attribute value of the form element before serving the page to the client.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How is a request handled within struts framework