本文共 589 字,大约阅读时间需要 1 分钟。
import com.opensymphony.xwork2.ActionSupport;
public class OutputAction extends ActionSupport {
private String Msg;
public String getMsg(){
return Msg;
}
public String execute() {
Msg = "results:"+(10+20); System.out.println("msg的值是:"+Msg); return SUCCESS; } }<%@ page language="java" pageEncoding="gbk" isELIgnored="false" %> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" ""> <html> <head> <title>显示结果</title> </head> <body> ${msg} <%=request.getAttribute("msg") %> </body> </html> 超郁闷,这个东东弄了花了偶两小时,记下来