Function 如何调用bean';jsp中带param的s函数

Function 如何调用bean';jsp中带param的s函数,function,jsp,parameter-passing,javabeans,Function,Jsp,Parameter Passing,Javabeans,com.app.util.LangSupport具有函数getJsonString(字符串区域设置)以按区域设置返回json字符串 在JSP中,如何将区域设置从请求的参数传递到bean的getJsonString(字符串区域设置)以获取json字符串,以便会话中的其他javascript可以使用该字符串 这样行吗?如果没有,正确的方法是什么 app.lang_json = <%=theBean.getJsonString(<%=request.getParameter("lang_l

com.app.util.LangSupport具有函数getJsonString(字符串区域设置)以按区域设置返回json字符串

在JSP中,如何将区域设置从请求的参数传递到bean的getJsonString(字符串区域设置)以获取json字符串,以便会话中的其他javascript可以使用该字符串

这样行吗?如果没有,正确的方法是什么

app.lang_json = <%=theBean.getJsonString(<%=request.getParameter("lang_locale")%>)%>;
app.lang_json=;
在JSP中,它具有bean

<jsp:useBean id="theBean" class="com.app.util.Support" />

<html>
<head>
<script type="text/javascript">

    var app = ${theBean.init};
    app.lang_json = <%=theBean.getJsonString('<%=request.getParameter("lang_locale")%>')%>;
<body>
......
</body>
</html>

var app=${theBean.init};
app.lang_json=;
......

这似乎会奏效。如果有人知道更好的方法,请更新谢谢

<jsp:useBean id="theBean" class="com.app.util.Support" />

<%! String strLocale; %>

<html>
<head>
<script type="text/javascript">

    var app = ${theBean.init};
    <% strLocale=request.getParameter("lang_locale"); %>
    app.lang_json=<%=theBean.getJsonString(strLocale) %>;

<body>
......
</body>
</html>

var app=${theBean.init};
app.lang_json=;
......