Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Javascript > Struts, How to get at bean properties

Reply
Thread Tools

Struts, How to get at bean properties

 
 
Dave
Guest
Posts: n/a
 
      07-12-2004
I think this is a simple struts question....

I want to display information on a page in a static way. That is, not
as part of text elements. I can't find an appropriate struts tag to
use.

This what I did find. The form bean will be named the same as the
"name" attribute of the <form-bean> element in the struts-config.xml.

So if I have a form bean with 2 string properties, such as str1 and
str2, I can get the values on my jsp this way:

<jsp:useBean
id="DataForm"
scope="session"
type="com.mycompany.DataForm" />
...
<p>Str1 : <%=DataForm.getStr1()%></p>
<p>Str2 : <%=DataForm.getStr2()%></p>

But that doesn't seem like the right way to do this. I expected some
kind of special tag that I'll call "getprop":

<p>Str1 : <html:getprop property="str1"></p>
<p>Str2 : <html:getprop property="str2"></p>

What is the right way to do this?
 
Reply With Quote
 
 
 
 
Dave
Guest
Posts: n/a
 
      07-13-2004
Ooops. Yes, I meant to post this at c.l.j.prog. I'll repost it there.


In article <1oc2rcndfg06j$.nhd3wesvlfsw$.>,
d says...
> On Mon, 12 Jul 2004 17:22:48 -0400, Dave wrote:
>
> > What is the right way to do this?

>
> Post it to a group that speaks the
> language might be a help..
> <http://www.physci.org/codes/javafaq.jsp#cljp>
>
> But chase the links here first..
> <http://www.physci.org/codes/javafaq.jsp#js>
>
>

 
Reply With Quote
 
 
 
 
kaeli
Guest
Posts: n/a
 
      07-13-2004
In article <>,
noemail@anyaddressiown_invalid.com enlightened us with...
> I think this is a simple struts question....
>


Then post it to a java group.
javascript != java.

Try comp.lang.java.programmer over that way. ==>

--
--
~kaeli~
Murphy's Law #2000: If enough data is collected, anything
may be proven by statistical methods.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Framework for mapping bean properties from one bean to another cmi@ch.ibm.com Java 0 04-10-2006 07:33 AM
Differnce between Java Bean and Enterprise Java Bean Markku Salminen Java 3 01-21-2004 09:25 AM
can a session bean return a local entity bean object? David Thielen Java 2 09-12-2003 07:45 AM
To bean or not to bean... Benjamin Stewart Java 0 06-30-2003 12:34 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57