0% found this document useful (0 votes)
9 views1 page

Java Prac 22 Radio

java

Uploaded by

shashank220906
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views1 page

Java Prac 22 Radio

java

Uploaded by

shashank220906
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Input:

HTML File:

<!DOCTYPE html>
<html>
<body>
<form method="get" action="shashank_r">
<input type="checkbox" name="sub">JAVA
<input type="checkbox" name="sub">C++
<input type="checkbox" name="sub">PYTHON
<input type="radio" name="gen">Male
<input type="radio" name="gen">Female
</form>
</body>
</html>

Servlet File:

import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.annotation.*;
@WebServlet("/shashank_r")
public class shashank_r extends HttpServlet
{
public void doGet(HttpServletRequest
req,HttpServletResponse res)throws
IOException,ServletException
{
String l[] = req.getParameterValues("sub");
if(l!=null)
{
System.out.println("Subjects are:");
for(String lang:l)
{
System.out.println("\t"+lang);
}
}
}
}

Output:

You might also like