我在Action類設置屬性rendring在JSP如下我的房屋是不是在Struts 2.0
public class HelloWorld{
public String execute() { ANNOTATION #1
setCustomGreeting(GREETING + getName());
return "SUCCESS";
}
private String customGreeting;
public String getCustomGreeting()
{
return customGreeting;
}
public void setCustomGreeting(String customGreeting){
this.customGreeting = customGreeting;
}
}
和IM試圖使其在JSP如下
<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
<title>HelloWorld</title>
</head>
<body>
<h3>Custom Greeting Page</h3>
<h4><s:property value="customGreeting"/></h4>
</body>
</html>
但它的在jsp上打印什麼,請幫助我?
你打開JSP頁面還是在地址url中操作? – 2010-07-08 08:02:35