Solved

Reading jslt variable from java

Posted on 2004-08-23
4
324 Views
Last Modified: 2008-02-01
Hello

I need read a x jstl variable from java. I have the next code:

<x:forEach var="unit" select="$document/wap/menu/principal/*" >
   <:set var="var1" select="./@href"   /><br/>
    The value of var1 is <%=pageContext.getAttribute("var1").toString()%> from java <br/>
</x:forEach>

but i don´t read de var1 value.
I can't use the <x:out select="./@value" /> because I need the var1 value in java code.

the xml is :

<wap>
<menu>
   <principal>
      <miActividad href="/servlet/ServletEntrada" position="1"/>
      <buscarActividad href="/servlet/ServletEntrada" position="2"/>
   </principal>
</menu>
</wap>

Thanks
0
Comment
Question by:candidootero
  • 2
4 Comments
 
LVL 35

Expert Comment

by:TimYates
Comment Utility
Does this help?

<x:forEach var="unit" select="$document/wap/menu/principal/*" >
   <x:set var="var1" scope="request" select="./@href" /><br/>
    The value of var1 is <%= request.getAttribute( "var1" ).toString() %> from java <br/>
</x:forEach>

0
 
LVL 4

Accepted Solution

by:
Mr_It earned 500 total points
Comment Utility
Try to use the string function in the select attribute of the <x:set>-tag

<x:set var="var1" select="string(./@href)"  /><br/>

Maybe you have to use the category var you specify in the <x:forEach>-tag:

<x:set var="var1" select="string($category/@href)"  /><br/>

Greetz
0
 

Author Comment

by:candidootero
Comment Utility
Thanks Greetz,

the string function works fine.
0
 
LVL 4

Expert Comment

by:Mr_It
Comment Utility
My pleasure :)
0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

HOW TO: Connect to the VMware vSphere Hypervisor 6.5 (ESXi 6.5) using the vSphere (HTML5 Web) Host Client 6.5, and perform a simple configuration task of adding a new VMFS 6 datastore.
HOW TO: Upload an ISO image to a VMware datastore for use with VMware vSphere Hypervisor 6.5 (ESXi 6.5) using the vSphere Host Client, and checking its MD5 checksum signature is correct.  It's a good idea to compare checksums, because many installat…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

763 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

6 Experts available now in Live!

Get 1:1 Help Now