• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Testing a servlet with a URL and parameter list

 
Mike Tabak
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 21416
33
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


for example.
 
Mike Tabak
Ranch Hand
Posts: 71
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic