In order to login a user to our web-site we have a method
public User authenticate(String id, String password);
i.e. it authenticates a User and returns a populated User object otherwise it returns null.
This method is recieved by a JSP which authenticates the User and forward the USer to another JSP.
Now, should the method be static ?
OR
Should the class be Singleton ?
OR
Should the class have Application Scope i.e.
<jsp:useBean class="Authenticate" scope="Application" />
OR
Should we create a new object of the class everytime?
public User authenticate(String id, String password);
i.e. it authenticates a User and returns a populated User object otherwise it returns null.
This method is recieved by a JSP which authenticates the User and forward the USer to another JSP.
Now, should the method be static ?
OR
Should the class be Singleton ?
OR
Should the class have Application Scope i.e.
<jsp:useBean class="Authenticate" scope="Application" />
OR
Should we create a new object of the class everytime?