Meaningless Drivel is fun!*
The moose likes Struts and the fly likes Wildcard Actions Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Wildcard Actions" Watch "Wildcard Actions" New topic
Author

Wildcard Actions

Ally Cavs
Ranch Hand

Joined: Aug 25, 2008
Posts: 89
Hi

my actions are like

<action name="save" class="example.Save">
<result type="tiles">tiles:admin.save</result>
</action>

so the url would be like
localhost:8080/save.action


Now if I have a url for a image like so
localhost:8080/MyApp/content/4/images/myPic.jpg

How can i wildcard this url to hit my action. This is what I tried

<action name="*content*" class="save.ServeContent">
<result name="NONE"></result>
</action>

Hope I can do this?

Ankit Garg
Sheriff

Joined: Aug 03, 2008
Posts: 9291
    
  17

I asked this some time ago. I think this will also be applicable here.

http://www.coderanch.com/t/445089/Struts/Search-engine-friendly-URLs-struts


SCJP 6 | SCWCD 5 | Javaranch SCJP FAQ | SCWCD Links
Ally Cavs
Ranch Hand

Joined: Aug 25, 2008
Posts: 89
Hi,

Thanks for your very quick reply. im confused though. Are you sayiing to use the res plugin?

Do I really have to that?
Is there not another way?

Thanks,
Alan
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Wildcard Actions
 
Similar Threads
Struts2 namespace url problem
web.xml url-pattern wildcards?
Struts 2 URL Rename
[Ask] Handle Wrong Actions?" Error Code 404 (Http Not Found)
Not direct to localhost:8080/test/index.do and show This is my JSP page?