假設(shè)在Action類里有這么一個(gè)變量
private String str = "Hello jsp and struts2";
還必須有str的get方法。
在JSP頁(yè)面我們要引入org.apache.struts2.ServletActionContext
<%@page import="org.apache.struts2.ServletActionContext"%>
然后
<%
String str = request.getAttribute("str");
System.out.println(str); //結(jié)果將輸出: Hello jsp and struts2
%>
減肥瘦身品總匯
值得信賴*脈脈美妝*正品現(xiàn)貨謝絕講價(jià)
〓深港商盟〓名品歐衣坊(美國(guó)休閑品牌AF系列)
QQ三國(guó)游戲幣及道具專賣店
小臉紅紅的瘦身旗艦店