Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Using JSP expressions in custom tags  RSS feed

 
John Harris
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Within a JSP, I have defined a String variable in an expression as follows...

<% String nameKey = "CompanyNamePT" + String.valueOf(productOptions.getProdType()); %>

I've proved that this evaluates correctly but when I try & use the variable within a custom tag as follows...

<contactus:brandedText key="<%= nameKey %>" />

instead of the the nameKey expression being evaluated, the custom tag is treating the expression as a literal string.

I have seen very similar syntax within the same application that I'm working on & this works fine. Can anyone suggest why this doesn't work in this case?

Thanks
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you post the entry for your custom tag from your TLD?
 
John Harris
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ben, thanks very much for the pointer. Had the <rtexprvalue> set to false. Now set it to true & everything works OK.

Regards
John
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!