File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes S2 URL formatting Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "S2 URL formatting" Watch "S2 URL formatting" New topic

S2 URL formatting

Andy Hahn
Ranch Hand

Joined: Aug 31, 2004
Posts: 225
Is it possible to S2 to map a custom URL to an action class? Ex. --> home.action ??

I'm not a huge fan of having to end all my URLs with .action.

David Newton

Joined: Sep 29, 2008
Posts: 12617

S2.1 sets the action suffix to ",.action" allowing blank ends. You can do the same thing yourself, although IIRC that has caused some issues with JS/CSS mapping. Or use the Convention and/or RESTful plugin.
It is sorta covered in the JavaRanch Style Guide.
subject: S2 URL formatting
Similar Threads
how to set the VO Object in response.
Struts2 Issue with localization: Messages not picked up from properties file for forward actions.
what do I need to change in web.xml to omit the .action extension?
session problem
Struts passing info from the stack to actions as pass by value? causing severe issues.