Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

use bean property value

Posted on 2002-04-26
6
257 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
Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

 
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
problem with  angularjs dropdwon search at object property (name) level 2 104
lessBy10  challenge 15 95
withoutString  challenge 40 207
servlet example 17 51
Giving access to ESXi shell console is always an issue for IT departments to other Teams, or Projects. We need to find a way so that teams can use ESXTOP for their POCs, or tests without giving them the access to ESXi host shell console with a root …
This article explains the steps required to use the default Photos screensaver to display branding/corporate images
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

789 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