Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Reading jslt variable from java

Posted on 2004-08-23
4
Medium Priority
?
341 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
[X]
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
  • 2
4 Comments
 
LVL 35

Expert Comment

by:TimYates
ID: 11878552
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 2000 total points
ID: 11879791
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
ID: 11880002
Thanks Greetz,

the string function works fine.
0
 
LVL 4

Expert Comment

by:Mr_It
ID: 11880292
My pleasure :)
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

As much as Microsoft wants to kill off PST file support, just as they tried to do with public folders, there are still times when it is useful or downright necessary to export Exchange mailboxes to PST files. Thankfully, it is still possible to e…
Tech spooks aren't just for those who are tech savvy, it also happens to those of us running a business. Check out the top tech spooks for business owners.
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
This lesson discusses how to use a Mainform + Subforms in Microsoft Access to find and enter data for payments on orders. The sample data comes from a custom shop that builds and sells movable storage structures that are delivered to your property. …

604 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