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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T10:02:27+00:00 2026-05-21T10:02:27+00:00

And Thank you for reading me… I have an application with MVC Pattern with

  • 0

And Thank you for reading me…

I have an application with MVC Pattern with Hibernate, JSF2, RichFaces, Spring 3…

I have the login form working, but it´s impossible to show login errors… Why?

application-context:

<sec:form-login login-page="/pages/loginPage.xhtml"
 login-processing-url="/j_spring_security_check"
 authentication-success-handler-ref="myAuthSuccessHandler"
 authentication-failure-handler-ref="myAuthErrorHandler"/>

UserAuthenticationErrorHandler:

public class UserAuthenticationErrorHandler implements AuthenticationFailureHandler {
...
@Override
public void onAuthenticationFailure(HttpServletRequest request,
     HttpServletResponse response, AuthenticationException ae)
     throws IOException, ServletException {

    UsernamePasswordAuthenticationToken user = (UsernamePasswordAuthenticationToken)ae.getAuthentication();
    request.setAttribute("error", "Can you Show me???");
    response.sendRedirect("......");

}
...
}

And finally the login.xhtml that DON´T SHOW THE ERRORS 🙁

<c:out value="${SPRING_SECURITY_LAST_EXCEPTION.message}" />

        <c:out value="${error}"/>

        <c:if test="${not empty param.error}">
            Habemus error
        </c:if>

Any Idea??? Thank You very much!

  • 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-21T10:02:28+00:00Added an answer on May 21, 2026 at 10:02 am
    <c:out value="${SPRING_SECURITY_LAST_EXCEPTION.message}" /> 
    

    displays a session attribute published by Spring Security, so it should work fine.

    With

    request.setAttribute("error", "Can you Show me???");  
    ...
    <c:out value="${error}"/> 
    

    you try to display request attribute. However, request attributes doesn’t survive the redirect. If you need to pass a message over redirect, you can use session attribute instead:

    request.getSession().setAttribute("error", "Can you Show me???");  
    

    In

    <c:if test="${not empty param.error}">
    

    you check for request URL parameter named error. You should set that parameter when forming redirection URL:

    response.sendRedirect("......?error=1");     
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Thank you for reading. I'm trying to create a HTML form so that my
Hello and thank you for reading, I have a task to authenticate a un
I'm working on a forum application in PHP. In signature field I have <img
Thank you for reading, I have two classes with two propertys. I would like
Thank you for reading my question. I am building a form that will let
Hi and thank you for reading. I have two tables with the same columns.
I have been doing a lot of reading on LINQ to XML but unfortunately
Thank you for reading, essentially I have a matrix of Boolean values and to
Thanks for reading this. I have markup similar to what is below. Using the
Thanks for reading this I thought I could use find(), but couldn't make it

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.