jsp向action传值
时间:2008-08-27 23:01:33
来源:论坛整理 作者: 编辑:chinaitzhe
String edit=null;
edit=request.getParameter("edit");
//如果从pagetest.jsp页转过来且点新增,就转向填加页add.jsp
if(edit.equals("new")){
edit="add";
request.setAttribute("edit", edit);
return mapping.findForward("success");
}
add.jsp
<html:html locale="true">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<bean:define id="tempid" name="edit" type="java.lang.String"/>
<html:form action="/pageAdd.do?edit= <%=tempid%>">
名称: <html:text property="title"> </html:text>
内容: <html:text property="content"> </html:text>
<html:submit>submit </html:submit>
</html:form>
</body>
</html:html>
问题:tempid为空
网友回复:此回复为自动发出,仅用于显示而已,并无任何其他特殊作用
楼主截止到2008-06-18 17:34:37的汇总数据:
发帖数:19
结贴数:9
结贴率:47.37%
楼主该结一些帖子了
网友回复:先看看能不能在本页取行tempid的值
网友回复: <bean:write property="tempid"/>或 <%=request.getAttribute("tempid")%>
网友回复:在本页能读到值
new_bird_0001 : <bean:write property="tempid"/>
不是得在form里写tempid属性,我不想这么做
网友回复:谢谢提醒
已经结了
网友回复:用 <%=request.getAttribute("tempid")%>
出现/add.jsp(14,69) equal symbol expected错误
关键字:
上一篇:cookie乱码的问题
下一篇:下面没有链接了











文章评论
共有 0 位网友发表了评论 此处只显示部分留言 点击查看完整评论页面