• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Unable to understand the URL mapping in Struts

 
Diptish Kumar
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<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
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.)
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic