Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / February 2008

Tip: Looking for answers? Try searching our database.

Reading Multiple Values from List using JSP and Form Post Method

Thread view: 
kelvinsantiago@gmail.com - 09 Feb 2008 20:35 GMT
Hi,

I have a form that contains a list box from which the user can select
multiple values.  I am sending the form content to a jsp page in order
to process the information.

I am trying to convert the selected values on the list to an array
that can be processed using the jsp page.

I am looking to do something like this

<%

     String SelectedValues[] = request.getListofValues("LR11");

%>

So far I've been unsuccessful in finding any tutorial on the net that
explains how to do this.
Lew - 09 Feb 2008 20:57 GMT
> Hi,
>
[quoted text clipped - 15 lines]
> So far I've been unsuccessful in finding any tutorial on the net that
> explains how to do this.

OTOH there are plenty of tutorials about how to do just that sort of thing
using the "model-view-controller" (MVC) pattern.  Check out Java Server Faces
(JSF) and Struts for two excellent approaches.

Don't POST to a JSP, POST to a servlet.  Do not put Java code ("scriptlet") in
your JSPs at all, ever.  JSPs are for presentation, not logic.

At the end of its logic phase, the servlet (the "controller") would grab some
result object from the business logic (the "model") and forward it and all
action to the next JSP (the "view").

Signature

Lew



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.