How to call a Static variable in one jsp page from...
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   vijay_ram
Posted On:   Thursday, March 15, 2001 12:02 AM

How to call a Static variable in one jsp page from another jsp page? i.e if a static variable a=5 is in hello.java then we can call it from another file as hello.a but how to call it if the static variable is in jsp page? other than "jsp:use bean" is there any other option???

Re: How to call a Static variable in one jsp page from...

Posted By:   Dmitry_Ivlev  
Posted On:   Monday, March 19, 2001 07:38 PM

You can not do it because JSP page compiled in java class with name generated by JSP engine and depends of it. Better put all constants in java class. For example:

public class MyConsts {
static public final String hello = "Hello";
}

and on the JSP page use them

<%=MyConsts.hello%>
About | Sitemap | Contact