If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > JAVA > How to retrieve array parameter

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-09-09, 00:35
naruponk naruponk is offline
Registered User
 
Join Date: Apr 2009
Posts: 1
How to retrieve array parameter

Code:
public ModelAndView handleRequest(HttpServletRequest req,
			HttpServletResponse res) throws Exception{
Code:
String p[] = req.getParameter("pArray");
I can't compile, I also try casting by (String[]) but result is same
how can I retrieve array parameter ?
Reply With Quote
  #2 (permalink)  
Old 04-16-09, 08:35
BettingSherlock BettingSherlock is offline
Registered User
 
Join Date: May 2007
Posts: 78
getParameter doesn't return an array, it returns a single String

lookup the methods
getParameter
getParameterNames
getParameterValues

: Interface ServletRequest

i think you want the last one.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On