This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Struts and the fly likes Unable to understand the URL mapping in Struts Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Unable to understand the URL mapping in Struts" Watch "Unable to understand the URL mapping in Struts" New topic
Author

Unable to understand the URL mapping in Struts

Diptish Kumar
Greenhorn

Joined: Aug 09, 2010
Posts: 1
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>

If we change it to

<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.dom</url-pattern>
</servlet-mapping>

Then also it works and the path ends with dom.....So how come the url pattern is getting changed , is it controlled by the framework, in normal serlvets ...it happens other way around like in address bar we write http://localhost:8080/myweb/data.dom... it checks for the url pattern and ask for the respective servlet , if I am not wrong.....
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

I don't really understand what you're asking.

There's a Struts servlet. It's mapped to whatever URL you give it. If there's a request that matches the Struts action servlet, Struts will dispatch the request to the appropriate action.

(All this is Struts 1, of course.)
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: Unable to understand the URL mapping in Struts