开发者

Seam <s:link> and link caption

开发者 https://www.devze.com 2023-01-23 06:00 出处:网络
In one of my pages <s:link value=\"/index.seam\"><h:outputText value=\"#{messages.home}\"/></s:link&g开发者_StackOverflow中文版t;

In one of my pages

<s:link value="/index.seam"><h:outputText value="#{messages.home}"/></s:link&g开发者_StackOverflow中文版t; 

renders as

<a href="/acm20/index.seam?cid=64" id="j_id9">/index.seamHome</a>

How can I get rid of the "/index.seam" in front of "Home" ?


Because these two are exactly the same:

<s:link value="/index.seam" />
<s:link><h:outputText value="/index.seam"/></s:link>

You have to write

<s:link view="/index.xhtml"><h:outputText value="#{messages.home}"/></s:link>

Or of course the one I prefer:

<s:link view="/index.xhtml" value="#{messages.home}"/>

The key is to use the view attribute, not value on s:link

Why are you using #{messages.home} btw? If you want to use the message property file, the correct syntax is #{messages['home']}

0

精彩评论

暂无评论...
验证码 换一张
取 消