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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T07:27:37+00:00 2026-06-05T07:27:37+00:00

I got error BindingResult nor plain target object for bean name ‘EmpPersonalBean’ available as

  • 0

I got error “BindingResult nor plain target object for bean name ‘EmpPersonalBean’ available as request attribute” when the logged successfully in the application using Spring MVC,JDBC(Version 2.5). I forward loginpage into jsp/UserPage.jsp

My folder struture is

WEB-ROOT      
  |__JSP  (folder)            
      |__user   (sub folder)                    
           |_userdashboardpage.jsp      
  |__loginpage.jsp  (In Webroot)    
  |__web.xml 

Controller :UserController Class

In this controller called onsubmit method after successfully i redirected the page.check the below code snippet

public ModelAndView onSubmit(HttpServletRequest request, HttpServletResponse response,Object command,BindException errors) throws Exception {       
         String username="",password="";
         username=request.getParameter("username");
         password=request.getParameter("password");
        UserBean ubean=null;
        HttpSession session=request.getSession(true);
         try{
             ubean=userservice.chkUsername(username,password);
             System.out.println("Information"+ubean.getUsername());
             }catch(DataException ex){
             ex.printStackTrace();

             //throw ex;
              }
        session.setAttribute("User",ubean);
        ModelAndView mv=new ModelAndView(("forward:jsp/UserPage.jsp"));
        return  mv;
    }

In the UserPage.jsp

<%@ page language="java" import="com.aims.bean.*" contentType="text/html;charset=utf-8" pageEncoding="UTF-8"%>
<%@taglib uri="http://www.springframework.org/tags/form" prefix="form" %>
<%@taglib uri="http://www.springframework.org/tags" prefix="spring" %>
<%@taglib uri="/WEB-INF/tld/c.tld" prefix="c" %>
<html>
<head>
<title>AAI</title>
</head>
<body>
<form:form method="post" modelAttribute="EmpPersonalBean" action="userpage.htm">
<table>
<tr>
    <td>Welcome <%=((UserBean)session.getAttribute("User")).getUsername()%></td>
</tr>
<tr>
        <tr>
        <td>Department</td>
        <td><form:select path="deparment">
                      <form:option value="NONE" label="--- Select ---" />
                      <form:options items="${deparmentList}" />
                       </form:select>
        </td>
    </tr>
</tr>
</table>
</form:form>
</body>
</html>

In the userpage, trying to loaded deparment list using referenceData method from UserDBBoardController.

public class UserDBBoardController  extends SimpleFormController{
    private static final Log log=new Log(UserDBBoardController.class);
    private UserService userservice;
    public void setUserservice(UserService userservice) {
        this.userservice = userservice;
    }
    public UserDBBoardController(){
        setCommandClass(EmpPersonalBean.class);
        setCommandName("EmpPersonalBean");

    }
    protected Map referenceData(HttpServletRequest request) throws Exception {
        log.info("UserDBBoardController======================referenceData");
        Map referenceData = new HashMap();
        Map deparementList=new HashMap();
        deparementList=userservice.getDeparmentList();
        referenceData.put("deparmentList",deparementList);
        return referenceData;

    }
}

Dispatcher Servlet.xml:-

<?xml version="1.0" encoding="UTF-8"?>
                <bean id="urlMapping" class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
    <property name="mappings">
        <props><prop key="/loginpage.htm">UserController</prop>
        <prop key="/userpage.htm">UserDBBoardController</prop></props>
    </property>
    </bean>
    <import resource="application-context.xml"/>
    <bean id="User" class="com.aims.bean.UserBean" scope="session" />
    <bean id="UserController" class="com.epis.controllers.UserController"  >
    <property name="userservice" ref="userservice"/>
    <property name="sessionForm"><value>true</value></property>
    <property name="commandName"><value>UserBean</value></property>
    <property name="commandClass"><value>com.aims.bean.UserBean</value></property>
    <property name="validator"><ref bean="userformValidator"/></property> 
    <property name="formView"><value>loginpage</value></property>
    <property name="successView"><value>UserPage</value></property>
    </bean>
    <bean id="UserDBBoardController" class="com.epis.controllers.UserDBBoardController"  >
    <property name="userservice" ref="userservice"/>
    <property name="sessionForm"><value>true</value></property>
    <property name="commandName"><value>EmpPersonalBean</value></property>
    <property name="commandClass"><value>com.aims.bean.EmpPersonalBean</value></property>

    </bean>

This error message came from loading of deparment list in userpage?.How to resolve this issue?.Please help.

Another doubt is Why spring MVC provides too many types of controllers?

  • 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-05T07:27:38+00:00Added an answer on June 5, 2026 at 7:27 am

    Try using This constructor for ModelAndView that also accepts Model Name and Model Object.
    http://static.springsource.org/spring/docs/2.5.x/api/org/springframework/web/servlet/ModelAndView.html#ModelAndView(java.lang.String, java.lang.String, java.lang.Object)

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

Sidebar

Related Questions

I got error No connection could be made because the target machine actively refused
when I run the below code I got error in line echo $attribute; The
When I do a Hibernate merge() to a ItemVersionLanguage object, I got ERROR [org.hibernate.LazyInitializationException]
i got error: javax.naming.NamingException: Could not dereference object [Root exception is javax.naming.NameNotFoundException:BranchProcessorLocal not bound]
I got error while binding the xml schema int Java Object by using the
I got Error Domain=ASIHTTPRequestErrorDomain Code=4 \The request was cancelled\ exception. but I do not
GOT error for the following query in MYSQL(version5.1) SELECT year,month,sum(fact_1),sum(fact_2),sum(fact_3),sum(fact_4) from( select year,month,fact_1,fact_2,0 as
I got error Access Violation when the following code is execute : void NoAction()
i always got error: Code Sign error: A valid provisioning profile matching the application's
when I run the below code, I got error Fatal error: Call to undefined

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.