InfoCenter Home >
4: Developing applications >
4.2: Building Web applications >
4.2.2: Developing JSP files >
4.2.2.3: Overview of JSP file content >
4.2.2.3.2: JSP syntax: Class-wide variables and methods

4.2.2.3.2: JSP syntax: Class-wide variables and methods

Use the <%! declaration(s) %> syntax to declare class-wide variables and class-wide methods for the servlet class.

An example of specifying class-wide variables and methods:

   <%! int i=0; String foo = "Hello"; %>
<%! private void foo() {// code for the method } %>

Go to previous article: Overview of JSP file content Go to next article: JSP syntax: Inline Java code (scriptlets)

 

 
Go to previous article: Overview of JSP file content Go to next article: JSP syntax: Inline Java code (scriptlets)