![](/img/trans.png)
[英]how to make use of Javascript variable which are defined on index.html/index.jsp to Vue.js?
[英]Session variable set in index.jsp returns null when accessed 3rd or 4th time by javascript in others jsp's
該項目正在使用Spring Framework。
流程如下:
直到這里沒有問題。 但是在我單擊其他鏈接,例如“ /test.jsp”時,“ test.jsp”中的javascript返回null
var countryCode ='<%= session.getAttribute(“ countryCode”)%>';;
同樣,如果我單擊“ /index.jsp”,它會將我重定向到“ country.html”,因為
coun =(String)objectSession.getAttribute(“ countryCode”);
我猜在scriptlet中為null。
我正在使用response.SendRedirect(),它在每次嘗試時都創建一個新會話。 現在我只使用控制器,而不是使用ModelAndView重定向到所需頁面。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.