jsp:useBean就是一个action
package com.jsptutorial;
public class Message {
private String text;
public String getText() {
return text;
}
public void setText(String text) {
this.text = text;
}
}
<html>
<head>
<title>jsp:useBean Demo</title>
</head>
<body>
<jsp:useBean id="msg" class="com.jsptutorial.Message" />
<jsp:setProperty name="msg" property="text" value="JSP useBean Demo" />
<h1>
<jsp:getProperty name="msg" property="text" />
</h1>
</body>
</html>
原文: http://www.zentut.com/jsp-tutorial/jsp-standard-actions/
一个更像Java的方法:http://188029.net/java/j12-03-09.html