I am just starting with struts and I experienced problems already. What I am doing is, forwarding (in the index.jsp) to a Startup action, which decides whether to forward to a login page or to a normal "insider" page.
If it forwards to the login page, in the form (created with <html:form> the Action request starts with two slashes, not with one. This leads to problems with the browser because the complete URL then only consists of something like http://Login.do
I created a <html:link> element with the same target as the form action, and there it works fine (only one slash).
Working fine also means that there seems to be some validation where the errors are printed in the page which I interpret as "the action was invoked".
I use Tomcat 5.0.28 and struts 1.2.4. Tomcat is configured to have multiple hosts, where each host has it's own single web application in the root ("/") context.
Has anyone any idea?
This is my struts-config
This is the initial forward, used in the index.jsp
<forward name="welcome" path="/Startup.do"/>
Here the actions are defined.
<action path="/Startup" type="org.biotrull.moviedatabase.Startup" scope="request">
<forward name="login" path="/pages/Welcome.jsp"/>
<forward name="movies" path="/pages/movies.jsp"/>
<action path="/Login" type="org.biotrull.moviedatabase.Login"
name="LoginForm" scope="request" validate="true"
<forward name="success" path="/pages/movies.jsp"/>
And the form bean for the login form.
<form-bean name="LoginForm" type="org.biotrull.moviedatabase.LoginForm"/>
Here is the code from the login page where I create the form and the link:
Here the action expands from "Login.do" to "//Login.do" in the generated HTML source (I already tried it without the .do)
<html:form action="/Login.do" method="post">
<td><html:text property="login" size="30" maxlength="255"/></td>
<td><html:password property="password" size="10" maxlength="10"/></td>
<!-- this one works fine -->