Using Javascript can you get the value from a session attribute set by servlet in the HTML page

后端 未结 4 903
失恋的感觉
失恋的感觉 2020-12-08 04:26

I have a servlet that forwards to a HTML page, using redirect. Because I am using ajax and php on the html page to do other functions. Can turn into a jsp. Is there a way I

4条回答
  •  情书的邮戳
    2020-12-08 05:08

    Below code may help you to achieve session attribution inside java script:

    var name = '<%= session.getAttribute("username") %>';
    

提交回复
热议问题