• 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
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

How is a request handled within struts framework

 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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.
 
If you two don't stop this rough-housing somebody is going to end up crying. Sit down and read this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic