This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Struts and the fly likes How control goes from jsp page to  web.xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "How control goes from jsp page to  web.xml" Watch "How control goes from jsp page to  web.xml" New topic
Author

How control goes from jsp page to web.xml

Rajendra Prakash
Ranch Hand

Joined: Sep 10, 2009
Posts: 293
When i click submit button, how the control goes from jsp page to Deployment Descriptor ( web.xml)
Prasad Krishnegowda
Ranch Hand

Joined: Apr 25, 2010
Posts: 507

When you click submit, control does not go to web.xml, it goes to the resource specified in the attribute action in form tag.


Regards, Prasad
SCJP 5 (93%)
Rajendra Prakash
Ranch Hand

Joined: Sep 10, 2009
Posts: 293
ok i specified like this


then how control goes to web.xml
(from this deployment descriptor control goes to ActionServlet right?)
Prasad Krishnegowda
Ranch Hand

Joined: Apr 25, 2010
Posts: 507

This means, the controller has to go to url /searchTutorial, any URL are resolved by web.xml.. so controller examines the web.xml and forwards to the appropriate servlet, mapped to url /searchTutorial..
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Not really; since this is apparently a Struts 1 application, the html:form tag will transform the action name into its full Struts 1 name, "/searchTutorial.action".

That is mapped in the web.xml to the Struts 1 action servlet, which normally handles all "/*.action" requests.

The action servlet maps the action name to the implementing code via the request processor.

(Exact details depend on which version of Struts you're using.)
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60048
    
  65

Please be sure to ask Struts questions in the Struts forum. I have moved this post there for you.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How control goes from jsp page to web.xml
 
Similar Threads
Struts action path question
Request Attributes
Value shows up in url
Click on back button problem
Need Clear Struts Navigation Flow