I have a index page of my website. it will change if user is login or not. I know how to do just by using jsp. but this is not the right way bc I am using java code in html file.

so here is ex of doing it just by jsp
		if (session.getAttribute("username") != null) {
                                     user | option | logout
		} else {
                              login | forgotpassword | create account

so I want to do the same thing only doing it by the right way(jsp/servlets). I tried look up but cant find any thing.