STRUTS2 Bean label and set label __strut2

Source: Internet
Author: User

<s:bean> Tags: for creating JavaBean instances on JSP pages, you can use <s:param> to pass in parameters.

Name: Specifies the implementation class of the instantiated JavaBean

ID: Instantiating the name of an object

<s:set> Tags: The set tag defines a new variable and assigns an existing variable to the new variable, and it can also place the new variable in the specified range

Name: Specify a new variable

Scope: Specifies the scope of use of the new variable, action,page,request,response,session,application

Value: Assigning values to new variables

Package bean;

public class Student {
   private String name;
   Private String sex;
   Private String age;
Public String GetName () {return
	name;
}
public void SetName (String name) {
	this.name = name;
}
Public String Getsex () {return
	sex;
}
public void Setsex (String sex) {
	this.sex = sex;
}
Public String Getage () {return age
	;
}
public void Setage (String age) {
	this.age = age;
}
   
}
<%@ page language= "java" import= "java.util.*" pageencoding= "UTF-8"%> <%@ taglib prefix= "s" uri= "/struts-tags" %> <! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" >  



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.