Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 198999
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T16:59:08+00:00 2026-05-11T16:59:08+00:00

I want to print from a servlet. I believe I have the correct syntax.

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T16:59:08+00:00Added an answer on May 11, 2026 at 4:59 pm

    You’re putting double quotes inside your string like:

    "<form id="report_form"...
    

    You need to escape them:

    "<form id=\"report_form\"...
    

    or use single quotes in the HTML:

    "<form id='report_form'...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want a servlet to print the parameters from a html form but in
I want to print columnar output from a ruby program, but in order to
How do I get and print a char from a user? This want do
I want to get some useful information from NSError . If I print out
I want to print the time from date picker but with the AM/PM. I
I want to print a text from file in C#(Visual Studio 2010), but file
I want to print a list from a mysql database, but the first list
I want to get information from Plex Media Server trough foreach . I have
I want to print the ID of the comment (eg. 10151828637085391_33268745 ) from this
I want to print a Word document, mydocument.docx, from a button in an Excel

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.