try this in your action class.

You have an instance of the form object.

UserInfoForm userForm = (UserInfoForm) form;
then...
String fullName = userForm.setFullName(fullName);
return mapping.findForward("success");

then on your userInfoConfirm jsp you say
<bean:write name="userInfoForm" property="fullname"/>

That should work...

-----Original Message-----
From: struts user [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 27, 2002 6:21 PM
To: [EMAIL PROTECTED]
Subject: How to retrieve value from actionservlet?



Hello everyone,

I am new to struts and I hope anyone out there can
help me, please!

In my struts-config.xml file, I have:

<form-beans> 
   <form-bean          name="userInfoForm" 
                      
type="com.mycompany.mydept.mypackage.UserInfoForm"/>
</form-beans>


<action-mappings>
   <action path="/userInfoConfirm"
          
type="com.mycompany.mydept.mypackage.UserInfoAction"
           name="userInfoForm"
           scope="request"
           input="/userInput.jsp">
      <forward name="success"    
path="/userInfoConfirm.jsp"/>
   </action>
</action-mappings>

In my UserInfoForm, I have the following setter and
getter:

public void setFullname(String fullname){
             this.fullName = fullname;
}

public String getFullname(){
             return (fullName);
}
In my UserInfoAction servlet, I did the following:

User myUser = new User(fullName);

I have a user object and I would like to retrive the
user object value i.e. fullName and display it on my
JSP page. How do I do that? I will have a collections
of users and store them in a Hashtable eventually and
retrieve user information associated to the user. But,
I would like to know how to achieve my initial attempt
above. Please help!!!!

Thank you,
Lee



__________________________________________________
Do You Yahoo!?
Yahoo! Finance - Get real-time stock quotes
http://finance.yahoo.com

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