你的那个根据输入的用户ID,读取用户对象,写在哪里了?
如果是从servlet传过来的,在servlet里你需要将查询结果request.setAttribute
(假如查询结果为xxx,则request.setAttribute("xxx",xxx);)
然后在jsp页面中这么写:
<logic:iterate id="UserForm" name="xxx"type="com.ideacom.siis.domain.yyy">
<bean:write name="UserForm" property="name"/>
</logic:iterate>
yyy为你这个表的get、set方法的bean
如果是从servlet传过来的,在servlet里你需要将查询结果request.setAttribute
(假如查询结果为xxx,则request.setAttribute("xxx",xxx);)
然后在jsp页面中这么写:
<logic:iterate id="UserForm" name="xxx"type="com.ideacom.siis.domain.yyy">
<bean:write name="UserForm" property="name"/>
</logic:iterate>
yyy为你这个表的get、set方法的bean
解决方案 »
- 求助mina框架线程池中自建线程过多即连接限制无效问题
- 问哥哥姐姐们一个问题、通用。过来看看
- 自学jsp,遇到问题,请赐教!
- 字符串比大小用什么函数啊??在线等!
- Error 500--Internal Server Error?请教南来北往的高手
- 救急,大侠来帮忙,(一个不知道为什么的菜)!为什么老是这个页面!!!!(在线等)
- 初学JSP的菜问题(怎么显示中文)
- jsp 页面播放 3gp格式的 声音
- 请问各位大侠,我的JRUN3.0怎么配不成功呀?
- 小白求助
- ■■高分求教:java的replace函数可以替换字符串吗?要实现替换字符串应当怎么做呢?■■
- struts 中如何接收checkbox...........
标签默认查找范围是session,你没有保存,怎么得到啊?
public ActionForward perform(ActionMapping mapping, ActionForm form,HttpServletRequest request, HttpServletResponse response){}
中的ActionForm form,使用你的actionfrom中的setXXX方法就可以实现了,然后在页面直接使用,就和你上面使用方法一样
不是同一个也没关系。
你先new一个你要写入的action form
ndexActionForm iaf = new indexActionForm();
然后
设置你要的值
iaf.setAge("27");
iaf.setName("myname");
最后:放到request 或者 session 里
request.setAttribute("indexActionForm",iaf);
这样,你在要显示的jsp页面就可以可以取得这些值了。。
String temp= "Hello,Struts"
session.setAttribute("temp",temp);
jsp中,
<%@ taglib uri="http://java.sun.com/jstl/core" prefix="c" %>
<html:form action="/xxx.do">
<c:out value="${temp}"/>
</html:form>
session.setAttribute("UserForm",object);
jsp中
<bean:write name="UserForm" property="temp"/>
memberName:object's member name