Java Web Foundation Summary
In computing, Java Web Start (also known as Javaws, Javaws or JAWS) are a framework developed by Sun Microsystems (now Orac Le) that allows users to start application software for the Java Platform directly from the Internet using a Web browser. Some Key benefits of this technology include seamless version updating for globally distributed applications and greater C Ontrol of memory allocation to the Java virtual machine.
JSP execution principle
Script
<% //java代码 String username="admin";%>
An expression
<%=username%>
Instruction Element page directive
<%@ page language="java" contentType="text/html;charset=utf-8"%>
Include directives
<%@file="login.jsp"%>
TAGLIB directive
<%@ taglib uri="标签库URI" prefix="标签前缀"%>
Action element include
<jsp:include page="login.jsp" flush="true"> <jsp:param name="username"value="admin" /></jsp:include>
Forward
<jsp:forward page="success.jsp"> <jsp:param name="username" value="admin" /></jsp:forward>
Usebean
<jsp:useBean id="user"class="org.info.User"scope="page"/>
Scope includes page,request,session,application
SetProperty
name="user"property="username" value="admin"name="user"property="username" param="username"/>
GetProperty
name="user"property="username" />
Get a value of type string
Built-in objects
Request
Response
| ————————————-| ————————— –|
| void setContentType (String name) | Set the type and character encoding of the response content |
| void Sendredirect (String URL) | Redirect to the specified URL resource |
Method |
Role |
void setContentType (String name) |
Set the type and character encoding of the response content |
void Sendredirect (String URL) |
Redirect to the specified URL resource |
Out
Session
Application
Method |
Role |
void SetAttribute (String name,object value) |
Storing application domain properties as key-value pairs |
Object getattribute (String name) |
Get property values based on property name |
void RemoveAttribute (String name) |
Remove an attribute from a application field based on the property name |
PageContext
Page
<%=this.getServletInfo()%>
Config
exception
<% exception.printStackTrace(response.getWriter());%>
JavaBean Design Principles
JSP using JavaBean
<jsp:useBean><jsp:setProperty><jsp:getProperty>
Java Web Foundation Summary of JSP JavaBean