jsp,servlets

jsp,servlets

Good Afternoon Sir,
I am sowmya i have a doubt that is whether it is possible to use arrays in servlets.how to declare that arrays in servlets and i am getting values from textbox in jsp and that values stores in arrays within servlet.
Thankingyou sir
View Answers

February 18, 2010 at 4:45 PM

Hi Friend,

Try the following code:

1)sports.jsp:

<html>
<form action="../HelloWorldExample" method="post">
<b>Select favourite sports:</b><br>
<input type="checkbox" name="sport" value="Cricket">Cricket<br>
<input type="checkbox" name="sport" value="Football">Football<br>
<input type="checkbox" name="sport" value="Tennis">Tennis<br>
<input type="checkbox" name="sport" value="Badminton">Badminton<br>
<input type="checkbox" name="sport" value="Hockey">Hockey<br>
<input type="Submit" value="Submit">
</form>
</html>

2)HelloWorldExample.java

import java.io.*;
import java.util.*;
import javax.servlet.*;
import javax.servlet.http.*;

public class HelloWorldExample extends HttpServlet {
public void doPost(HttpServletRequest request, HttpServletResponse response)throws IOException, ServletException{
PrintWriter out = response.getWriter();
String checkValues[]=request.getParameterValues("sport");
for(int i=0;i<checkValues.length;i++){
out.println(checkValues[i]);
}

}
}

Thanks









Related Tutorials/Questions & Answers:
Difference between JSP and Servlets
Difference between JSP and Servlets  What is the difference between JSP and Servlets ?   JSP is used mainly for presentation only. A JSP can only be HttpServlet that means the only supported protocol in JSP is HTTP
how to execute jsp and servlets with eclipse
how to execute jsp and servlets with eclipse  hi kindly tell me how to execute jsp or servlets with the help of eclipse with some small program
Advertisements
JSP-Servlets-JDBC
JSP-Servlets-JDBC  Hi all, 1, Create - i want sample code ( if possible with explanation) to create a registration form in JSP, and the form..... It will be helpful if it's made into sub modules, JSP, Driver Constants, Servlets, Java Beans
how to execute jsp and servlets with eclipse
how to execute jsp and servlets with eclipse  hi kindly tell me how to execute jsp or servlets with the help of eclipse with some small program... http://www.roseindia.net/jsp/crud-application.shtml This will help you in how
using jsp and servlets andin Mvc architecture
using jsp and servlets andin Mvc architecture  how to insert a form data in different tables, that means education details in education table, address details in address table,like that and finally if we fetch all must come
jsp and servlets
jsp and servlets  what is difference between jsp and servlet?? what should a person use to develop website ??   JSP is used for view in MVC... the request submitted from browser and process the data and redirect it to JSP
jsp and servlets
jsp and servlets  i want code for remember password and forget password so please send as early as possible ............. thanks in advance   Please visit the following link: http://www.roseindia.net/jsf/richfaces
jsp -servlets
jsp -servlets  i have servlets s1 in this servlets i have created emplooyee object, other servlets is s2, then how can we find employee information in s2 servlets
need a sample project using java technologies like jsp, servlets, struts
need a sample project using java technologies like jsp, servlets, struts  Hi everybody! I have learnt core java,jdbc,jsp,servlets & struts. Please guide me where can i find sample project like library management, CMS or any
How to export web page to excel using java or jsp or servlets
How to export web page to excel using java or jsp or servlets  Hi I am trying to export web page(jsp page ) to excel using jsp or servlets. I am... errors. Please can anyone tell me how to do this using java or jsp or servlets
jsp,servlets - JSP-Servlet
jsp,servlets   Good Afternoon Sir, I am sowmya i have a doubt that is whether it is possible to use arrays in servlets.how to declare that arrays in servlets and i am getting values from textbox in jsp
JSP and servlets - JSP-Servlet
JSP and servlets  Hi sir, This is vanisree in my project i need to add the start time of examination and end time of examinaion and if the time between end and start are greater than one hour then i need to close that session
How to Upload a file directly to Oracle database using JSP or Servlets?
How to Upload a file directly to Oracle database using JSP or Servlets?  Hi I want to upload a file(csv or excel) to Oracle 10g Database using JSP, here is my code which gives me an error.. Addfile.jsp <%@ page import
how do i provide down a pdf document fecility on my web page using jsp and servlets?
this program by using jsp-servlets. any one can help me please?? Thanks&...how do i provide down a pdf document fecility on my web page using jsp and servlets?  Hai, I need a program to provide download option for pdf file
how to write the coding for converting the database data for example population into any type of graph using jsp and servlets?//
jsp and servlets pls help me out how to write the coding for converting the database data for example population into any type of graph using jsp and servlet
Using MYSQL Database with JSP & Servlets.
Using MYSQL Database with JSP & Servlets.
Using MYSQL Database with JSP & Servlets.  ...   exit (\q)  Exit mysql. Same as quit...; quit (\q)  Quit mysql   rehash (\#)  Rebuild
Advance Java Training
; 1. Programming with Servlets & JSP JSP/Servlets  Training Course Objective Explaining  HTML and HTTP. Explaining  JSP
Tomcat Quick Start Guide
application using JSP, Servlets and JDBC technologies. In this quick and very fast tomcat jsp tutorial, you will learn all the essential steps need to start... the above examples you can now learn advance JSP and Servlets. Resources for advance
Online Training Courses
Online Training Courses        Core Java Training Topics Advance Java (JSP/Servlets) Training Topics Jakarta Struts & Advanced JSP Topics Java Server Faces (JSF) Training
Jsp - JSP-Servlet
JSP Servlets Advantages  What are the advantages of JSP and Servlets
Synchronization
Synchronization  i want code for synchronization using in jsp and servlets
Tomcat Quick Start Guide
The J2EE Architecture allows the programmers to divide their work into two major categories Business Logic Presentation Logic
file insertion - JSP-Servlet
file insertion  How to insert and retrieve .doc files into sql server with example using jsp and servlets
codecode
codecode  hi please give me code for login page using jsp and servlets and also having validations
java
update and delete record using JSP  how to update and delete record using JSP and Servlets
sms - JSP-Servlet
sms  Hi What are the requriments for sending the sms? what is the procedure? Any source code for simple message sending(sms) in java or jsp and servlets
Steps to execue jsp in jcreator - Development process
Steps to execue jsp in jcreator  Hi Friends, Can anyone give steps for executing jsp and servlets using Jcreator IDE
online bookstore - JSP-Servlet
online bookstore  i want to display some books like online shoping.please send me code for that using jsp and servlets
struts
struts  we have the concept of jsp's and servlets right we can develop the web-pages each and everything then why what for struts inturdouced
Java Source code
Java Source Code for text chat application using jsp and servlets  Code for text chat application using jsp and servlets
Java
Java  How to upload a pdf,txt,doc,images file with a specfic size using jsp and servlets in the serve??? Thanks in advance minni
Java - WebSevices
Java   What are jsp and servlet?  Hi Friend, To know about the JSP and Servlets, please visit the following links: http://www.roseindia.net/jsp/ http://www.roseindia.net/servlets/index.shtml Thanks
MVC Example
MVC Example  I WANT MVC EXAMPLE PROGRAM using Jsp Servlets and Jdbc with mysql of Insert,update,delete,search. please give the answer in MVC rule
INBOX STRUCTURE
INBOX STRUCTURE  Please someone help me by telling how an inbox will be created to display dynamic records. Using oracle, jsp, servlets, javascript. If you can send me format for this,hat will be a great help for me
call ireports
call ireports  how to call jrxml file in jsp or servlets pls give one example any one? please send one example any one
online shopping project
online shopping project  sir, plz can u send me the coding of simple application of online shopping cart project using jsp and servlets which should be run in netbeans without any errors
mvc
mvc  I want MVC example using jsp,servlets,pojoclass,jdbc(with mysql)..operation of insert,search,delete,update. I want above web application only... get only jsp servlets web application from your website & some other links. so
how can i create a discussion forum?
how can i create a discussion forum?  how can i create a discussion forum for my e- mentoring site for women which can be used by a registered user only. i am using jsp and servlets and i am working with netbeans 6.8.
BIRT reporting tool - Development process
BIRT reporting tool  How to call BIRT reports from jsp or servlets. what is the tree architecture? And what is the process to deploy BIRT project in tomcat server. just give small application to call BIRT reports from jsp
how to make multiple choice questions
how to make multiple choice questions  I have to make a multiple choice choice using JSP/Servlets. I created a a session bean for the questions and answers. how to associate group of questions to a user? so each user will have
JAVA
JAVA  plz send me code, How to find fare form one place to another place using Java,Jsp,Servlets? for example:i need to calculate from bangalore to gulbarga..i need to claculate the bus fare,distance in kms
code for user registration page and login page of emails using jsp
code for user registration page and login page of emails using jsp  hiiiiiii please send me the code for user registration page and login page of email using jsp and servlets and also code for database connectivity to oracle
profile display
using jsp-servlets?   Please visit the following links: http://www.roseindia.net/servlets/search.shtml http://www.roseindia.net/jsp/user-search.shtml http://www.roseindia.net/jsp/searchbook.shtml JSP Tutorials Servlet
Mutliple files upload
Mutliple files upload  Hi Sir, Am doing a project in Jsp and Servlets, i want to upload multiple files inside the grid of the table, and submit... the following link: http://www.roseindia.net/jsp/file_upload
Is JSP dead?
, JSP and Servlets are hear of development of dynamic web applications in Java.... Developers must learn JSP and Servlets to maker their career in web application...Is JSP dead?  Hi, There are many web application development
How do I learn Spring Framework?
How do I learn Spring Framework?  Hi, I have completed my Engineering in 2017. During my college days I learned Core Java, Advanced Java, JDBC, JSP and servlets on roseindia.net Now I want to learn Spring Framework because many
How do I learn Spring Framework?
How do I learn Spring Framework?  Hi, I have completed my Engineering in 2017. During my college days I learned Core Java, Advanced Java, JDBC, JSP and servlets on roseindia.net Now I want to learn Spring Framework because many
How do I learn Spring Framework?
How do I learn Spring Framework?  Hi, I have completed my Engineering in 2017. During my college days I learned Core Java, Advanced Java, JDBC, JSP and servlets on roseindia.net Now I want to learn Spring Framework because many

Ads