aspose file tools*
The moose likes Struts and the fly likes Avoid Scriptlet.. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Avoid Scriptlet.." Watch "Avoid Scriptlet.." New topic

Avoid Scriptlet..

Henrik Krievs
Ranch Hand

Joined: Jan 05, 2004
Posts: 59

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

Joined: Mar 22, 2005
Posts: 39535
You could write a tag that wraps around the method, and put it into a tag library.

Ping & DNS - updated with new look and Ping home screen widget
Merrill Higginson
Ranch Hand

Joined: Feb 15, 2005
Posts: 4864
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.

Consultant, Sima Solutions
I agree. Here's the link:
subject: Avoid Scriptlet..
Similar Threads
my jsp is showing too much in the browser
Problem with jsp:getProperty
methods within scriptlets
sybex (again) question