I think kgiannakakis solution is very good. I just want to add some details, because while reading Agusti-N's comment, I have a suspect, maybe he is missing something.
Let's say that you have a UsersServlet described by kgiannakakis, jsp called showUserProfile.jsp and userBean , which has all the properties, the user profile should be displayed in jsp.
When a new user logs into your application, you only need to do more than what you are already doing now. Just register a new user in db and forget the registration servlet .
Now suppose I signed up for your application with my username alexmeia .
- yourApp/Users/alexmeia, UsersServlet . alexmeia URL- , ,
userBean.
showUserProfile.jsp, , userBean.
, alexmeia Db, userNotFound.jsp ...
. URL .