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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T02:19:26+00:00 2026-05-20T02:19:26+00:00

I have a servlet register in class p1 . I have a JSP jsp1.jsp

  • 0

I have a servlet register in class p1. I have a JSP jsp1.jsp. I run JSP file and see it, but when I try to apply to the servlet, Tomcat shows an error:

HTTP Status 404

The requested resource (/omgtuk/Register) is not available.

Servlet:

@WebServlet("/register")

web.xml:

<?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_3_0.xsd" id="WebApp_ID" version="3.0">
  <display-name>omgtuk</display-name>
  
  
 <servlet>
    <description></description>
    <display-name>register</display-name>
    <servlet-name>register</servlet-name>
    <servlet-class>p1.register</servlet-class>
  </servlet>
  <servlet-mapping>
    <servlet-name>register</servlet-name>
    <url-pattern>/register</url-pattern>
  </servlet-mapping>
  
  <welcome-file-list>
    <welcome-file>jsp1.jsp</welcome-file>
  </welcome-file-list>
</web-app>

I’m using Eclipse.

  • 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-20T02:19:27+00:00Added an answer on May 20, 2026 at 2:19 am

    The requested resource (/omgtuk/Register) is not available.

    This simply means that the servlet isn’t listening on an URL pattern of /Register. In other words, you don’t have a @WebServlet("/Register").

    In your particular case, you made a case mistake in the URL. URLs are case sensitive. You’re calling /Register, but your servlet is listening on /register. Fix your form action accordingly.

    So, it should not look like this:

    <form action="Register">
    

    But it should look like this:

    <form action="register">
    

    Or this, which is more robust in case you happen to move around JSPs when you’re bored:

    <form action="${pageContext.request.contextPath}/register">
    

    Unrelated to the concrete problem, please note that you registered the servlet via both a @WebServlet annotation on the class and a <servlet> entry in web.xml. This is not right. You should use the one or the other. The @WebServlet is the new way of registering servlets since Servlet 3.0 (Java EE 6) and the <servlet> is the old way of registering servlets.

    Just get rid of the whole <servlet> and <servlet-mapping> in web.xml. You don’t need to specify both. Make sure that you’re reading up to date books/tutorials. Servlet 3.0 exist since December 2009 already.

    Another detail is that p1 is not a class, it’s a package. I’d warmly recommend to invest a bit more time in learning basic Java before diving into Java EE.

    See also:

    • Our servlets wiki page
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have servlet to read log file my jsp call servlet at some interval.I
I have a servlet. I'm new in java. But i need to run the
I am developing a webapplication based on JSP. I have a servlet class :
I have the following JSP File and Servlet file <html> <head> <meta http-equiv=Content-Type content=text/html;
I have a servlet which takes us to an existing jsp, say home.jsp. This
I have a servlet. But it is not working as desired. Hence for debugging
I have this servlet program and an external .jar file (written by someone else)
I have a servlet in an GWT app thats creates a PDF file with
I'm using Tomcat as a servlet container, and have many WARs deployed. Many of
I have a Servlet class in which I import javax.servlet.* and javax.servlet.http.* . When

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.