"Jsp1.jsp": Error #: 469 : variable session is already defined in method _jspService(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) at ..
"Jsp1.jsp": Error #: 300 : variable form not found in class Jsp1_0002ejsp_jsp at ..
着就是报的错。

解决方案 »

  1.   

    在Bean中如下:
    HttpSession session = httpServletRequest.getSession();
    DengluForm theForm=(DengluForm) form;
    session.setAttribute("Username", theForm.getUsername());在JSP中如下使用:
    <%=request.getSession().getAttribute("Username")%>两处Session的Attribute名"Username"要一致。
      

  2.   

    session重复定义,你把他定义成这样子的不行吗?
    HttpSession yourSession = request.getSession();
      

  3.   

    session.putValue("aaa","sdfsdfsdf");
    String bbb=session.getValue("aaa");
    out.print(bbb);
    结果
    sdfsdfsdf