【问题标题】:saving struts2 tag information in localStorage在localStorage中保存struts2标签信息
【发布时间】:2014-01-10 15:49:13
【问题描述】:

我有一个使用 struts2 标记 <s:property value="list_Name" /> 在 jsp 页面中调用的字符串,它显示了一些名称,它工作得非常好。但是有没有办法将这些信息直接保存到本地存储以供以后显示?

【问题讨论】:

    标签: jsp web struts2 tags local-storage


    【解决方案1】:

    没关系!我使用的是 scriptlet 标签和 javascript。我确信这不是最好的方法。但它有效!

    <%@ page language="java" import="aPackage.*"%>
    ...
    <% aObject obj = new aObject(); %>
    localStorage.setItem("aVar","<%=  obj.getAVariable() %>");
    ...
    // anything else you want to do with the item now in local storage
    

    除非其他人有更好的主意,这可能是很多人在这里:)

    【讨论】:

      猜你喜欢
      • 2022-12-06
      • 1970-01-01
      • 1970-01-01
      • 2018-10-20
      • 1970-01-01
      • 1970-01-01
      • 2018-05-30
      • 2011-08-05
      • 1970-01-01
      相关资源
      最近更新 更多