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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T07:01:06+00:00 2026-06-07T07:01:06+00:00

I’ve got the following controller… @Controller @RequestMapping(value = /userManagement) public class UserManagementController { @RequestMapping(value

  • 0

I’ve got the following controller…

@Controller
@RequestMapping(value = "/userManagement")
public class UserManagementController {

@RequestMapping(value = "/", method = RequestMethod.GET)
    public Object home(Locale locale, Model model) {

        logger.info("User management view controller loaded...");

        return "userManagement";
    }

@RequestMapping(value = "/createUserView", method = RequestMethod.GET)
    public Object createUser(Locale locale, Model model) {
        logger.info("create controller loaded...");
        return "createUser";
    }

My servlet-context is setup with the following values…

<beans:bean
    class="org.springframework.web.servlet.view.InternalResourceViewResolver">
    <beans:property name="prefix" value="/WEB-INF/views/" />
    <beans:property name="suffix" value=".jsp" />
</beans:bean>

Now if I go to http://localhost:8080/myapp/userManagement then I get the view userManagement.jsp which is exactly what I want…

But if I go to http://localhost:8080/myapp/userManagement/createUserView I get a 404 error.

NetworkError: 404 Not Found - http://localhost:8080/myapp/userManagement/createUserView"

What I don’t see is why this would occur as I’ve set the requestMapping up exactly the same as above and in /WEB-INF/views I’ve got a createUser.jsp and userManagement.jsp

Is there anything I’m doing wrong with regards to serving up the views from spring mvc?

Thanks,

EDIT : web.xml added below…

<?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" version="2.5">
  <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>/WEB-INF/spring/root-context.xml 
    /WEB-INF/spring/security-app-context.xml
    /WEB-INF/spring/appServlet/servlet-context.xml</param-value>
  </context-param>
  <filter>
    <filter-name>springSecurityFilterChain</filter-name>
    <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
</filter>
<filter-mapping>
  <filter-name>springSecurityFilterChain</filter-name>
  <url-pattern>/*</url-pattern>
</filter-mapping>
  <listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
  </listener>
  <servlet>
    <servlet-name>appServlet</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <init-param>
      <param-name>contextConfigLocation</param-name>
      <param-value>/WEB-INF/spring/appServlet/servlet-context.xml</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
  </servlet>
  <servlet-mapping>
    <servlet-name>appServlet</servlet-name>
    <url-pattern>/</url-pattern>
  </servlet-mapping>
</web-app>

EDIT2:

Also, if I go directly to the address in the browser rather than using Ajax (going to myapp/userManagement/createUserView I get the error…

HTTP Status 404 – /myapp/WEB-INF/views/userManagement/createUserView.jsp so it appears to be looking at a directory too high (although the wrong filename too).

EDIT3.

Ok, it appears to be even when I do the following..

    @Controller
@RequestMapping(value = "/userManagement")
public class UserManagementController {

    @RequestMapping(value = "/", method = RequestMethod.GET)
        public Object home(Locale locale, Model model) {

            logger.info("User management view controller loaded...");

            return "createUser";
        }

I’m still presented with the userManagement.jsp page, so it appears as if this return is not firing correctly, but I have no idea why. The logger detail does still get fired to the console so it is actually reaching there, just something odd with the way springmvc is returning the JSP.

  • 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-07T07:01:08+00:00Added an answer on June 7, 2026 at 7:01 am

    Can you check for 2 things:
    1) Add breakpoint to controller or look at server log, check if request enters the method.
    2) If 1st step is fine, check if jsp is present at correct path or the name of jsp is correct

    EDIT

    Wait, if you are using Ajax for request, your controller should have following requestMapping:

      @RequestMapping(value = "/url", method = RequestMethod.GET, 
      headers = "X-Requested-With=XMLHttpRequest")
    

    Else your ajax request will not get mapped and you will get 404.

    Side Note
    Can you change method return type from Object to String? See if that impacts anything?

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

Sidebar

Related Questions

i got an object with contents of html markup in it, for example: string
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I've got a string that has curly quotes in it. I'd like to replace
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I am doing a simple coin flipping experiment for class that involves flipping a
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
public static bool CheckLogin(string Username, string Password, bool AutoLogin) { bool LoginSuccessful; // Trim
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example

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.