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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T22:05:11+00:00 2026-06-16T22:05:11+00:00

sorry for asking that error i have seen in many answer but i could

  • 0

sorry for asking that error i have seen in many answer but i could not able to resolve my error so plz help me out .
My requirement is getting the employee based on id no i m geeting the parameter in my controller using annotation but i dont why this error is comming

    SEVERE: Servlet.service() for servlet [jsp] in context with path [/EmployeeWebSpring] threw exception [java.lang.IllegalStateException: Neither BindingResult nor plain target object for bean name 'empDetails' available as request attribute] with root cause
java.lang.IllegalStateException: Neither BindingResult nor plain target object for bean name 'empDetails' available as request attribute
    at org.springframework.web.servlet.support.BindStatus.<init>(BindStatus.java:141)
    at org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag.getBindStatus(AbstractDataBoundFormElementTag.java:178)
    at org.springframework.web.servlet.tags.form.AbstractDataBoundFormElementTag.getPropertyPath(AbstractDataBoundFormElementTag.java:198)
    at org.springframework.web.servlet.tags.form.LabelTag.autogenerateFor(LabelTag.java:129)
    at org.springframework.web.servlet.tags.form.LabelTag.resolveFor(LabelTag.java:119)
    at org.springframework.web.servlet.tags.form.LabelTag.writeTagContent(LabelTag.java:89)
    at org.springframework.web.servlet.tags.form.AbstractFormTag.doStartTagInternal(AbstractFormTag.java:102)
    at org.springframework.web.servlet.tags.RequestContextAwareTag.doStartTag(RequestContextAwareTag.java:79)
    at org.apache.jsp.Search_jsp._jspx_meth_form_005flabel_005f0(Search_jsp.java:229)
    at org.apache.jsp.Search_jsp._jspx_meth_form_005fform_005f0(Search_jsp.java:157)
    at org.apache.jsp.Search_jsp._jspService(Search_jsp.java:95)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:432)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:390)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:334)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
    at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:579)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:307)
    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
3 Jan, 2013 2:23:33 PM org.apache.jasper.compiler.TldLocationsCache tldScanJar
INFO: At least one JAR was scanned for TLDs yet contained no TLDs. Enable debug logging for this logger for a complete list of JARs that were scanned but no TLDs were found in them. Skipping unneeded JARs during scanning can improve startup time and JSP compilation time.
3 Jan, 2013 2:23:33 PM org.apache.catalina.core.StandardWrapperValve invoke
SEVERE: Servlet.service() for servlet [jsp] in context with path [/EmployeeWebSpring] threw exception [An exception occurred processing JSP page /Search.jsp at line 26

23: 
24: 
25:             <tr>
26:                 <td><form:label path="employeeNo">Employee_ID</form:label> <form:input
27:                         path="employeeNo" /></td>
28:                 <td><input type="submit" name="method" value="FindById" /></td>
29:             </tr>


Stacktrace:] with root cause

This is my controller

package com.nousinfo.tutorial.controllers;

import java.util.List;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.dao.EmptyResultDataAccessException;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;


import com.nousinfo.tutorial.service.impl.EmployeeServiceImpl;
import com.nousinfo.tutorial.service.model.EmployeeBO;
@Controller

public class SearchEmployeeController  {
    private EmployeeServiceImpl employeeServiceImpl;

    public void setEmployeeServiceImpl(EmployeeServiceImpl employeeServiceImpl) {
        this.employeeServiceImpl = employeeServiceImpl;
    }
    @ModelAttribute("empDetails")
    @RequestMapping(value="/search.spring" ,method=RequestMethod.POST)
    public ModelAndView searchByEmpNo(@RequestParam("employeeNo") long employeeNo) throws Exception {
        EmployeeBO empDetails = null;
        try {
            if (employeeServiceImpl.getEmployee(employeeNo) != null) {
                empDetails = employeeServiceImpl.getEmployee(employeeNo);
            }
        } catch (EmptyResultDataAccessException e) {
            return new ModelAndView("successSingleEmp", "empDetails",
                    empDetails);
        }
        return new ModelAndView("successSingleEmp", "empDetails", empDetails);
    }
}

and this is my jsp file

    <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://www.springframework.org/tags" prefix="spring"%>

<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>

<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>


<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<fmt:setBundle basename="ApplicationResources" />
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Employee Search Page</title>
</head>
<body>
<form:form action="/search.spring" method="post" modelAttribute="empDetails">
        <table border="0">



            <tr>
                <td><form:label path="employeeNo">Employee_ID</form:label> <form:input
                        path="employeeNo" /></td>
                <td><input type="submit" name="method" value="FindById" /></td>
            </tr>
            <tr>
                <td><form:label path="empName">Employee_Name</form:label>
                <form:input path="empName"/></td>
                <td><input type="submit" name="method" value="FindByName" /></td>
                </tr>


            <tr>
                <td><form:label path="deptNo">Employee_Name</form:label>
                <form:input path="deptNo"/></td>
                <td><input type="submit" name="method" value="FindByDeptNO" /></td>
                </tr>
            <tr>
                <td colspan="2" align="center"><font size=3>For
                        Searching the employees by<b>Employee Name</b><br />you can use %
                        match all the records with the given pattern
                </font><br /> <font size="2"> <i>e.g <b> for search by</b>EmployeeName<br />
                            matches alL the employees whose name starts with character <b>S</b></i></font></td>
            </tr>
        </table>
    </form:form>
</body>
</html>

and this is my webConfig-context.xml

  <?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:p="http://www.springframework.org/schema/p"
       xmlns:context="http://www.springframework.org/schema/context"
       xmlns:mvc="http://www.springframework.org/schema/mvc"
       xsi:schemaLocation="http://www.springframework.org/schema/beans 
                           http://www.springframework.org/schema/beans/spring-beans-3.2.xsd
                           http://www.springframework.org/schema/context 
                           http://www.springframework.org/schema/context/spring-context-3.2.xsd
                           http://www.springframework.org/schema/mvc
                           http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd">

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


<bean id="viewResolver"
      class="org.springframework.web.servlet.view.InternalResourceViewResolver"
      p:prefix="/WEB-INF/"
      p:suffix=".jsp" />

    <!-- configuring BeanNameViewResolver -->
    <bean class="org.springframework.web.servlet.view.BeanNameViewResolver"></bean>

    <!-- configuring exception Resolver -->
    <bean
        class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver">
        <property name="exceptionMappings">
            <props>
                <prop key="org.springframework.dao.DAOException">dberrorView</prop>
                <prop key="java.lang.NumberFormatException">notANumber</prop>
            </props>
        </property>
    </bean>
    <!-- configuring views required to render the view for /search.spring -->
    <bean name="successSingleEmp" class="org.springframework.web.servlet.view.JstlView">
        <property name="url" value="/WEB-INF/EmployeeDetail.jsp" />
    </bean>
    <bean name="successMultipleEmps" class="org.springframework.web.servlet.view.JstlView">
        <property name="url" value="/WEB-INF/EmployeeList.jsp" />
    </bean>
    <bean name="dberrorView" class="org.springframework.web.servlet.view.JstlView">
        <property name="url" value="/WEB-INF/DBError.jsp" />
    </bean>
    <bean name="notANumber" class="org.springframework.web.servlet.view.JstlView">
        <property name="url" value="/WEB-INF/NotANumberError.jsp" />
    </bean>
    <!-- CONFIGURING THE MEASSAGE RESOURCES FOR THIS APPLICTION CONTEXT -->
    <bean id="messageSource"
        class="org.springframework.context.support.ResourceBundleMessageSource">
        <property name="basename" value="/com/nousinfo/resources/ApplicationResources" />
    </bean>
</beans>

this is web.xml

 <?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"
    id="WebApp_ID" version="2.5">
    <display-name>EmployeeWebSpring</display-name>

    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>WEB-INF/webConfig-context.xml</param-value>
    </context-param>

    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>
    <!-- The front controller of this Spring Web application, responsible for 
        handling all application requests -->
    <servlet>
        <servlet-name>ds</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <init-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>/WEB-INF/services-context.xml, /WEB-INF/webConfig-context.xml</param-value>
        </init-param>

        <load-on-startup>1</load-on-startup>
    </servlet>
    <!-- Map all requests to the DispatcherServlet for handling -->
    <servlet-mapping>
        <servlet-name>ds</servlet-name>
        <url-pattern>*.spring</url-pattern>
    </servlet-mapping>
</web-app>
  • 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-16T22:05:16+00:00Added an answer on June 16, 2026 at 10:05 pm

    My guess is that your are not adding empDetails to the initial view

    The error is telling you that

    @ModelAttribute("empDetails")
    

    is not present as part of the POST request. Why is this a model attribute on the method if you are always setting it to null?

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

Sidebar

Related Questions

Sorry for asking something that is widely documented, but I came across so many
Sorry for asking a stupid question but I have a problem that makes me
Sorry for asking a totally basic question, but if I have a synthesized property
Sorry I'm asking too many questions in a row. I have a list of
Sorry asking so many questions but believe me.. I tried Google first. :) When
Really sorry to have to resort to asking questions on a forum but I
Sorry for asking this but, I cant found a solution that will get this
sorry for re-asking, but i have new circumstances. here was my question .net -
Sorry that I have to describe the functionality in such a roundabout manner, but
Sorry for asking such a basic question but so far all the examples that

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.