• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

URL rewrite Struts2

 
Yiorgos Panayiotakis
Greenhorn
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can I rewrite the URL produced by Struts2, so that I can remove .action extension from url.
For example consider the URL below:

I would like to be converted to

I tried struts.action.extension="/" or "" but that does not seem to work.
Also tried to use URLRewriteFilter but also without any success. Has anybody
faced this problem before ? And can anyone point me to a solution for this
problem?

Thanks.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It does work; Struts 2.1 ships allowing extension-less actions by default.

You might have to be more specific, since this functionality exists out-of-the-box.
 
Yiorgos Panayiotakis
Greenhorn
Posts: 14
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes I'm aware of that, but I use struts2 (2.0.14) (which as far as I know lacks of that functionality) and I
hesitate to upgrade to struts2.1, cause of the problems luring in such a transition.

So to be more specific, my question is how can I achieve extension-less actions in struts2.0.x?

Thanks.
 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You might have to give more config info--people did this in S2.0 with no major issues; maybe providing more will help.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic