Hi Nicolas,

The perform is called when you invoke the ".do". If you invoke the ".jsp" the action 
is not called. As much as I know, if you expect the value of password2 to be set when 
you forward to the register page, you should forward to the ".do" instead of the 
".jsp".

Hope this helps,

Marcel 



-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Thursday, November 15, 2001 5:16 AM
To: [EMAIL PROTECTED]
Subject: 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:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

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

Reply via email to