473,401 Members | 2,068 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,401 software developers and data experts.

Struts, How to get at bean properties

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?
Jul 23 '05 #1
3 3131
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>

--
Andrew Thompson
http://www.PhySci.org/ Open-source software suite
http://www.PhySci.org/codes/ Web & IT Help
http://www.1point1C.org/ Science & Technology
Jul 23 '05 #2
In article <MP************************@news.newsguy.com>,
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

Jul 23 '05 #3
Ooops. Yes, I meant to post this at c.l.j.prog. I'll repost it there.
In article <1o******************************@40tude.net>,
Se********@www.invalid 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>

Jul 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Amy | last post by:
When accessing my JSP I get the following error: org.apache.jasper.JasperException: Missing message for key button.next Can anyone tell me what the problem is? I have tried to figure this out...
9
by: Russ Perry Jr | last post by:
I'm using "ID" and "Value" in the generic sense here... Let's say one page I had a <html:select> with a collection like this: <html:options collection="items" property="key"...
1
by: Cedric | last post by:
Hello, I'm developping my first Struts application. I've got this error: Cannot find message resources under key org.apache.struts.action.MESSAGE web.xml <servlet>...
4
by: nc | last post by:
My iterator can find my collection when my Action class calls my jsp directly, however when my Action class calls an html file that is set up with IFrames (one of which is loading that same jsp), I...
0
by: kisc71117 | last post by:
When accessing my JSP I get the following error: org.apache.jasper.JasperException: Missing message for key "button.add" my error message javax.servlet.ServletException: Missing message for key...
5
by: =?iso-8859-1?q?Jean-Fran=E7ois_Michaud?= | last post by:
Hello, I've been trying to figure something out for the past few days and I can't seem to pinpoint what I'm doing wrong. I've been trying to call javascript from inside a <logic:equal>, but...
1
by: shrik | last post by:
hi everybody. I have following problem. There are two pages. index.jsp and main.jsp in my application Index.jsp contains logging interface in . It submits password and userid to loginform bean. ...
8
by: ajos | last post by:
hi frnds, the situation is im developing a web application in struts-- my specifications-eclipse3.2.2,struts1.1,tomcat5.5.23 mysql5.0 db. the scenario-i have a jsp page which adds the...
12
lifeisgreat20009
by: lifeisgreat20009 | last post by:
I am a newbie to Struts and JSP...I have been working on the code below for 5 hours now..I googled a lot but couldn't get much help so finally I am here.. Hoping of getting my problem solved. Please...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.