I want to print from a servlet. I believe I have the correct syntax. But I get the message "delete these tokens" in Eclipse.
PrintWriter out = response.getWriter();
out.println("<html><head><title>Woohoo</title></head><body>\n" +
"<form id="report_form" name="report_form" method="post" action="AgReportServlet">\n"+
"<table border="0" cellspacing="0" cellpadding="8">\n"+
"<tr>\n"+
" <td><label>Start Date<br />\n"+
" <select name="start_date" id="start_date">\n"+
" <option value="2000">2000</option>\n" +
" <option value="2001">2001</option>\n" +
" <option value="2002">2002</option>\n" +
" <option value="2003">2003</option>\n" +
" <option value="2004">2004</option>\n" +
" </select> </label></td>\n"+
" <td>End Date<br />\n"+
" <select name="end_date" id="end_date">\n"+
" <option value="2000">2000</option>\n"+
" <option value="2001">2001</option>\n"+
" <option value="2002">2002</option>\n"+
" <option value="2003">2003</option>\n"+
" <option value="2004">2004</option>\n"+
" </select></td>\n"+
" <td><label>Agricultural Zone<br />\n"+
" <select name="ag_zone" id="ag_zone">\n"+
" <option value="1">Zone 1</option>\n"+
" <option value="2">Zone 2</option>\n"+
" <option value="3">Zone 3</option>\n"+
" <option value="4">Zone 4</option>\n"+
" <option value="5">Zone 5</option>\n"+
" </select> </label></td>\n"+
" <td><label>Locality<br />\n"+
" <select name="locality" id="locality">\n"+
" <option value="here">There</option>\n"+
" <option value="there">There</option>\n"+
" </select> </label></td>\n"+
" <td><label><br />\n"+
" <input type="submit" name="submit" id="submit" value="Submit" /> </label></td>\n"+
"</tr>\n"+
" </table>\n"+
" </form>\n"+
"</body>\n"+
"</html>"
);
out.flush();
out.close();
The stack trace is as follows:
java.lang.Error: Unresolved compilation problems:
Syntax error on tokens, delete these tokens
Syntax error on tokens, delete these tokens
Syntax error on tokens, delete these tokens
The type of the expression must be an array type but it resolved to String
Syntax error on token "2000", [ expected
The type of the expression must be an array type but it resolved to String
Syntax error on token "2001", [ expected
The type of the expression must be an array type but it resolved to String
Syntax error on token "2002", [ expected
The type of the expression must be an array type but it resolved to String
Syntax error on token "2003", [ expected
The type of the expression must be an array type but it resolved to String
Syntax error on token "2004", [ expected
Syntax error on tokens, delete these tokens
The type of the expression must be an array type but it resolved to String
Syntax error on token "2000", [ expected
The type of the expression must be an array type but it resolved to String
Syntax error on token "2001", [ expected
The type of the expression must be an array type but it resolved to String
Syntax error on token "2002", [ expected
The type of the expression must be an array type but it resolved to String
Syntax error on token "2003", [ expected
The type of the expression must be an array type but it resolved to String
etc. etc.