RE: How to retrieve value from actionservlet?

2002-08-29 Thread Darryl Nortje

yes you can. Let's say your user object, is you form class. or similar
bean... it has in particular a getFullname() method. You store this user
bean on the request or session as "userstuff". Then when you want to write
out the username on a jsp page all you do is this -->   .

I don't see why this shouldn't work

Hi Daryl,

Thank you for your help. But, please bear with me
because I am trying very hard to make some sense out
of it. Is there any way that I can store the
information associated to a particular user in a user
object and then retrieve it later on my JSP page? In
other words, can I do the following? 

 ??

Thank you!!

Thanks,
Lee
--- Darryl Nortje <[EMAIL PROTECTED]> wrote:
> 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
>  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:
> 
>  
>   
> type="com.mycompany.mydept.mypackage.UserInfoForm"/>
> 
> 
> 
> 
>   
> type="com.mycompany.mydept.mypackage.UserInfoAction"
>name="userInfoForm"
>scope="request"
>input="/userInput.jsp">
>path="/userInfoConfirm.jsp"/>
>
> 
> 
> 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:
> 
> For additional commands, e-mail:
> 
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 


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

--
To unsubscribe, e-mail:

For additional commands, e-mail:


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: How to retrieve value from actionservlet?

2002-08-27 Thread struts user



Hi Daryl,

Thank you for your help. But, please bear with me
because I am trying very hard to make some sense out
of it. Is there any way that I can store the
information associated to a particular user in a user
object and then retrieve it later on my JSP page? In
other words, can I do the following? 

 ??

Thank you!!

Thanks,
Lee
--- Darryl Nortje <[EMAIL PROTECTED]> wrote:
> 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
>  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:
> 
>  
>   
> type="com.mycompany.mydept.mypackage.UserInfoForm"/>
> 
> 
> 
> 
>   
> type="com.mycompany.mydept.mypackage.UserInfoAction"
>name="userInfoForm"
>scope="request"
>input="/userInput.jsp">
>path="/userInfoConfirm.jsp"/>
>
> 
> 
> 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:
> 
> For additional commands, e-mail:
> 
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 


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

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: How to retrieve value from actionservlet?

2002-08-27 Thread Darryl Nortje

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


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:

 
   




   
  
   


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:

For additional commands, e-mail:


--
To unsubscribe, e-mail:   
For additional commands, e-mail: