I should make one more correction. Actually when I mapped the controller Servlet to "/", the correct action parameter did show up in the form, and things worked correctly. However, I don't want to use "/" as my controller mapping -- I would rather do something more specific. But "/login" and "/login/*" for example don't work.

So again, I guess my question is still the same. Could someone explain how the action attribute relates to the controller Servlet mapping, and how I should use the <servlet-mapping> section to make this work correctly?

Thanks,
Erik



Erik Weber wrote:

<form-beans>
<form-bean name="loginForm" type="org.apache.struts.validator.DynaValidatorForm">
<form-property name="username" type="java.lang.String"/>
<form-property name="password" type="java.lang.String"/>
</form-bean>
</form-beans>


<action-mappings>
<action path="/login" type="LoginAction" name="loginForm" scope="session" input="/login.jsp">
<forward name="success" path="/home.jsp"/>
<forward name="failure" path="/login.jsp"/>
</action>
</action-mappings>


<message-resources parameter="ApplicationResources"/>


I have tried mapping the controller servlet to all kinds of path prefixes including "/login" and "/login/*" and "/". None of them result in the correct action parameter in the form. I don't want to use extension mapping. I want to use path mapping. Is this where the problem is?




atta-ur rehman wrote:

Hello Erik,

Is it possible for you to show your struts-config.xml file?

ATTA

On Jul 5, 2004, at 4:01 PM, Erik Weber wrote:

Could someone please tell me what would cause the html:form tag to ignore the value I specify to the action parameter, and instead, rewrite the action parameter value to be equal to the context root of the application?


For example, my web app login page is:

http://localhost:8080/Test/index.jsp

In login.jsp, I have this opening form tag:

<html:form action="/login">

I have a matching action configured in struts-config.xml. But the struts tag is rendering the form tag like this:

<form name="loginForm" action="/Test">


No matter what I try this does not change. This is extremely frustrating. Any help would be appreciated.


Erik


--------------------------------------------------------------------- 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]



--------------------------------------------------------------------- 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