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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T09:53:56+00:00 2026-06-15T09:53:56+00:00

I have a controller class with a RequestMapping method. This method is not being

  • 0

I have a controller class with a RequestMapping method. This method is not being rendered. I do not see any errors in my console. I am sure my request is being mapped correctly tried with some print statements. But the view is not rendering also there is no error in the log. I just get an HTTP 404 in browser. Not sure what is wrong when other views are being rendered properly. I have read the following question SpringMVC giving 404 returning a view
but does not help.

Here is the request mapping method. Not sure what is wrong or how to debug it? All my jsp files are in one directory. I also have a public default constructor in my Controller. But something else could be wrong with my controller which I don’t see yet. Here is the link to the more detailed code if you want more details.
https://github.com/C4G/V2V/blob/cbc4a8d9e904ab1f5bf47b9550a0879ccff33b01/src/controller/TestResultsController.java

  @RequestMapping(value = "/editTestResultFormGenerator", method = RequestMethod.GET)
  public ModelAndView editTestResultFormGenerator(HttpServletRequest request,
      Model model,
      @RequestParam(value="collectionNumber", required=false) Long collectionNumber,
      @RequestParam(value="collectionId", required=false) Long collectionId) {

    TestResultBackingForm form = new TestResultBackingForm();

    ModelAndView mv = new ModelAndView("editTestResultForm");
    Map<String, Object> m = model.asMap();
    m.put("refreshUrl", getUrl(request));
    m.put("existingTestResult", false);
    if (collectionId != null) {
      form.setId(collectionId);
      TestResult testResult = testResultRepository.findTestResultByCollectionId(collectionId);
      if (testResult != null) {
        form = new TestResultBackingForm(testResult);
        m.put("existingTestResult", true);
      }
      else {
        form = new TestResultBackingForm();
      }
    }

    addEditSelectorOptions(m);
    m.put("editTestResultForm", form);
    m.put("refreshUrl", getUrl(request));
    // to ensure custom field names are displayed in the form
    m.put("testResultFields", utilController.getFormFieldsForForm("TestResult"));
    System.out.println(m);
    mv.addObject("model", m);
    return mv;
  }
  • 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-15T09:53:57+00:00Added an answer on June 15, 2026 at 9:53 am

    Found the problem. With Eclipse autocomplete I chose the wrong ModelAndView class.

    I should have chosen.

    import org.springframework.web.servlet.ModelAndView;
    

    whereas I chose

    import org.springframework.web.portlet.ModelAndView;
    

    That explains it.

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

Sidebar

Related Questions

This is my code: @Controller @RequestMapping(loginform.htm) public class LoginController { @RequestMapping(method = RequestMethod.GET) public
I have some kind of controller: @Controller public class DefaultController { @RequestMapping(value=/index.html, method=RequestMethod.GET) public
I have @Controller @RequestMapping(value=core/*) public class CoreController { public static String exceptionOccurredView = /core/exceptionOccurred;
I have this controller: public class StandingsController : Controller { public ViewResult Index(int id)
I have a controller that looks like this: public class PageController : Controller {
I have a Spring MVC Controller class (bean): @Controller @RequestMapping(/index.jsp) public class EjbCaller {
I have the following controller @Controller @RequestMapping(/project/view.html) public class ProjectViewController { private static final
Have Controller: public class MyController : Controller { [HttpGet] public ActionResult MyAction(int iMode, string
I have a controller class as in the following code segment: @Controller public class
Given I have a controller class as such: public class ResourceController : AuthorizedController {

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.