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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T08:49:43+00:00 2026-06-14T08:49:43+00:00

I’m very new to Web programming and am trying to write a simple application

  • 0

I’m very new to Web programming and am trying to write a simple application to collect data from an input form and pass it to a servlet via HTTPServletRequest. I know each servlet needs to be mapped to a particular URL inside web.xml. My web.xml looks as follows:

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
  <display-name>InputFormTest</display-name>
  <welcome-file-list>
    <welcome-file>InputForm.jsp</welcome-file>
  </welcome-file-list>
  <servlet>
    <description></description>
    <display-name>InputFormTest</display-name>
    <servlet-name>InputFormTest</servlet-name>
    <servlet-class>com.jsp.core.InputFormTest</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>InputFormTest</servlet-name>
    <url-pattern>/InputFormTest</url-pattern>
  </servlet-mapping>
</web-app>

InputForm.jsp shows correctly. I’ve added the InputFormTest servlet using Eclipse’s context menu, i.e. New -> Servlet, which has the following code:

package jsp.core;

import java.io.IOException;
import java.io.PrintWriter;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Servlet implementation class InputFormTest
 */
public class InputFormTest extends HttpServlet {
    private static final long serialVersionUID = 1L;

    /**
     * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
     */
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

        response.setContentType("text/html");
        PrintWriter out = response.getWriter();
        out.println("<html>");
        out.println("<head>");
        out.println("<title>InputFormTest</title>");
        out.println("</head>");
        out.println("<body>");
        out.println("<h1>User inserted: " + request.getParameter("id") + "</h1>");
        out.println("</body>");
        out.println("</html>");
    }
}

I have two problems:

  1. Firstly, after running the application within Eclipse, I’m getting the following error

    HTTP Status 404 – /InputFormTest


    type Status report

    message /InputFormTest

    description The requested resource is not available.


    Apache Tomcat/6.0.36

  2. Secondly, changing <url-pattern>/InputFormTest</url-pattern> in web.xml doesn’t influence the above output, which is weird, because I’d assume message /InputFormTest should reflect the setting within web.xml

Any hints appreciated.

  • 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-14T08:49:44+00:00Added an answer on June 14, 2026 at 8:49 am

    OK, I finally figured it out. As one could guess, the answer is trivial: Eclipse internal browser caches pages.

    This means, the page being shown in Eclipse internal browser after running the newly changed project using “Run as -> Run on server” is an old, cached page. It needs to be manually refreshed afterwards. Kind of weird behavior in case of a web-development project. Apart from that, everything works fine – case closed.

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

Sidebar

Related Questions

I have a text area in my form which accepts all possible characters from
Seemingly simple, but I cannot find anything relevant on the web. What is the
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
I want use html5's new tag to play a wav file (currently only supported

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.