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 8759529
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T14:49:40+00:00 2026-06-13T14:49:40+00:00

I used PrintWriter to do this code : response.setContentType(text/html;charset=UTF-8); PrintWriter out = response.getWriter(); try

  • 0

I used PrintWriter to do this code :

        response.setContentType("text/html;charset=UTF-8");
        PrintWriter out = response.getWriter();
        try {
            /* TODO output your page here. You may use following sample code. */
            out.println("<html>");
            out.println("<head>");
            out.println("<title>Update Page</title>");
            out.println("</head>");

            out.println("<body>");
            out.println("<center>");
            out.println("<h1>Please choose ID</h1>");
            out.println("</center>");
            out.println("<table width='359' border='1' align='center'>");
            out.println("<tr>");
            out.println("<td width='103'>ID:</td>");
            out.println("<th width='246'>");
            out.println("<select name='ID' id='ID' style='width:170px;' >");
            out.println("<option></option>");
            out.println("</select>");
            out.println("</th>");
            out.println("</tr>");
            out.println("<tr>");
            out.println("<td>Name:</td>");
            out.println("<th><input type='text' name='Name' id='Name' style='width:170px;' /></th>");
            out.println("</tr>");
            out.println("<tr>");
            out.println("<td>Address:</td>");
            out.println("<th><input type='text' name='Address' id='Address' style='width:170px;'/></th>");
            out.println("</tr>");
            out.println("<td>Email:</td>");
            out.println("<th><input type='text' name='Email' id='Email' style='width:170px;'/></th>");
            out.println("</tr>");
            out.println("<tr>");
            out.println("<td>Phone Number:</td>");
            out.println("<th><input type='text' name='Phone' id='Phone' style='width:170px;'/></th>");
            out.println("</tr>");
            out.println("<tr>");
            out.println("<td></td>");
            //=================
            out.println("<td>");
            out.println("<div>");        
            out.println("<input type='submit' name='FillValue' value='Fill ID' style='float:left'/>");

            out.println("<form action='UpdateServlet' method='post'>");
            out.println("<input type='submid' name='Submid' value='Submit'  style='float:right'/>");
            out.println("</form>");
            out.println("</div>");
            out.println("</td>");
            out.println("</tr>");
            //==============
            out.println("</table>");
            out.println("</body>");
            out.println("</html>");
        } finally {
            out.close();
        }

But something wrong when I click to Submid button, the result is :

HTTP Status 404 – /DungDV01852_Lab1_2_3/UpdateServlet

type Status report

message /DungDV01852_Lab1_2_3/UpdateServlet

description The requested resource (/DungDV01852_Lab1_2_3/UpdateServlet) is not available.
Apache Tomcat/6.0.29

I Have class updateServlet.
Another : I have the HTML :

            <td>
                <div>
                    <form action="FillServlet" method="post">
       <input type="submit" name="FillValue" value="Fill ID" style="float:left"/>
                    </form>
    <input type="submit" name="Submid" id="Submid" value="Submit"style="float:right"/>
                </div>
            </td>

It Run exactly, but the same when I use PrintWriter to write a new HTML is Wrong. Please help me. Thanks everyone

  • 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-06-13T14:49:40+00:00Added an answer on June 13, 2026 at 2:49 pm

    The code in your question will not cause a 404 error. A 404 will happens either because your code explicitly sets a 404 response by calling response.sendError(...), or because the request never made it to your servlet in the first place. And the most likely cause of the latter is that your web.xml file is not configuring and mapping your servlet properly.

    If you want more help, please add the entire web.xml file to the Question.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

public void doGet(HttpServletRequest request,HttpServletResponse response)throws ServletException, IOException { PrintWriter out = response.getWriter(); out.println(Hello World);
Used this http://code.google.com/webtoolkit/doc/latest/DevGuideRequestFactory.html tutorial to understand the basic concepts, but having problems running my
i used this code: List<string> lists=new List<string>(apple,orange,banana,apple,mang0,orange); string names; names=lists.Distinct() is that correct?
i used this code, but this codes only removes the duplicates on the list
I got a code from net and it uses imports java.io.BufferedReader imports java.io.PrintWriter This
Used code I found on SO to use the COM based Acrobat Reader to
I used Jquery to insert a variable to div. Please check my code. var
I used Session[EmpName] = Convert.ToString(Request.QueryString[1]); lblEmployeeName.Text = Session[EmpName].ToString; to show the data in label
I have written code for server and client sockets. I have used threads using
i have made a small web application with form.html output.jsp ServletOne.java In the form.html,users

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.