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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T21:06:34+00:00 2026-06-13T21:06:34+00:00

I am trying to create a jsp form for inputting the user information. I

  • 0

I am trying to create a jsp form for inputting the user information.
I am using a controller to display the input page.
I have added an User bean object with the modelmap.The controller returns the ModelandView object.
The problem lies here.No model value gets returned to the jsp page. Anybody know why this happens??please help me…

<context:annotation-config/>
<context:component-scan base-package="com.mobilize.rest"/>
<mvc:annotation-driven/>

<bean class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping"/>


<import resource="configuration/messageConverter.xml"/>
<import resource="configuration/viewResolveContext.xml"/>

The code below shows the controller used to get the view AddUSer.jsp page
While debugging the values are properly stored in the object.
But the problem is that the object doesnt get received at the form page.

@RequestMapping(value = "/AddUser.html", method = RequestMethod.GET)

public ModelAndView addUser(
  @RequestParam(value = "reload", required = false, defaultValue = "false")
  Boolean reload,
  @RequestParam(value = "reset", required = false, defaultValue = "false")
  Boolean reset,HttpServletRequest request) {

    HttpSession httpSession = request.getSession();
    ModelMap modelmap = new ModelMap();
    Users users = new Users();

    modelmap.addAttribute("users", users);
    modelmap.addAttribute("MOB_USER_ADD_STATUS_SUCCESS_MESSAGE","trial");

    return new ModelAndView("AddUser", modelmap);
}

[Edited, additional code moved from comment section]

<div id="content" style="height:508px"> <br/>  
  <c:if test="${MOB_USER_ADD_STATUS_SUCCESS_MESSAGE!=null}"> 
    <div align="center" 
           id="statusIndicator"
        class="successMessage">${MOB_USER_ADD_STATUS_SUCCESS_MESSAGE}
    </div> 
  </c:if> 
  ${MOB_USER_ADD_STATUS_SUCCESS_MESSAGE} 
  <form:form commandName="users" 
                  method="POST" 
                  action="AddUser.html"> 
    <table> 
     <tr>
       <td> User Name: </td>
       <td><form:input path="userName" 
                         id="username">
           </form:input> 
       </td> 
     </tr> 
     <tr> 
       <td></td> 
       <td><form:errors path="userName" 
                    cssClass="errorMessage">
           </form:errors>
       </td> 
     </tr> 
     <tr> 
       <td> Password: </td> 
       <td> <form:textarea path="password" id="password"></form:textarea> </td> 
     </tr> 
     <tr> 
       <td></td> 
       <td><form:errors path="password" cssClass="errorMessage"></form:errors></td>
     </tr> 
     <tr> 
       <td></td> 
       <td> <input type="submit" name="offer" value=" Add "/> 
            <input type= "reset" 
                   name="Reset" 
                  value=" Reset "
                onclick="document.location.href='AddUser.html?reset=true'"/> 
        </td> 
      </tr> 
   </table> 
  </form:form> 
</div>
  • 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-13T21:06:34+00:00Added an answer on June 13, 2026 at 9:06 pm

    The mistake was i imported the wrong class. Instead of importing org.springframework.web.servlet.ModelAndView , i imported
    org.springframework.web.portlet.ModelAndView. That was the reason for the error. I should have been a bit more careful.

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

Sidebar

Related Questions

im using struts 1.2 and trying to create a link in jsp page with
I'm trying to create an HTML form (using JSP) which contains Javascript buttons (rather
i'm trying to create a registration system using jsp, beans and servlets. Registration process
I'm trying to dynamically create a form using JQuery. In order to do this,
I have a jsp and I create a spring checkbox like this: <form:checkbox path=someList
I am trying to create a form using the Spring Framework, but according to
I have this jsp page - <%@page import=java.text.Normalizer.Form%> <!DOCTYPE html PUBLIC -//W3C//DTD HTML 4.01
I'm trying to create jsp page which will create a svg graphic file. Based
im trying to create an xml data into JSP using a resource file: MyData.properties
I'm trying to create a form using Spring @MVC 3.0. This form is supposed

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.