Can struts 2 do a mapping such as when the user goes to http://localhost:8080/tutorial the framework fills in defaultUserChosenActionClassMapping.action so that it runs the execute method on the action class w/o going through
another page containing <META HTTP-EQUIV="Refresh" CONTENT="0;URL=classAction.action"> ?
What other alternatives are to do it like just with struts 2 if any?
I couldn't understand your problem properly, but if you want to redirect from an action to another, then there is a redirect action result that you can use...
When i first enter the app, i need to do a html refresh to not directly type classAction.action at the end of the URL.
I wondered if there's a way to do a struts 2 mapping to type in the application path localhost/app and struts would autocomplete from the mapping the classAction.action like:
http://localhost/app/classAction.action
Oh; you just want a welcome page? That's in web.xml, and has nothing to do with Struts (although you might need to make sure that forwards are also mapped to the filter--I don't recall).
Tudor Raneti
Ranch Hand
Joined: Nov 29, 2009
Posts: 145
posted
0
That's exactly the problem, if i use the welcome page, the Action class associated with it doesn't run.
I need the Action class because i'm using s:property that sets some stuff in the page, and s:property doesn't work of course if the action class doesn't.
Other people are using actions as welcome files; some (all?) of them may have had to change the types of requests handled by the filter. Some servers require a physical file even if the request is served by an action. This is a server issue, not Struts.
The struts-user mailing list has had several threads about this over the years; I'd suggest starting your search there if you're not having good luck with a full-web search.
Tudor Raneti
Ranch Hand
Joined: Nov 29, 2009
Posts: 145
posted
0
Ah, welcome-file accepts actions, i didn't know it can, thanks! That solves my problem.
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.