Preserving session in Java with sendredirect

前端 未结 4 1170
慢半拍i
慢半拍i 2020-12-16 16:49

I am creating a Login Application in JAVA.I am making the presentation in JSP and all the logic (Database connectivity) in Servlet [this is not a right approach I know that]

4条回答
  •  伪装坚强ぢ
    2020-12-16 16:57

    Use the RequestDispatcher and set your username variable using request.setAttribute(). In this case the dispatcher will not create a new request but the same request will be forwarded using the forward() method.

提交回复
热议问题