| Author |
Testing a servlet with a URL and parameter list
|
Mike Tabak
Ranch Hand
Joined: Mar 31, 2012
Posts: 32
|
|
I want to test a Servlet which has a doPost and doGet method. The servlet receives 2 strings from the request object and Parameter values from a list box. Here is the relevent doPost code:
Note the loop towards the bottom that retrieves the selectedMusic strings. This servlet is mapped to "displayMusicChoices" on my tomcat server. I would like to test this via a browser using a URL and parameters. When I enter
http://localhost:8080/Ch06email/displayMusicList?string1=firstName&string2=lastName&musiclist=Folk
I get:
Thank you for joining our email list Michael Tabak.
We'll email you whenever we have new releases for
these types of music:
Folk
How can I modify the above http://localhost:8080...... request so I can see more than one music choice (the available ones are Folk, Country, Bluegrass and Rock)?
Thanks
|
 |
Paul Clapham
Bartender
Joined: Oct 14, 2005
Posts: 16483
|
|
for example.
|
 |
Mike Tabak
Ranch Hand
Joined: Mar 31, 2012
Posts: 32
|
|
|
Thanks, I tried that and it didn't work the first time, but this time it did, must have had an error in my URL.
|
 |
 |
|
|
subject: Testing a servlet with a URL and parameter list
|
|
|