954,574 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Java Servlet

I doing my University assignment. I need help for accessing html option button values using Java Servlet. Any help in this regard.

<html>
  <head>
    <title>Result</title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <h3> Select one option for each MCQ</h3>
    <form method="get" action="http://localhost:8084/MCQs/Webapplication1/src/java/serverlet">
        <table width="730" border="0">
            <tr>
                <td>
                    <strong>1. Java is starting in_____________</strong>
                </td>
            </tr>
            <tr>
                <td>
                   <input type="radio"  name="1" value="1989"> 1989
                   <input type="radio"  name="1" value="1990"> 1990 
                   <input type="radio"  name="1" value="1994"> 1994 
                   <input type="radio"  name="1" value="1990"> 1995 
                </td>
            </tr>
            <tr>
                <td>
                    <strong>2. Java provide_________________</strong>
                </td>
            </tr>
            <tr>
                <td>
                   <input type="radio" name="2" value="1989"> Overloading
                   <input type="radio" name="2" value="1990"> Overriding 
                   <input type="radio" name="2" value="1994"> Pointer 
                   <input type="radio" name="2" value="1990"> Multipule Inherintance  
                </td>
            </tr>
            <tr>
                <td>
                    <strong>3. String in java are represented as__________________</strong>
                </td>
            </tr>
            <tr>
                <td>
                   <input type="radio" name="3" value="1989"> Privimitve data type
                   <input type="radio" name="3" value="1990"> Referance data type 
                   <input type="radio" name="3" value="1994"> Navtie data type 
                   <input type="radio" name="3" value="1990"> Operator 
                </td>
            </tr>
            <tr>
                <td>
                    <strong>4. The statment System.out.println(6+3); will result in _____________.</strong>
                </td>
            </tr>
            <tr>
                <td>
                   <input type="radio" name="4" value="1989"> 63
                   <input type="radio" name="4" value="1990"> 6 + 3 
                   <input type="radio" name="4" value="1994"> 9 
                   <input type="radio" name="4" value="1990"> System Error 
                </td>
            </tr>
            <tr>
                <td>
                    <input type="button" name="btncheckResult" value="Check Reslut">
                    <input type="button" id="reset" name="btnReSet" value="Reset">
                </td>
            </tr>
        </table>
    </form>
  </body>
</html>

Please help ASAP

farooq82
Light Poster
29 posts since Feb 2009
Reputation Points: 10
Solved Threads: 0
 

JSP section, first post on the top JSP database connectivity according to Model View Controller (MVC) Model 2 . Same way as you retrieve data from text fields you would read any other form component.

PS: I made request to move this post to JSP section

peter_budo
Code tags enforcer
Moderator
15,436 posts since Dec 2004
Reputation Points: 2,806
Solved Threads: 902
 

thx for the reply but this not I want. I want to database connectivity. I have to execute servlet to handle these option button and calucate the result of correct answer.

farooq82
Light Poster
29 posts since Feb 2009
Reputation Points: 10
Solved Threads: 0
 

That tutorial is exactly what you need in regards of how to query database how and how to handle server request-response.
Else you will have to prove me wrong and not brush aside what is giving to you with no reason behind it.

peter_budo
Code tags enforcer
Moderator
15,436 posts since Dec 2004
Reputation Points: 2,806
Solved Threads: 902
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You