Solved

use bean property value

Posted on 2002-04-26
6
253 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
ID: 6971889
you can't do it using the <jsp: tag ...
0
 
LVL 33

Accepted Solution

by:
knightEknight earned 50 total points
ID: 6971894
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
ID: 6971896
... you don't have to instantiate the bean the way I did above, but you will have to use the setter that way.
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 19

Expert Comment

by:cheekycj
ID: 6972091
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
ID: 6972098
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
ID: 6972293
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
java.lang.UnsupportedClassVersionError 8 375
stateless EJB with glassfish 2 71
immutable object concept 5 111
eclipse luna javeEE perspecive missing 5 97
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
In 2017, ransomware will become so virulent and widespread that if you aren’t a victim yourself, you will know someone who is.
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
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…

864 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

16 Experts available now in Live!

Get 1:1 Help Now