可以放一个hidden;
或者使用?type="insert"这样,在actionmappings中作为参数传递.
或者使用?type="insert"这样,在actionmappings中作为参数传递.
解决方案 »
- 问一个highcharts的问题 帮帮忙啊 急
- Fiter过滤指定字符的问题
- java报表的问题。JFreeChart谁会使用阿?高手指教!!!!!!急急急急急!
- 关于<客户端脚本和服务器端脚本>
- 各位大哥,我都要急死了!这种情况遇见好几次了,在线等,帮忙了就给分!!!高分!!!!
- 这样的SQL语句应该怎样构造
- 用request.getParameter("")得到的参数为什么是空的?
- 刚找到工作,特来求教,tomcat+jBuilder+DB2如何配置整个开发系统,
- 急!
- 怎样配置poolman连接池,运行环境windows 2000server,mysql,resin;测试时报错!在线等!!!
- 如何将JSP和IIS结合?
- 怎样能够在iframe中实现分页显示?
楼上的type="insert"是什么意思?可以详细说明一下吗?
一般的数据是通过helper javabean来传递的,两者是不是一样的?
action类:
public class SampleAction extends Action
{
public SampleAction()
{
}
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
{
if(form instanceof SampleForm)
{
SampleForm theForm = (SampleForm)form; String user = theForm.getThename();
String password = theForm.getThepassword(); request.getSession().setAttribute("user",user);
request.getSession().setAttribute("password",password); request.setAttribute("thename", user);
request.setAttribute("thepassword",password);
return mapping.findForward("play");
}
else
{
return null;
}
}
} 下面是forward以后的jsp页面
<center>
username:<%=session.getAttribute("user") %>
password:<%=session.getAttribute("password") %>
<html:form action="modify.do">
<table align=center cellspacing="1" cellPadding="2">
<tr >
<td>the name :</td>
<td><html:text property="thename" styleClass="box" size="35" /></td>
</tr>
<tr >
<td>the password :</td>
<td><html:text property="thepassword" styleClass="box" size="15"/></td>
</tr>
</table>
</html:form>
<hr>
<bean:define id="newbean" name="SampleForm" scope="request" />
username::<bean:write name="newbean" property="thename" scope="page" /> <br>
<table align=center cellspacing="1" cellPadding="2">
<tr>
<td>name</td>
<td >:<%=request.getAttribute("thename")%></td>
</tr>
<tr>
<td>password</td>
<td >:<%=request.getAttribute("thepassword")%></td>
</tr>
</table>
</center>我在session中赋值是为了证明我的值已经传到了action中,在jsp页面中可以取出,但是想继续利用这个forbean却不行了下面是struts-config.xml中的设置
<action path="/sample"
type="sample.SampleAction"
scope="request"
name="SampleForm">
<forward name="play" path="/success.jsp" redirect="true" />
</action>
还请大侠们多帮忙阿