2 Replies Latest reply on May 6, 2008 4:26 AM by seanelias

    authentication action - validation overrides other messages.

    seanelias

      Hi, I have a authentication action set in the components.xml to log the user in similar to the booking example, though it returns a boolean - I thought you had to return a boolean for the authentication method but booking example does not - how does this work?


      My main issue is around validation. I have validation on the entity user object around username and password can not be null and must be certain length.


      None of this validation is displayed. It is alwasy overriden by a default message Please Log in First. Does any one know how to stop this - if the user tries to login but validation fails it should not display this - It should display the correct validation on the entity.


      This works for all my other class just not the authentication class.

        • 1. Re: authentication action - validation overrides other messages.
          tyshan.tyshanchn.gmail.com

          see the resource file, message.properties. under the path resource/WEB-INF/


          good luck


          • 2. Re: authentication action - validation overrides other messages.
            seanelias

            Yes I checked there first but that was not my problem. My problem was that I had a redirect to a secure page that was happening regardless of whether login in was successfull and relying on the fact that the secure page would restrict access as there was not authenticated user - So this explains why I get the message please log in first, i guess this is somthing in the framework as I removed the property from the message.properties and you still get that message under the redirect scenario.


            The fix was to add a if statement that checked if the user was authenticated in the pages.xml and only redirect if so.


            However I still have the issue that the @Valid annotation placed on my entity bean in the action class is not producing any validation messages, though I can add my my own message to the facesContext programatically in the action class.