Latest Tutorials| Questions and Answers|Ask Questions?|Site Map




Have Programming Question? Ask it here!
 
 
 


sowmyalakshmi
jsp,servlets
1 Answer(s)      4 years and 6 months ago
Posted in : JSP-Servlet


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

Advertisement
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 -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
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 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
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 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
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
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.  ...; Edit command with $EDITOR   exit (\q)  Exit... current command   quit (\q)  Quit mysql  
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... advance JSP and Servlets. Resources for advance study: JSP Servlet JDBC
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
java
update and delete record using JSP  how to update and delete record using JSP and Servlets
codecode
codecode  hi please give me code for login page using jsp and servlets and also having validations
file insertion - JSP-Servlet
file insertion  How to insert and retrieve .doc files into sql server with example 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 Source code
Java Source Code for text chat application using jsp and servlets  Code for text chat application 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
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
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
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
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
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
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
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
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
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
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
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
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
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
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.
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
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
Use jasper report in web Apllication
servlets and jsp.kindly send me complete code in jsp and servlets for deploying jasper reports in jsp and sevlets.I am badly in need of it. Waiting for ur response
application for an Employee
application for an Employee  hi , could any one help for coding in JSP-servlets.. the prob desc is : 1.INPUT:in the 1st page it should accept input for an employeelike (name,empid ,address,dob) and persist in database 2.UPDATE
how to convert jsp to exe
how to convert jsp to exe  hello sir, i am doing webapplication. the configuration is windows xp operating system,IE6.0,apache tomcat5.0,j2se5.0 and jsp,servlets i am using.this is doing in localhost only. now i want
ExecuteScalar in java
ExecuteScalar in java  Hello Greetings I am developing web application in java using JSP and servlets. I would like to know one thing that is there any way to extract one value from database just like executescalar in .NET. Ex
Advertisements
 

 

 

DMCA.com