Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Custom Tag Question  RSS feed

 
Kalichar Rangantittu
Ranch Hand
Posts: 240
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I have a custom tag does the following:
<my:tag label="<bean:message key="label.show"/>"/>

The above however does not work when I am using <bean:message key="label.show"/> with an error stating:

org.apache.jasper.JasperException: /WEB-INF/pages/myResult.jsp(34,46) equal symbol expected
at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:39)
at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:405)
at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:86)

If I do <my:tag label="Show"/>
this works fine. How do I get input from one tag to evaluate as input into another?

Thanks in advance.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66141
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Kalichar Rangantittu:
How do I get input from one tag to evaluate as input into another?


You can't use one custom action as the attribute value of another. You'll need to find some other way to access the data.
 
Clifford Adams
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
you might be able to use jstl

<c:set var="tmp">
<bean:message key="label.show"/>
</c:set>

<my:tag label="${tmp}"/>
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66141
141
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Clifford Adams:
you might be able to use jstl


Indeed. If using JSP 2.0 and JSTL 1.1, that'd be a good way to do it.
[ July 07, 2006: Message edited by: Bear Bibeault ]
 
Kalichar Rangantittu
Ranch Hand
Posts: 240
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks guys, thats actually what I am doing as of the moment. I was hoping however to use the <bean:message> directly. Thanks for the assistance though.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!