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']}
精彩评论