Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Avoid Scriptlet..

 
Henrik Krievs
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Howdy!

I've a class with a static method in it. Is it possible for me to access this static method directly from jsp - without using scriptlet?

Best regards, Henrik
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could write a tag that wraps around the method, and put it into a tag library.
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If your web container supports JSP 2.0 (Tomcat 5, for example), You could also write a function that calls your static method. See Chapter 12 of Sun's J2EE Tutorial.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic