Action里面:request.setAttribute("message","Myfirst");
return mapping.findForword("success");在转向的页面里面:<bean:write name="message" scope="request"/>
return mapping.findForword("success");在转向的页面里面:<bean:write name="message" scope="request"/>
String value = "传值";
request.setAttribute("message",value);/request.getSession.setAttribute("message",value);JSP:
<%
String value = (String)request.getAttribute("message");/
String value = (String)session.getAttribute("message");
%><script language="javascript">
var str;
str=<%=value%>;
alert(str);
</script>
action中:
form.setName("abc");
JSP中:
html:form property="name"
struts会自动帮你将值map过去的。
不建议在jsp中夹杂java code.
result就是你取得的结果,在jsp中直接用<bean:write name="workvo" property="column"/>,
column就是你取数据的列名。
如果是取得的是列表,Action中一样把result结果set到一个变量list中,在jsp页面用<logic:present name="list" scope="request">
<logic:iterate id="workvo" name="list" type="mtn.gfkd.ceip.app.App_dynamicVO">
<bean:write name="workvo" property="column"/>
...
</logic:iterate>
</logic:present>
三个列名:cardnumber,cardtype,cardyue.在jsp中怎么写,楼上的“workvo”是新定义的吗?