This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes Servlets and the fly likes Help Modifying Servlet Please Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Help Modifying Servlet Please" Watch "Help Modifying Servlet Please" New topic

Help Modifying Servlet Please

Michele Smith
Ranch Hand

Joined: Oct 27, 2010
Posts: 421
Hello I am getting a couple of errors, all because I changed the servlet to include three strings instead of 1.

I changed the string name videoName to as follows:

String videoName1
String videoName2
String videoName3

What is happening now is that I am getting errors on the following two lines.

videoName = item.getString();


"{\"name\":\"" + videoName + "\", " +

how can I modify my code to make sure it gets all the videos (1-3)

Thanks, Michele
Piyush Mangal
Ranch Hand

Joined: Jan 22, 2007
Posts: 196
That is because there in no variable named "videoName" in your code now.
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63870

Why are you creating JSON in strings rather than using one of the many JSON libraries such as Gson or Jackson?

[Asking smart questions] [About Bear] [Books by Bear]
I agree. Here's the link:
subject: Help Modifying Servlet Please
It's not a secret anymore!