一个信息Category更新的jsp
Category有title和contentupdatecategory.jsp:
......
<%
..
DataOperation dataoper = new DataOperation();Category c = dataoper.getCategoryByid(id);
%>........<tr>
模块标题:
<td> <s:textfield name="categorytitle" value="<%=c.getTitle()%>">
</s:textfield></td>
</tr>
<tr>
模块内容:
<td>
<s:textarea name="categorycontent" value="<%=c.getContent()%>">
</s:textarea>
</td>
</tr>我希望更新是自动获得标题和内容,所以写了value="<%=c.getTitle()%>">和value="<%=c.getContent()%>">可是报错:
org.apache.jasper.JasperException: /updatecategory.jsp(66,12) According to TLD or attribute directive in tag file, attribute value does not accept any expressions说value属性不能接收表达式那该怎么自动获取 title和content???
Category有title和contentupdatecategory.jsp:
......
<%
..
DataOperation dataoper = new DataOperation();Category c = dataoper.getCategoryByid(id);
%>........<tr>
模块标题:
<td> <s:textfield name="categorytitle" value="<%=c.getTitle()%>">
</s:textfield></td>
</tr>
<tr>
模块内容:
<td>
<s:textarea name="categorycontent" value="<%=c.getContent()%>">
</s:textarea>
</td>
</tr>我希望更新是自动获得标题和内容,所以写了value="<%=c.getTitle()%>">和value="<%=c.getContent()%>">可是报错:
org.apache.jasper.JasperException: /updatecategory.jsp(66,12) According to TLD or attribute directive in tag file, attribute value does not accept any expressions说value属性不能接收表达式那该怎么自动获取 title和content???
pageContext.setAttribute("c",c);
pageContext改为session也行!
怎么取值 这标签我不熟。谢谢!
<%
ActionContext.getContext().put("content",c.getContent());
ActionContext.getContext().put("title",c.getTitle());
%>页面上面
<s:textarea name="categorycontent" value="%{#content}">
<s:textarea name="categorytitle" value="%{#title}">