String literal is not properely closed by a double quote
String literal is not properely closed by a double quote
out.println("<td> <input type='hidden' name='hidden' value='"+ rs.getString("ID")+"'> // error here, Eclipse highlighted this portion "'>
<input type='hidden' name='hiddenTimeSlot' value='"
+ rs.getString(SQLConstants.TIMESLOTS_COLUMN)+ "'>
<input type='hidden' name='hiddenMovname' value='"
+ rs.getString(SQLConstants.MOVIE_COLUMN)+ "'>
<input type='submit' name='buytix' value='Buy Tickets'> <br><br> <input type='submit' name='rev' value='Reviews'> <br><br> <input type='submit' name='acm' value='Add
Comment'> </td>");
out.println("</tr>");
out.println("</form>");
out.println("<td> <input type='hidden' name='hidden' value='"+ rs.getString("ID")+"'> // error here, Eclipse highlighted this portion "'>
<input type='hidden' name='hiddenTimeSlot' value='"
+ rs.getString(SQLConstants.TIMESLOTS_COLUMN)+ "'>
<input type='hidden' name='hiddenMovname' value='"
+ rs.getString(SQLConstants.MOVIE_COLUMN)+ "'>
<input type='submit' name='buytix' value='Buy Tickets'> <br><br> <input type='submit' name='rev' value='Reviews'> <br><br> <input type='submit' name='acm' value='Add
Comment'> </td>");
out.println("</tr>");
out.println("</form>");
Eclipse highlighted the portion in red with the error. I seriously can't find what is the issue with the double quotes. Any help is appreciated .
The compiler is being pretty clear about the problem. You have an open ended String literal.
I'd suggest backing off on the complexity of this line and start at the simplest code that works (compiles) and add little bits incrementally. So start with the simplest code that works:
view plaincopy to clipboardprint?
Note: Text content in the code blocks is automatically word-wrapped
out.println("");
out.println("");
Does it compile? Good. Then add a little bit
view plaincopy to clipboardprint?
Note: Text content in the code blocks is automatically word-wrapped
out.println("<td>");
out.println("<td>");
Does it compile? Good. Then some more
view plaincopy to clipboardprint?
Note: Text content in the code blocks is automatically word-wrapped
out.println("<td> <input />");
out.println("<td> <input />");
Does it compile? Good. Now add your input param with the single quotes
view plaincopy to clipboardprint?
Note: Text content in the code blocks is automatically word-wrapped
out.println("<td> <input type='hidden' />");
out.println("<td> <input type='hidden' />");
Still compiling? Good. Now continue to work like this to add in the rest of the input params you need. Chances are you won't see this compiler error again.
As an aside. It's pretty likely you would be brought up on this by other Ranchers too but a JSP is no place to be dealing with sql ResultSets. ResultSets are a convenience provided by the Java JDBC library for marshalling data out of a database and you should process the data out of them into your own objects and close them as soon as possible. JSP's are a presentation technology, so we should not be dealing with Database access technologies within them. The context is all wrong.