我用了html中的Frame,然后使用了Struts,结果是我在Action中无法接收到相关信息,这是怎么回事??

解决方案 »

  1.   

    main.jsp
    ========================================
    <%@ page contentType="text/html;charset=Cp943C" %>
    <%@ page language="java" %>
    <html>
    <head>
    <%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
    <title>Employee</title>
    </head>
    <frameset framespacing="0" border="0" rows="80,100%" frameborder="0">
      <frame name="top" scrolling="no" noresize target="main" src="top.jsp" marginwidth="0" marginheight="0">
      <frameset cols="350,*">
        <frame name="left"  src="left.jsp" marginwidth="0" marginheight="0" scrolling="no" noresize></frame>
        <frame name="main" src="employee.do?event=list" target="left" scrolling="auto" noresize marginwidth="0" marginheight="0">
        </frame>
      </frameset>
      <noframes>
      <body topmargin="0" leftmargin="0">  <p>hello</p>  </body>
      </noframes>
    </frameset>
    </html>====================================================在top.jsp中我写的查询提交,然后,发送给employee.do,结果不能接收到数据。
    :(
      

  2.   

    在EmployeeAction.java中,request.getAttribute方法不能接收到任何东西用request.getParameter能接受到一些,但是我需要传递类阿。。
      

  3.   

    你是说你在top.jsp中setAttribute了?然后提交给main?那样你在后台是没有办法通过的request已经不是你在top中提交的那个request了,当然不能获得你在top中得到的东西了。
      

  4.   

    果然是,你的top的target是main,然后再由main提交给employee.do,这个时候employee.do得到请求已经不是top给main的那个请求了。解决的办法(不改变你当前框架)通过session传递,然后再后台employee.do得到属性后再在session中removeAttribute。只能这样。
      

  5.   

    你在top中提交的是一个request,在frame的employee.do中是另外一个request了,看来你对jsp和servlet中的scope生存周期还没有完全明白。
    对于你这个问题,只有用“imA(男的不会,会的不男)”的方法了。
      

  6.   

    哦听上去有些道理但是我不是这样的,top.jsp中的target 所指的main不是main.jsp而是
    <frame name="main" src="employee.do?event=list" target="left" scrolling="auto" noresize marginwidth="0" marginheight="0">
    不过,感觉你的说的差不多是对的。。我回去再试试