JSP页面中的多表单提交

index.jsp

    
    
    
        <%
        String text1="";
        String text2="";
        String text3="";
        String message="";
        if(request.getParameter("text1")!=null){
            text1=request.getParameter("text1");
            message="You submited the first form,content is "+text1+".";
        }
        if(request.getParameter("text2")!=null){
            text2=request.getParameter("text2");
            message="You submited the second form,content is "+text2+".";
        }
        if(request.getParameter("text3")!=null){
            text3=request.getParameter("text3");
            message="You submited the third form,content is "+text3+".";
        }
    %>
    
Form 1:
Form 2:
Form 3:
<%=message %>
4.PNG

你可能感兴趣的:(JSP页面中的多表单提交)