เมนูนำทาง
เจเอสพี ตัวอย่างซอร์สโค้ดในเจเอสพี
<%@ page errorPage="myerror.jsp" %> <%@ page import="com.foo.bar" %> <html> <head> <%! int serverInstanceVariable = 1;%> ... <% int localStackBasedVariable = 1; %> <table> <tr><td><%= "expanded inline data " + 1 %></td></tr> ...
เซิร์ฟเลตที่ได้จากการประมวลผลเจเอสพี
package jsp_servlet; import java.util.*; import java.io.*; import javax.servlet.*; import javax.servlet.http.*; import javax.servlet.jsp.*; import javax.servlet.jsp.tagext.*; import com.foo.bar; //imported as a result of <%@ page import="com.foo.bar" %> import ... class _myservlet implements javax.servlet.Servlet, javax.servlet.jsp.HttpJspPage { //inserted as a //result of <%! int serverInstanceVariable = 1;%> int serverInstanceVariable = 1; ... public void _jspService ( javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response ) throws javax.servlet.ServletException, java.io.IOException { javax.servlet.ServletConfig config = ...;//get the servlet config Object page = this; PageContext pageContext = ...;//get the page context for this request javax.servlet.jsp.JspWriter out = pageContext.getOut () ; HttpSession session = request.getSession ( true ) ; try { out.print ( "<html>\r\n" ) ; out.print ( "<head>\r\n" ) ; ... //from <% int localStackBasedVariable = 1; %> int localStackBasedVariable = 1; ... out.print ( "<table>\r\n" ) ; out.print ( " <tr><td>" ) ; //note, toStringOrBlank () converts the expression into a string or if // the expression is null, it uses the empty string. //from <%= "expanded inline data " + 1 %> out.print ( toStringOrBlank ( "expanded inline data " + 1 ) ) ; out.print ( " </td></tr>\r\n" ) ; ... } catch ( Exception _exception ) { //clean up and redirect to error page in <%@ page errorPage="myerror.jsp" %> } } }
เมนูนำทาง
เจเอสพี ตัวอย่างใกล้เคียง
เจเอสพี เอเอสพีดอตเน็ต เอเอสพีดอตเน็ต เอแจ็กซ์ เอเอสพีแหล่งที่มา
WikiPedia: เจเอสพี http://www.courses.coreservlets.com/Course-Materia... http://java.sun.com/products/jsp/ http://www.thaicreate.com/java/java-jsp.html http://www.webub.com/%E0%B8%AA%E0%B8%AD%E0%B8%99%2... http://www.jcp.org/en/jsr/detail?id=152 http://www.jcp.org/en/jsr/detail?id=245 http://www.jcp.org/en/jsr/detail?id=53