RE: Present formbean value on jsp page.

2005-03-18 Thread java
Can you use bean:write to accomplish what you're after e.g.



Jay
Vertical Technology Group
http://www.vtgroup.com/

 

-Original Message-
From: Scott Purcell [mailto:[EMAIL PROTECTED] 
Sent: Friday, March 18, 2005 2:32 PM
To: Struts Users Mailing List
Subject: Present formbean value on jsp page.

Well, as normal, I have once again ran into a new snag while building my app.

Up until today, I have pulled out my form-param values in my jsp like so into a
textfield.

   


And this is great if you want to display it in a text field. But how can I just
display it in html. I have some fields that I just want to show, as uneditable,
so therefore just html. The values are in the form-bean, but I cannot figure out
which tag to use for this mission.

The form tag is 
And the bean is named something like 'userbean'.

Should I just start using 

Re: Present formbean value on jsp page.

2005-03-18 Thread Rick Reumann
Scott Purcell wrote the following on 3/18/2005 3:32 PM:
Well, as normal, I have once again ran into a new snag while building my app.
Up until today, I have pulled out my form-param values in my jsp like so into a 
textfield.
   
And this is great if you want to display it in a text field. But how can I just display it in html. I have some fields that I just want to show, as uneditable, so therefore just html. The values are in the form-bean, but I cannot figure out which tag to use for this mission.
You might want to look at some of the tons of struts examples that are 
out there. This is such a common thing that all the examples will show 
it. (Not that it's a bad question, just that a quick look at any of the 
struts examples will show displaying properties).

To answer your question there are several ways...
Using struts tags:

JSTL (prefered over bean:write):

JSP2.O:
${userBean.someField}
Preferred consesus is to use JSTL approach.
Should I just start using You shouldn't need to if your bean is already in scope, which it should 
be since you should set into scope in your Action class (or if it's a 
form bean it will automatically be in scope).

--
Rick
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Present formbean value on jsp page.

2005-03-18 Thread Rick Reumann
Rick Reumann wrote the following on 3/18/2005 3:48 PM:
Using struts tags:

Correction, I think Jay's use of bean:write is the correct way:

It's been a long time since I used bean:write so I'm not sure if the way 
I described it would work?

--
Rick
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]