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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:13:04+00:00 2026-05-28T05:13:04+00:00

In my web.xml page I have the 404 error mapped to a jsp page

  • 0

In my web.xml page I have the 404 error mapped to a jsp page as:

<error-page>
  <error-code>404</error-code>
  <location>/WEB-INF/jsp/errorPages/error404.jsp</location>
</error-page>

The redirect on 404 works fine. I get to error404.jsp. The problem is that I have a spring form on the page (a search form that is on EVERY page) which causes errors because the target object is not in the model. I get the following exception:

Caused by: java.lang.IllegalStateException: Neither BindingResult nor
plain target object for bean name ‘searchCriteria’ available as request attribute

I’d like to have this search form on every page, including the error pages. Is there any way to do this? I realize that 404 as I have it configured above doesn’t go to a servlet… so how do I get the request attribute into the model?

  • 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-05-28T05:13:05+00:00Added an answer on May 28, 2026 at 5:13 am

    The way to do this is to map the error pages to a servlet. Within the servlet you can add things to your model just like you can in any other servlet. To map error pages to a servlet, add something like the following to your web.xml file:

      <error-page>
        <error-code>404</error-code>
        <location>/error/generalError</location>
      </error-page>
    

    where “error” is the servlet name and “generalError” is the request mapping.

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

Sidebar

Related Questions

I have an application web.xml with the following entry: <error-page> <error-code>404</error-code> <location>/system_files/error/p_notfound.jsp</location> </error-page> However,
I have this XML in my web.xml file: <error-page> <error-code>404</error-code> <location>/error/html/404</location> </error-page> If I
I have a Error404Servlet which is configured as error-page for 404 in web.xml: <servlet>
I have an error page error.jsf mentioned in the web.xml : <error-page> <exception-type>javax.faces.application.ViewExpiredException</exception-type> <location>/viewExpired.jsp</location>
i have a number of jsp files under web-inf folder. Inside my web.xml i
in web.xml i set my welcome file to a jsp within web.xml <welcome-file>WEB-INF/index.jsp</welcome-file> inside
We have the usual web.xml for our web application which includes some jsp and
I have a page with 5 Sharepoint web part zones and an XML web
I have an error-page directive which redirect all exception to an error display page
I already have the following declared in my pages.xml : <exception> <http-error error-code=500 />

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.