You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Nicolas Sallembien <ns...@sbcglobal.net> on 2001/11/15 05:16:07 UTC
Trying to understand the Action and Form paradigm
Hi,
>From the title of this email you probably can understand that I am a
newcomer to struts. I am very excited to try this out and use it in my
own projects.
However there is something that I don't quite understand after trying a
lot of the sample applications and reading the docs.
Currently I am trying to develop a login application as an exercise, and
I am getting this problem:
/register.jsp(60,46) Attribute password2 has no value
I have defined 2 pages for now. One page that is called login.jsp and is
associated with a LoginForm and LoginAction class, and a register.jsp
page that is associated with a RegisterAction and RegisterForm classes.
The login.jsp page has a form and a submit button to allow people to
login, and a link to the register.jsp page. This link looks like this:
<html:link forward="register">Register here</html:link>
In my struts-config.xml file I have "register" defined as a
global-forward like this:
<forward
name="register"
path="/register.jsp"/>
And my actions in the struts-config.xml look like this:
<action
path="/login"
type="org.esterlingen.ui.actions.LoginAction"
name="loginForm"
scope="request"
validate="true"
input="/login.jsp">
<forward
name="continue"
path="/login.jsp"/>
</action>
<action
path="/register"
type="org.esterlingen.ui.actions.RegisterAction"
name="registerForm"
scope="request"
validate="true"
input="/register.jsp">
<forward
name="continue"
path="/index.jsp"/>
</action>
I checked and double checked, the attribute password2 is defined in my
RegisterForm class, as well as
in the register.jsp file.
What am I doing wrong? Is there something that I misunderstand in the
documentation?
When exactly are the perform methods from the Action classes called?
When I first load the .jsp file
associated to it, or when I submit the form that is on the jsp page?
Thanks for your help
Nicolas
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>