Tuesday, September 08, 2009

Java Server Pages (JSP)i



Java Server Pages (JSP)i


(JSP) A freely available specification for extending the Java Servlet API to generate dynamic web pages on a web server. The JSP specification was written by industry leaders as part of the Java development program.


JSP assists developers in creating HTML or XML pages that combine static (fixed) page templates with dynamic content. Separating the user interface from content generation allows page designers to change the page layout without having to rewrite program code. JSP was designed to be simpler than pure servlets or CGI scripting.




JSP uses XML-like tags and scripts written in Java to generate the page content. HTML or XML formatting tags are passed back to the client. Application logic can live on the server, e.g. in JavaBeans.




JSP is a cross-platform alternative to Microsoft's Active Server Pages, which only runs in IIS on Windows NT.




Applications written to the JSP specification can be run on compliant web servers, and web servers such as Apache, Netscape Enterprise Server, and Microsoft IIS that have had Java support added.




Alden Hosting offers Java Server Pages (JSP), Servlets, and Servlets Manager with our Web Hosting Plans WEB 4 PLAN and WEB 5 PLAN .




Dedicated/Private JVM (Java Virtual Machine)



Dedicated/Private JVM (Java Virtual Machine)


Private JVM means exactly that - you are provided with a distinct JVM that is in your exclusive use. Other users do not have access to you JVM, and their bugs can not affect your web site. If your web application is a quality one, the Private JVM can be run for long periods of time, providing the best performance.


On contrary, some hosting companies offer Shared JVM. Such Shared JVM usually holds dozens (or hundreds) web sites, and if one of web application screws things up (consuming all JVM memory, for example) - all hosted web sites suffer. Shared JVMs tend to possess uncollectible garbage over time; for this reason, Shared JVM is restarted regularly which seriously affects performance and causes some of your web site visitors to see error messages when restart takes place.




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 %>



JSP Actions



Great JSP web hosting can be found at Alden JSP Hosting.

JSP Actions


JSP actions are XML tags that invoke built-in web server functionality. The following actions are provided:

* jsp:include
Similar to a subroutine, the Java servlet temporarily hands the request and response off to the specified JavaServer Page. Control will then return to the current JSP, once the other JSP has finished. Using this, JSP code will be shared between two other JSPs, rather than duplicated.
* jsp:param
Can be used inside a jsp:include, jsp:forward or jsp:params block. Specifies a parameter that will be added to the request's current parameters.
* jsp:forward
Used to hand off the request and response to another JSP or servlet. Control will never return to the current JSP.
* jsp:plugin
Older versions of Netscape Navigator and Internet Explorer used different tags to embed an applet. This action generates the browser specific tag needed to include an applet.
* jsp:fallback
The content to show if the browser does not support applets.
* jsp:getProperty
Gets a property from the specified Java bean.
* jsp:setProperty
Sets a property in the specified Java bean.
* jsp:useBean
Creates or re-uses a Java bean available to the JSP page.