<%
String action=toGB2312(request.getParameter("submit")!=null?request.getParameter("submit"):"") ;
if(action.compareTo("")==0){
%>
<p align="center">
<tr><form name="form1" method="post" action="/* thispage */">
    <input type="submit" name="submit" value"a">&nbsp;&nbsp;&nbsp;
    <input type="submit" name="submit" value="b">&nbsp;&nbsp;&nbsp;
    <input type="submit" name="submit" value="c">&nbsp;&nbsp;&nbsp;
    <input type="submit" name="submit" value="d">&nbsp;&nbsp;&nbsp;
<form>
</tr>
</p>
<table>
 ......
</table>
<%
}    // xhongyang(冷月畅晚) 你第一个if的结束大括号丢掉了if(action.compareTo("a")==0){
%>
<form name="form2" method="post" action="./taskset.jsp">
<input type="submit" name="Submit" value="aaa">
<form>
<%
 }
%>

解决方案 »

  1.   

    <form name="form2" method="post" action="taskset.jsp">里的action=...去掉试试
    最后一个<form>改成</form>
      

  2.   

    <%@ page contentType="text/html; charset=GBK" %>
    <html>
    <head>
    <title>
    main
    </title>
    </head><body>
    <h1>
    JBuilder Generated JSP
    </h1>
    <%
    String action=(request.getParameter("submit")!=null?request.getParameter("submit"):"") ;
    if(action.compareTo("")==0){//第一次进入该页面,未提交
      out.println(action);
    %>
    <p align="center">
    <tr><form name=form1 method="post" action="main.jsp">
        <input type="submit" name="submit" value="a">&nbsp;&nbsp;&nbsp;
        <input type="submit" name="submit" value="b">&nbsp;&nbsp;&nbsp;
        <input type="submit" name="submit" value="c">&nbsp;&nbsp;&nbsp;
        <input type="submit" name="submit" value="d">&nbsp;&nbsp;&nbsp;
         </form>
    </tr>
    </p>
    <table>
    </table>
    <%}
    else{//已经提交
     %>
    <%
    if(action.compareTo("a")==0){
    out.println(action);
    %>
    <form name="form2" method="post" action="taskset.jsp">
    <input type="submit" name="Submit" value="aaa">
    </form>
    <%
     }
    }
    %>
    </body>
    </html>
    这样就没有问题了!!!祝你好运,盼你笑脸!!!
      

  3.   

    老大,这也太乱了吧
    request.getParameter
    去同名的第一个参数