你这样又是何必呢?干嘛不用两个独立的FORM?

解决方案 »

  1.   

    HTML是不允许FORM嵌套的,用一个简单的JAVASCRIPT就可以解决问题了<script language=javascript>
    function process(v){
    if(v=="in"){
    document.theForm.action="in.jsp";
    }else{
    document.theForm.action="out.jsp";
    }
    document.theForm.submit();
    }
    </script><form name=theForm method=post>
    <input type=text name=username>
    <input type=text name=password>
    <input type=button name=login value=LOGIN onclick="process('in')">
    <input type=button name=logout value=LOGOUT onclick="process('out')">
    <form>
      

  2.   

    哎呀,难得,楼主的想法竟然和我当初写jsp的时候一样,^_^,其实给js方法传递一个参数就可以实现了,一个jsp文件只需要一个form。