你要实现的功能是什么?
是不是要把内容从页面提交到servlet中然后显示出来

解决方案 »

  1.   

    是要将 JSP页面 上输入的 文本框内的 值 提交到Action的 execute()方法里。在方法里取得这个值。现在的问题是 取得的值总是为NULL.不知什么原因
      

  2.   

    经过自己对代码的调试测试修改 ,JSP页面的输入的值 ,在后台已经获取到。谢谢大家的帮助。
      

  3.   

    request.getAttribute("qsname")  这是获取 request内置作用域对象的属性,不是获取的表单传递过来的值,具体应该是 request.getParameter("qsname")
    另外  你在action不是封装了qsname ,其实可以直接拿来用的。。
      

  4.   

    <form action="<%=request.getContextPath() %>/querystu.do?select=chuan" method="post">
    querystu.do?select=chuan
    你用的是struts1是吧!
    用select接收值,在action中封装select 这样就可以得到你传过来的值chuan了或者用bean
    假设:一个student bean 属性 name age sex
    bean中封装 name age sex 如果用 hibernate 会自动封装
    jsp的action提交的时候可以写个隐藏的text text的name=student.name
    只要在action中封封装一下bean get一下就好了 不需要set
      

  5.   

    public ActionForward query(ActionMapping mapping, ActionForm form,
    HttpServletRequest request, HttpServletResponse response)
    throws Exception {
    PrintWriter out=response.getWriter();
    QSForm fm = (QSForm )form;
    out.print("NUll???????????//"+fm.getQsname());
    return null;
    }大体上是这么个意思,好久没写代码了