File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Static declaratoin problem? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Servlets
Reply Bookmark "Static declaratoin problem?" Watch "Static declaratoin problem?" New topic
Author

Static declaratoin problem?

marko markovic
Greenhorn

Joined: Mar 16, 2001
Posts: 28
Hi,
i could not declare a static variable in my JSp page. Why?
I tried : static int test = 0;
and get the following error:
Statement expected.
Could anyone tell me how can i declare a static variable?

$Regards
Wolfgang Stein
Greenhorn

Joined: Mar 26, 2001
Posts: 11
I use the following:
<%!
final static String NL = System.getProperty("line.separator");
%>
It also works without the keyword 'final'.
Wolfgang Stein
 
I agree. Here's the link: jrebel
 
subject: Static declaratoin problem?
 
Similar Threads
Variable access
Using final as program-wide variables
Static
size of array
static variable inside static function