maybe i don't understand attributes, but here is my question/problem:
so if i point straight to GuestJsp, it goes to logintest.jsp and brings up "attribute test" where it should. however, when you click the again link it reloads the same page but at the direct url for the page and brings up null. the attribute gets lost somewhere. so are attributes that are set in a servlet only valid while in the servlet url?
request.setAttribute() sets the value in the current request. When you use RequestDispatcher and forward(), the same request is forwarded to the jsp and you get access to the value set in the attribute.
Now when you click the link, the request gets redirected to the page. So it is another request at this time and the original request and any values associated with it are gone at this point. Clickiing the link never goes to the Servlet again, it is directly redirected to the page by the web server.
Your subject indicates that you expect the scoped variables (the correct term for attributes placed onto a scope) to be in the session, yet you are placing them in request scope. If you want the scoped variables to survive across multiple requests, you must place them in session scope.