Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

regarding jsp:getProperty  RSS feed

 
praveen kanakarajan
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
im facing a problem.
i had two bean.i need to set the output of one bean method as the property of <jsp:getProperty

i.e
i will will call an attribute.getDisplayName() the output of this method will be given as property of

<jsp:getProperty name="myBean" property="attribute.getDisplayName()" >

am i trying the right way .if its wrong, how can i get it done.
[ November 08, 2006: Message edited by: praveen kanakarajan ]
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65826
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please read this.
 
praveen kanakarajan
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
really sorry for not following the rules.i will reformat the question and post it again.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65826
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually, it would be helpful if you could explain in better detail what you are trying to accomplish. I'm not quite getting what you are after.
 
praveen kanakarajan
Ranch Hand
Posts: 54
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i am using two beans which is as follows

<jsp:useBean id="contentAttributes" class="java.util.ArrayList" scope="request" />
<jsp:useBean id="contentDtlBean" class="com.indus.espace.dto.TextOnlyPortletDto" scope="request" />


i want the output of one bean to be used inside the other like follows
for(int attribCount=0;attribCount<contentAttributes.size();attribCount++){
ContentAttributeInfo attribute=(ContentAttributeInfo)contentAttributes.get(attribCount);
<jsp:getProperty name="contentDtlBean" property="<%=attribute.getDisplay_name().toLowerCase()%>" />
}
is there any way to achieve this.
[ November 08, 2006: Message edited by: praveen kanakarajan ]
 
Stefan Evans
Bartender
Posts: 1834
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, jsp:getProperty can't have a dynamic property attribute.
You could do this with JSTL/EL though.



as long as the attr.display_name field maps to an attribute in the contentDtlBean, then it should work. I'm not sure if the "toLowerCase()" bit is required or not. That would be a bit more tricky.

if you have a JSP2.0 container you could probably do it with.

Personally I think that the contentAttributes bean should return the attribute name without you having to fiddle with it to look it up.

Hope this helps,
evnafets
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!