Solved

use bean property value

Posted on 2002-04-26
6
251 Views
Last Modified: 2010-04-01
Hi,
<%Hashtable ht = new Hashtable()%>
 <jsp:setProperty name="someBean" property="someProperty" value=ht>

A bean can have properties that are of tipe String.
Say I have a someProperty that is a Hashtable.
How/if, can I use the setProperty to set that property, something like the example from above.

Thanks.
0
Comment
Question by:simi
  • 3
  • 2
6 Comments
 
LVL 33

Expert Comment

by:knightEknight
Comment Utility
you can't do it using the <jsp: tag ...
0
 
LVL 33

Accepted Solution

by:
knightEknight earned 50 total points
Comment Utility
you'll have to use the setter on the bean object ... something like:

<%
  Hashtable ht = new Hashtable();
  Bean someBean = new Bean();
  someBean.setSomeProperty(ht);
<%
0
 
LVL 33

Expert Comment

by:knightEknight
Comment Utility
... you don't have to instantiate the bean the way I did above, but you will have to use the setter that way.
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 19

Expert Comment

by:cheekycj
Comment Utility
try this:

<jsp:setProperty name="someBean" property="someProperty" value=<%=ht%>/>

or

<jsp:setProperty name="someBean" property="someProperty" value=<%ht%>/>

CJ
0
 
LVL 19

Expert Comment

by:cheekycj
Comment Utility
property="propertyName" value="{string | <%= expression %>}"

Sets one bean property to a specific value. The value can be a String or an expression that is evaluated at runtime. If the value is a String, it is converted to the bean property's data type according to the conversion rules shown above in TABLE 1. If it is an expression, its value must have a data type that matches the the data type of the value of the expression must match the data type of the bean property.


If the parameter has an empty or null value, the corresponding bean property is not set. You cannot use both the param and value attributes in a <jsp:setProperty> element.
0
 

Author Comment

by:simi
Comment Utility
Thanks.

Chee your solution does not work. I tried it prior to asking the question and it results in an error message asking for quotes arround the parameter value.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
netstat -a in AIX unix 8 26
Jquery ajax file upload not working 11 143
some methods private some are not 8 183
Java Exception example issues 11 83
In this article, you will read about the trends across the human resources departments for the upcoming year. Some of them include improving employee experience, adopting new technologies, using HR software to its full extent, and integrating artifi…
A procedure for exporting installed hotfix details of remote computers using powershell
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now