You can't use a JSP tag as the value of another JSP tag's attribute.  You'd
have to use a JSP expression instead.  I'm not sure if a utility exists to
get the message in the same way as the bean:message tag does.  Let's assume
there is one called msgUtil.getMessage.  Then you would do this:

<template:put name='title' content='<%= msgUtil.getMessage("myclient.title")
%>' direct='true'/>

-----Original Message-----
From: Yaman Kumar [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, May 16, 2001 10:06 AM
To: Struts Users Mailing List
Subject: Templates and i18n problem in struts


Hi,
I am using templates in struts, In my jsp page I used the below
statement.
......
<template:put name='title' content='<bean:message key="myclient.title" />'
direct='true'/>
......

the <bean:message key="myclient.title" /> statment prints MYPRINTPAGE .
but the output is not rendered in title location in runtime,
but it is printing "<bean:message key="printPage.title" />" message without
parsing the tag..

In short how can I use <bean:message ....> tag in templates.

Just  review the code to find out problem below.

in MyTemplate.jsp

<%@ taglib uri='/WEB-INF/struts-template.tld' prefix='template' %>
<%@ taglib uri='/WEB-INF/struts-html.tld' prefix='html' %>
<%@ taglib uri='/WEB-INF/struts-bean.tld' prefix='bean' %>
<html:html locale='true'>
<head>
<title>  <template:get name='title'/>  </title> //this is not parsed.

</head>
<body>
 <bean:message key="myclient.body.info" />   //This is parsed
</body>
</html:html>

in MyClient.jsp

<%@ taglib uri='/WEB-INF/struts-template.tld' prefix='template' %>
<%@ taglib uri='/WEB-INF/struts-bean.tld' prefix='bean' %>

<template:insert template='/HNCTemplate.jsp'>
  <template:put name='title' content='<bean:message key="myclient.title" />'
direct='true'/>
        //this bean tag is not parsed and not input the value to MyTemplate.jsp
</template:insert>


Many Thanx,
rayaku


--
To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>




--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to