Tuesday, June 10, 2008

Java Server Pages (JSP) scripting elements and variables



Great JSP scripting elements and variables web hosting can be found at Alden JSP scripting elements and variables Web Site Hosting.

Java Server Pages (JSP) scripting elements and variables



Java Server Pages ..... Web Hosting featuring Apache, PHP, MySQL, PERL, servlets Java, JSP, Linux servers Fundraising Plans.
JSP scripting elements and variables
Standard scripting variables
The following scripting variables are always available:

* out The JSPWriter used to write the data to the response stream.
* page The servlet itself.
* pageContext A PageContext instance that contains data associated with the whole page. A given HTML page may be passed among multiple JSPs.
* request The HTTP request object.
* response The HTTP response object.
* session The HTTP session object that can be used to track information about a user from one request to another.

Scripting elements
There are three basic kinds of scripting elements that allow java code to be inserted directly into the servlet.

* A declaration tag places a variable definition inside the body of the java servlet class. Static data members may be defined as well.
<%! int serverInstanceVariable = 1; %>
* A scriptlet tag places the contained statements inside the _jspService() method of the java servlet class.
<% int localStackBasedVariable = 1; out.println(localStackBasedVariable); %>
* An expression tag places an expression to be evaluated inside the java servlet class. Expressions should not be terminated with a semi-colon.
<%= "expanded inline data " + 1 %>



0 Comments:

Post a Comment

<< Home