This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Struts and the fly likes No extension STRUTS Controller Mapping Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "No extension STRUTS Controller Mapping" Watch "No extension STRUTS Controller Mapping" New topic
Author

No extension STRUTS Controller Mapping

Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Ok, does anyone else hate the .do extension as much as I do? Personally, I would prefer to not have an extension at all. When not using STRUTS this is easily achieved for each servlet mapping by something like:

So when I go in my browser to http://localhost:8080/webap/login I am forwarded to the appropriate JSP and that is all I see in the browser.
Well, with the way the Controller works, I haven't been able to find a work around for this in struts and would love to do away with the extension all together. Anyone have any ideas?


GenRocket - Experts at Building Test Data
Rick Hightower
Author
Ranch Hand

Joined: Feb 20, 2002
Posts: 350
Set the action mapping to /action/* anything under action would go to your action.


Rick Hightower is CTO of Mammatus which focuses on Cloud Computing, EC2, etc. Rick is invovled in Java CDI and Java EE as well. linkedin,twitter,blog
Gregg Bolinger
GenRocket Founder
Ranch Hand

Joined: Jul 11, 2001
Posts: 15299
    
    6

Originally posted by Rick Hightower:
Set the action mapping to /action/* anything under action would go to your action.

That won't work. I have a Filter that I am using to check authentication. I have to map it to secure pages via /user/*, /action/* or whatever. With that being the case, something like LoginAction that doesn't require authentication would hit the Filter and be denied.
I guess I should have stated that in the first post. I want to keep my filter in place. I don't want to create a subclass that does this and extend that in all my Action classes.
So are there any other options?
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: No extension STRUTS Controller Mapping