jsp useBean

package com.java.page;

public class SimpleBean {
	private String message;

	public String getMessage() {
		return message;
	}

	public void setMessage(String message) {
		this.message = message;
	}
	

}






<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>REG JSp</title>
</head>
<body>

<jsp:useBean id="test" scope="page" class="com.java.page.SimpleBean"></jsp:useBean>
<jsp:setProperty name="test" property="message" value="hello jsp"/>
<p>xiaoxi
<jsp:getProperty name="test" property="message"/>
</body>
</html>

你可能感兴趣的:(java,html,jsp)