aspose file tools*
The moose likes Struts and the fly likes struts 2: specifying pages with no name extension? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "struts 2: specifying pages with no name extension?" Watch "struts 2: specifying pages with no name extension?" New topic
Author

struts 2: specifying pages with no name extension?

André-John Mas
Ranch Hand

Joined: Oct 18, 2008
Posts: 37
I have seen some sites that use struts and have it so that the pages don't use a file extension, so:

http://myhost/path/abc

instead of

http://myhost/path/abc.action

how would I go about achieving this with struts 2?
Nishan Patel
Ranch Hand

Joined: Sep 07, 2008
Posts: 689


hi,

just see Struts2+ annotation base development.


Thanks, Nishan Patel
SCJP 1.5, SCWCD 1.5, OCPJWSD Java Developer,My Blog
André-John Mas
Ranch Hand

Joined: Oct 18, 2008
Posts: 37
Any chance you could point me to an actual document. Based on the information you gave me I couldn't find anything of help.
Eric Nielsen
Ranch Hand

Joined: Dec 14, 2004
Posts: 194
Here's what I did for Struts 2.0.x + the SmartURLs plugin. I'm planning to migrate to Struts 2.1.x + Convention plugin plugin later today. (SmartURLs was a third party plugin, that became the base for the Convention plugin, so I expect them to be similar, but not exactly the same.)

in struts.xml


IIRC, the struts.action.extension can not be set to the empty string in 2.0.x without the SmartURLs filter replacement shown below in the web.xml. The action.packages just tells SmartURLs where to look for actions that aren't configured in struts.xml and the default.parent.package parameter assigns all discovered, non-overridden actions an xwork-package (ie not a java package).

in web.xml


I haven't been able to look for the updated documentation yet, but I would assume poking around looking for information on the Convention plugin would be the right starting point.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: struts 2: specifying pages with no name extension?