Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to hide action "extension" in URL? (Struts2)

 
Leonardo Carreira
Ranch Hand
Posts: 489
Eclipse IDE Java Postgres Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends...

i have a question..
iam using Struts2..
how to hide action "extension" in URL?..
example..
ussually i go to URL by write down :
http://localhost:8080/MyApplication/Category/new.action
http://localhost:8080/MyApplication/Category/edit.action?id=1

what i have to do to access URL by only write down :
http://localhost:8080/MyApplication/Category/new
http://localhost:8080/MyApplication/Category/edit?id=1

its like this website..

is it any configuration in our struts.xml?..

Thanks before...



 
Nishan Patel
Ranch Hand
Posts: 689
Eclipse IDE Java Scala
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,

I think if you put one line code at your struts.xml

<constant name="struts.action.extension" value="" /> then you can get your solution.


If you get your solution at least let me know by punting one comment.





 
David Newton
Author
Rancher
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
S2.1 ships with the extension set to "action," so it's enabled by default. The REST plugin also uss extension-less mappings by default.
 
Leonardo Carreira
Ranch Hand
Posts: 489
Eclipse IDE Java Postgres Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi..

iam so sorry for my late post reply..

okay.. its run well.. but its happen all of configuration in my application has to changed..

yeah maybe i will use it in next application..

Thank's
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic