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

  • Home
  • SEARCH
  • 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 6800409
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:57:56+00:00 2026-05-26T18:57:56+00:00

In my Spring app, I have the following: @RequestMapping(method = RequestMethod.GET, value = /)

  • 0

In my Spring app, I have the following:

@RequestMapping(method = RequestMethod.GET, value = "/")
public String goHome(ModelMap map){
    map.addAttribute("content", "home.jsp");
    return "index";
}


@RequestMapping(method = RequestMethod.GET, value = "register")
public String getRegisterPage(ModelMap map){
    map.addAttribute("content", "register.jsp");
    return "index";
}

On localhost, I can access them as localhost:8080 and localhost:8080/register respectively. But when I deploy them on third party server, domain.com works fine but domain.com/register (and every other links other than domain.com) result in a 404.

Not Found

The requested URL /register was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

Note:
– Both localhost and domain.com run on Tomcat 5.5 and has Servlet version 2.4
– I even changed RequestMapping value to value=”/register” but nothing changed

web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
    <display-name>Adsense</display-name>
  <listener>
    <listener-class>com.adsense.connection.MySqlDBPooling</listener-class>
  </listener>
  <servlet>
    <servlet-name>spring</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>spring</servlet-name>
    <url-pattern>/</url-pattern>
  </servlet-mapping>
</web-app>

Thanks for help

  • 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-26T18:57:56+00:00Added an answer on May 26, 2026 at 6:57 pm

    Got my answer here: Tomcat 404 Not Found error

    The problem is that in the production environment tomcat is being
    fronted by an apache httpd which does not forward requests to tomcat
    for urls of the form /foobar (without an extension). Apache doesn’t
    know how to deal with those URLs and tries to serve them as static
    files from the disk. The files are not there so it tries to execute
    the 404 rule which is badly configured (the configured 404 file is
    itself missing as well – but that’s another problem).

    Solutions:

    Assign an extension to all your servlets and specify that to apache.
    E.g .do (like struts does) so your servlet becomes /foobar.do. You’ll
    then need to ask your sysadmin to specify that *.do goes to tomcat.
    Ask your sysadmin to configure apache to send all requests to tomcat
    apart of those for static files. E.g *.jpg, *.png, *.css, *.js etc

    In my case, it worked fine with urls like /register.do 🙂

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

Sidebar

Related Questions

I have the following Java socket client app, that sends same string to socket
We have a (non-web app) Spring application that throws a NoSuchBeanDefinitionException when running tests
I have what seems like a simple problem. I have a Spring web app,
I have an app that uses Spring security and BlazeDS. Flex 3.2 is used
We have a Spring + Ibatis based J2EE app. I planned to wrap around
I have two domains declared in my app. class Posts { String title String
I am using spring web mvc for my app's UI part.. By using following
I'm building a Spring MVC app with Spring 3.0.3. I have data binding of
I have a Spring app and I'm wondering the best way to serve static
I am trying to get a Java app using spring-security to talk to a

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.