Tuesday 18 June 2013

Remove .action extension in struts2 , hide .action in url


Here I am referring the example :- Struts2 pagination using display tag


1) In Struts 2, all action class has a default . action extension. if you erase :-

line in struts.xml

Output URL will be shown .action extension like this :-


2) Add this line again in struts.xml & now run :-


Output URL will be shown .html extension like this :-


3) Change html to htm :-


Output URL will be shown .htm extension like this :-


4) If you want to shown empty extension URL try this :-


Output URL will be shown like this :-


you can change or modify according to your need , criteria as you want . Also change action extension in index.jsp

Hope This Help You

No comments:

Post a Comment