Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

How is a request handled within struts framework

 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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 believe you can tell me what to think, I believe I can tell you where to go. Go read this tiny ad!
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic