注意JSTL中向struts2传值的一个地方

在JSP中,如果向OGNL传值,在struts 2.1.8前,可以这样写:
<%
String decodeCurrentNodeName = URLDecoder.decode(URLDecoder.decode(currentNodeName, "utf-8"),"utf-8");
%>
<s:textfield id="nodeName" name="treeNodes.name" value="<%=decodeCurrentNodeName %>" />
那么在struts 2.1.8中,要这样了
<%
String decodeCurrentNodeName = URLDecoder.decode(URLDecoder.decode(currentNodeName, "utf-8"),"utf-8");
  request.setAttribute("decodename",decodeCurrentNodeName);
%>
<s:textfield id="nodeName" name="treeNodes.name" value="%{#request.decodename}" />

你可能感兴趣的:(jsp,struts)