Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Accessing imported class members with tags  RSS feed

 
William Stafford
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have the following situation.

On a jsp an @page imports a class that is mostly constants. For example: public static String CommonNameSearch = "comNameSearchServlet" ;

I would like to use these definitions in tags. For example:
<c:url var="link" value="myApp.Constants.CommonNameSearch">

However, since this definition is not in a scope that the tags know about standard EL does not work.

Is there a way to indicate to the tag what I'm trying to do?

Thanks for any a advice,

-=beeky
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65830
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This article addresses that very issue!
 
William Stafford
Ranch Hand
Posts: 109
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Bear. Your article was a great treatment of the problem and solution!

-=beeky
 
Raghavan Muthu
Ranch Hand
Posts: 3389
Mac MySQL Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, that is a very good article Bear.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65830
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the feedback, guys. I've found the constantsMap tag invaluable since I wrote that article. Hope it helps y'all out as well.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!