English 中文(简体)
Equivalent to Struts 1.x“bean:define”tag?
原标题:Equivalent to Struts 1.x "bean:define" tag?

I m 致力于将旧的Stuts 1.x应用转换到Spring MVC,并在JSP的一些网页上将bean:define tag用于从资源棒上进行扼杀,随后在网页上使用:

<bean:define id="example_title"><fmt:message bundle="${example_Labels}" key="example_field"/></bean:define>

嗣后:

title="<%=example_title%>"

我不敢确定,为了与Stuts 标签公司打交道,对等的“共同财产”标签(或者甚至应当为“共同财产法”)究竟是什么? I ve试图与JSTLsetjsp:useBean玩,,但要么改道,要么不适当地执行。

感谢任何建议!

最佳回答

使用<代码>var属性:message

<fmt:message bundle="${example_Labels}" key="example_field" var="example_title" />

这基本上将钥匙的相关价值出口到一个页码范围变量,名称为example_title/code>。 页: 1

title="${example_title}"

或者,如果你仍在JSP-2.0前,模版中的EL支持(考虑升级),则使用<代码><c:out>显示:

title="<c:out value="${example_title}" />"
问题回答

您可使用美元{}的电文。

<%
  title = ${example_title}
%>

如果你想要打印,你可以使用<代码><c:out>

<c:out value=${example_title}/>

Here s





相关问题
Convert typed-in Text to lowercase

I ve got an index.jsp with [snip] <% String name = request.getParameter("name"); String pass = request.getParameter("pass"); String globalname = "webeng"; String globalpass = "2009"; ...

session transfer issue from Tomcat to ASP.Net

I am using Tomcat to host JSP and using IIS 7.0 to host aspx (C# + .Net 3.5 + VSTS 2008), and I have some session transfer issue from JSP page to ASPX page. JSP page is in one domain and all other ...

Setting the default value in Struts2

I am setting the value(kind of default value) for a drop down select value from action class in a page(given below). When the page loads the value is beig displayed but the other elements of the ...

Evaluate dynamically constructed JSP at runtime

I have a requirement where in the JSP page itself is created by the user and stored in the database. When viewing results we need to render this JSP to the client, evaluating all tags inside this JSP. ...

How to Pack/Encrypt/Unpack/Decrypt a bunch of files in Java?

I m essentially trying to do the following on a Java/JSP-driven web site: User supplies a password Password is used to build a strongly-encrypted archive file (zip, or anything else) containing a ...

JSP exception - class not found (tomcat)

I m setting up an existing application on a new Tomcat 5.5 server connecting to a Postgres database (running on Debian Lenny). When I access it I get a series of stack traces with the following root ...

ArrayList to Table in JSP

I have an ArrayList and i am trying to display it in a table ..... ArrayList rows = .... ..... <table cellspacing="1" cellpadding="4" border="3"> <tr> <TH>...

热门标签