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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T23:59:28+00:00 2026-06-11T23:59:28+00:00

I have the index.jsp page: </head> <body> <form action=HelloWorldServlet method=post> <input class=button type=submit value=load

  • 0

I have the index.jsp page:

</head>
<body>
     <form action="HelloWorldServlet" method="post">
        <input class="button" type="submit" value="load list" />
     </form>
</body>
</head>

where i want to run my HelloWorldServlet by clicking the “load list”-button.

public class HelloWorldServlet extends HttpServlet {

    protected void doPost(HttpServletRequest request,
            HttpServletResponse response) throws ServletException, IOException {
        PrintWriter writer = response.getWriter();
        writer.println("Hello, World!");
        writer.close();
    }
}

but instead of “Hello, World!” message, it try to load http://localhost:8080/HelloWorld/HelloWorldServlet page.. what’s the point?

Here is my web.xml:

<!DOCTYPE web-app PUBLIC '-//Sun Microsystems, Inc.//DTD 
  Web Application 2.3//EN' 'http://java.sun.com/dtd/web-app_2_3.dtd'>
<web-app>
  <servlet>
    <servlet-name>hello</servlet-name>
    <servlet-class>HelloWorldServlet</servlet-class>
  </servlet>

  <servlet-mapping>
    <servlet-name>hello</servlet-name>
    <url-pattern>/hello</url-pattern>
  </servlet-mapping>
</web-app>
  • 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-11T23:59:30+00:00Added an answer on June 11, 2026 at 11:59 pm

    If your servlet is mapped to /hello, then your <form> should be posting to the same URL.

    <form action="hello" method="post">
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following code: index.jsp: <form name=f action=db/ajoutConducteur.jsp method=post> <input type=text pattern=\d{8} required
Right, here's my situation, I have a form on a page (index.jsp) which submits
My index.jsp page, load my form with this line of code : $('#box').load('/Edit_Data.jsp?id=' +
I have Vector declared in index.jsp page like this: <%! Vector vNumbers = new
I have a page index.jsp available at this link https://www.dropbox.com/s/0smy7nlcmilkqt4/index.jsp . This file contains
I need to check if button in jsp page is clicked. I have 1
I have a login.jsp page which contains a login form. Once logged in the
I have an index.jsp page which uploads an image. On submit it goes to
I'm making a login page in JSP. I have an index.jsp page where the
I am making a login page in JSP. I have an index.jsp page where

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.