Source Code : Jsp Form Action: Design Your Sandwich

Java Is Open Source Programming Language You Can Download From Java and Java Libraries From http://www.oracle.com. Click Here to download
We provide this code related to title for you to solve your developing problem easily. Libraries which is import in this program you can download from http://www.oracle.com. Click Here or search from google with Libraries Name you get jar file related it

Jsp Form Action: Design Your Sandwich

<HTML>
    <HEAD>
        <TITLE>Design Your Sandwich!</TITLE>
    </HEAD>
 
    <BODY>
    <% 
        String cheese = "", turkey = "", ham = "";
        String check1 = "", check2 = "", check3 = "";
        if(request.getParameter("radios") != null) {
           if(request.getParameter("radios").equals("cheese")){
               cheese = "CHECKED";
               check2 = "CHECKED";
           }
           if(request.getParameter("radios").equals("turkey")){
               turkey = "CHECKED";
               check1 = "CHECKED";
               check3 = "CHECKED";
           }
           if(request.getParameter("radios").equals("ham")){
               ham = "CHECKED";
               check1 = "CHECKED";
               check2 = "CHECKED";
               check3 = "CHECKED";
           }
       }
    %>

        <H1>Design Your Sandwich!</H1>
        <FORM METHOD="POST">
            <TABLE BORDER="1" ALIGN="LEFT">
                <TR>
                    <TH>
                        Sandwich
                    </TH>
                </TR>
                <TR>
                    <TD>
                        <INPUT TYPE="radio" NAME="radios" VALUE="cheese"
                            <%= cheese %>
                        >
                       Cheese Sandwich
                       <BR>
                       <INPUT TYPE="RADIO" NAME="radios" VALUE="turkey"
                           <%= turkey %>
                       >
                       Turkey Sandwich
                       <BR>
                       <BR>
                       <INPUT TYPE="RADIO" NAME="radios" VALUE="ham"
                            <%= ham %>
                       >
                       Ham Sandwich
                       <BR>
                   </TD>
               </TR>
            </TABLE>
    
            <TABLE BORDER="1" ALIGN="LEFT">
                <TR>
                    <TH>
                        Ingredients
                    </TH>
                </TR>
                <TR>
                    <TD>
                        <INPUT TYPE="CHECKBOX" NAME="check1" VALUE="check1"
                            <%= check1 %>
                        >
                        Meat
                        <BR>
                        <BR>
                        <INPUT TYPE="CHECKBOX" NAME="check2" VALUE="check2"
                            <%= check2 %>
                        >
                        Cheese
                        <BR>
                        <BR>
                        <INPUT TYPE="CHECKBOX" NAME="check3" VALUE="check3"
                            <%= check3%>
                        >
                        Lettuce
                    </TD>
                </TR>
            </TABLE>
            <BR CLEAR="ALL">
            <BR>
            <INPUT TYPE="SUBMIT" VALUE="Submit">
        </FORM>
    </BODY>
</HTML>

           
       

Thank with us