<%@ taglib prefix="s" uri="/struts-tags"%>
<body>
<%
String connect = "true";
request.setAttribute("connect", connect);
String ss = "wang";
%>
<%=connect%>,<%=ss%>,
<s:set name="canw1" value="<%= connect %>"></s:set>
<s:property value="#canw1" />,
<s:if test='#canw1 >=true'>
<input class="button" type="submit" name="goto"
value="<s:property value="#canw1"/>" id="defaultFocus"
οnclick="funnext();" />
ok
${canw1}
</s:if>
<s:else>
<input class="button" type="submit" name="goto"
value="<s:property value="#canw1"/>" id="defaultFocus"
disabled="disabled" />not ok${canw1}
</s:else>
<s:if test="%{#ss=='wang'}">wang</s:if>
<br />
<s:set name="canw2" value="#request.connect"></s:set>
<s:property value="#canw2" />,
<s:if test='#canw2 =="true"'>
ok,
${canw2}
</s:if>
</body>
另外可以在tomcat目录work\Catalina\localhost下查看jsp翻译成servlet的源码。
struct2笔记之<s:set />的使用
最新推荐文章于 2022-03-15 19:59:04 发布