提交后应用request.getParameter("OPERATION_TYPE")取值

解决方案 »

  1.   

    <%@ page contentType="text/html; charset=UTF-8" %>
    <html>
    注:该页面名为jsp4.jsp
    <body bgcolor="#ffffff">
    <SCRIPT language="JavaScript" type="text/JavaScript">
    function OperateClick(OperateTypeStr){
        document.helpme.OPERATION_TYPE.value=OperateTypeStr;
        document.helpme.submit();
         }
    </SCRIPT>
    <%=request.getParameter("OPERATION_TYPE")%>
    <FORM name="helpme" method="post" action="jsp4.jsp">
    <a href="javascript:OperateClick('sl_amend');">Submit</a>
    <input type="hidden" name="OPERATION_TYPE" value="">
    </form>
    </body>
    </html>
      

  2.   

    <%@ page contentType="text/html;charset=gb2312" %>
    <html>
    <body bgcolor="#ffffff">
    注:该页面名为jsp4.jsp
    <SCRIPT language="JavaScript">
    function OperateClick(OperateTypeStr){
        document.helpme.OPERATION_TYPE.value=OperateTypeStr;
        document.helpme.submit();
         }
    </SCRIPT>
    <%
    if(request.getParameter("OPERATION_TYPE")==null)
    out.println("传值为空");
    else
    out.println(request.getParameter("OPERATION_TYPE"));
    %>
    <form name="helpme" method="post" action="test.jsp">
    <input type="text" name="OPERATION_TYPE" value="">
    <input type="submit" name="submit" onclick="javascript:OperateClick('sl_amend');">
    </form>
    </body>
    </html>