Hello Hussein, thanks for the reply!.
Hussein Baghdadi wrote:It isn't a good practice to access Spring managed beans from JSP pages. Separate the logic from the presentation.
What I'm talking about is to employ MVC design pattern. Access your Spring managed beans from a servlet/controller and then use JSP to display the data in question.
I am trying to follow the MVC pattern like you said but now I am confused. How can I access a bean without using the JSP??
I mean, in the controller that I made I am returning the "authentication" bean, which is the one that I will use in the JSP:
And in the JSP (login.jsp):
Am I following the MVC pattern right? did I made a mistake?
Thanks if you can clarify this to me!..
Take care
PD: with the AuthenticationResult class what I am trying to do.. if the authentication is false, I get some error codes from the authentication service. What I want to do in the JSP, if the authentication is false.. then I show this messages in the JSP. (login.jsp)