JSTL xml issue

hi,

here is the portion of my code,

<x:parse doc="${requestScope.resp}" var="respData"/>
<x:forEach select="$respData/Results/Result">
    <tr>
    <c:forEach items="${requestScope.cols}" var="columns">
    <td><x:out select="$columns"/></td>
    </c:forEach>
    </tr>
</x:forEach>

${requestScope.cols} is a array of column names/xml tag name. The problem is that i want to dynamically select out the data base on the array ${requestScope.cols}. But i cannot do it with the way above.
I hope i get this clear for you all

please help

surbex-t


surbex-tAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

surbex-tAuthor Commented:
Hi,

To be simple i want to select out the value from the XML that i parse in dynamically base on a string array that i get.

surbex-t
0
surbex-tAuthor Commented:
nobody got a sollution...?
forgive me for giving such little points coz this is only points that i got.But i indeed need your help in this.
Or I posted in wrong section....

Please help...
0
siliconeagleCommented:
post a piece of example XML
also,
<x:out select="$columns"/> should be
<x:out select="${columns}"/>
0
surbex-tAuthor Commented:
tried that....
but got error like,

org.apache.jasper.JasperException: /util/grid.jsp(31,12) According to TLD or attribute directive in tag file, attribute select does not accept any expressions
        at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
        at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:376)
        at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:150)
        at org.apache.jasper.compiler.Validator$ValidateVisitor.checkXmlAttributes(Validator.java:941)
        at org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:696)
        at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1441)
        at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
        at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
        at org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:716)
        at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1441)
        at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
        at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
        at org.apache.jasper.compiler.Validator$ValidateVisitor.visit(Validator.java:716)
        at org.apache.jasper.compiler.Node$CustomTag.accept(Node.java:1441)
        at org.apache.jasper.compiler.Node$Nodes.visit(Node.java:2163)
        at org.apache.jasper.compiler.Node$Visitor.visitBody(Node.java:2213)
        at org.apache.jasper.compiler.Node$Visitor.visit(Node.java:2219)
        at org.apache.jasper.compiler.Node$Root.accept(Node.java:456)
 ......


surbex-t
0
siliconeagleCommented:
<x:out select="?"/> doesn't accept expressions.
looks like you'll need to use
<c:choose>
<c:when test="${columns=='columnName'}"/><x:out select="columnName"/></c:when>
.....
</c:choose>
its a bit tedious but it' should work.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java EE

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.