Kannan_SJD
Kannan_SJD

Reputation: 1062

User friendly URLs in struts2

My project uses both struts1 and struts2 frameworks, I need to change the URLs user friendly. Is there any plugins to remove the .action and .do extension from the urls..?

Please attach the links of documentation along with the comments. Thanks In advance.

Upvotes: 2

Views: 571

Answers (1)

Thihara
Thihara

Reputation: 6969

You can change the action extension in struts 2 by adding

<constant name="struts.action.extension" value=".foo"/> 

to the struts.xml file (or the properties file etc.)

To remove it give an empty value.

<constant name="struts.action.extension" value=""/> 

Resources : http://struts.apache.org/release/2.0.x/docs/strutsproperties.html

But the extensions shouldn't worry you too much unless you are designing a website where users will access the web pages by URL.

For a normal web application I wouldn't worry about it.

Upvotes: 1

Related Questions