Dale Newfield wrote:
Mihai Scripca wrote:
approach 1
defining 2 actions in struts like this:
a /view/CerereActEdit.do -> X.class
b /edit/CerereActEdit.do   -> X.class (same class)
c /CerereActEdit.do -> X.class (same class)

but it seems that struts, whatever action i ran it always uses c mapping!

This is because of confusion between the action name/namespace.

Simplest solution:  set struts.enable.SlashesInActionNames to true.
how is this possible in struts 1? where should i set this?

Without that, it's looking for a "view" namespace, or an "edit" namespace (and presumably failing to find either).

i think that the behaviour of struts should be improved to keep track of the context (not losing it on the way)
and to switch to context only when requested!

Remember, the browser thinks this is just a web page, so if you serve a form with a relative action path from the url /app/view/abc.do, it's going to submit it as /app/view/newFormAction.do, independent of the framework running on the server. Really this means absolute urls should be used almost exclusively (meaning starting with / -- the machine should probably be left out).
Yes thats correct but i was reffering to forwards:
the server gets the request: /app/view/formAction.do, executes it then goes to struts-config.xml to find the forward and finds:
<form path='/formAction.do" ....
 <forward ..success... path = /newFormAction.do" />
....
then keeps the correct context (/view) (adding it to app context, /app) and forms the correct forward like this:

/newFormAction.do  -> would become -> /app .... /view ... /newFormAction.do


-Dale

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to