Java Web Foundation Summary of JSP JavaBean

Source: Internet
Author: User

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.