You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by ma...@dataductus.se on 2001/02/12 21:17:27 UTC

template-example and i18n

Hi,

I thought it would be nice to use the template-example technique with the i18n 
support in struts but is running into problem.

Below is a code snippet for the entry to the web I\'m building - slightly 
modified from the template-example example.


<%@ page language=\"java\" %>
<%@ taglib uri=\"/WEB-INF/struts-bean.tld\" prefix=\"bean\" %>
<%@ taglib uri=\"/WEB-INF/struts-html.tld\" prefix=\"html\" %>
<%@ taglib uri=\"/WEB-INF/struts-logic.tld\" prefix=\"logic\" %>
<%@ taglib uri=\'/WEB-INF/struts-template.tld\' prefix=\'template\' %>

<template:insert template=\'/template.jsp\'>
  <template:put name=\'title\' content=\'Templates\' direct=\'true\'/>
  <template:put name=\'header\' content=\'/header.html\' />
  <template:put name=\'sidebar\' content=\'/sidebar.jsp\' />
  <template:put name=\'content\' content=\'/welcome.jsp\'/>
  <template:put name=\'footer\' content=\'/footer.html\' />
</template:insert>

Instead of using the Name \'Template\' of the page I thought it would be nice to 
look up this value using the <bean:message> tag. How shall one do this? I have, 
newbie as I\'m to jsp and tag libraries, tried
  template:put name=\'title\' content=<bean:message key=\"page.title\"/> 
direct=\'true\'/>
and some variants without fortune. Please help me...

\\Magnus Sirwi�



Re: template-example and i18n

Posted by Incze Lajos <in...@mail.matav.hu>.
> Instead of using the Name \'Template\' of the page I thought it would be nice to 
> look up this value using the <bean:message> tag. How shall one do this? I have, 
> newbie as I\'m to jsp and tag libraries, tried
>   template:put name=\'title\' content=<bean:message key=\"page.title\"/> 
> direct=\'true\'/>

Recently you can do this:

<template:put name="title">
  <bean:message key="page.title" />
</template:put name="title">

If you have a non-empty template:put tag, it is direct content.
                                                        incze