You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Tricia Ong Cheah Yen <tr...@aretae.com> on 2001/09/21 05:43:05 UTC
template qn
hi all,
i'm new to struts and i have a qn on the use of template tag
with the <bean:message> tag. i had used the <bean:message> tag to
provide content in my template file. however, instead of displaying the
text "Welcome" as stored in my MessageResources.properties file it
display "<bean:message key="window.title"/>" as it is.
now shldn't there be a tranlsation of something or did i missed
out anything?
here's a snippet of my template page:
<%@ page language="java" %>
<%@ taglib uri="/taglibs/struts-template" prefix="template" %>
<%@ taglib uri="/taglibs/struts-bean" prefix="bean" %>
<HEAD>
<TITLE><template:get name='HtmlTitle'/></TITLE>
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="0">
<LINK REL="stylesheet" TYPE="text/css"
HREF="./include/defaultstyle.css">
</HEAD>
and the code for the page that uses this template
<template:insert template='./templates/template.jsp'>
<template:put name='HtmlTitle' content='<bean:message
key="window.title"/>' direct='true' />
</template:insert>
TIA
+trish
Re: template qn
Posted by Cedric Dumoulin <ce...@lifl.fr>.
Hi,
You can't nest jsp tag inside another jsp tag. But, their is a solution
to your problem :
<template:put name='HtmlTitle' direct='true' >
<bean:message key="window.title"/>'
</template:put>
Tricia Ong Cheah Yen wrote:
> hi all,
> i'm new to struts and i have a qn on the use of template tag
> with the <bean:message> tag. i had used the <bean:message> tag to
> provide content in my template file. however, instead of displaying the
> text "Welcome" as stored in my MessageResources.properties file it
> display "<bean:message key="window.title"/>" as it is.
>
> now shldn't there be a tranlsation of something or did i missed
> out anything?
>
> here's a snippet of my template page:
> <%@ page language="java" %>
> <%@ taglib uri="/taglibs/struts-template" prefix="template" %>
> <%@ taglib uri="/taglibs/struts-bean" prefix="bean" %>
> <HEAD>
> <TITLE><template:get name='HtmlTitle'/></TITLE>
> <META HTTP-EQUIV="Pragma" CONTENT="no-cache">
> <META HTTP-EQUIV="Expires" CONTENT="0">
> <LINK REL="stylesheet" TYPE="text/css"
> HREF="./include/defaultstyle.css">
> </HEAD>
>
> and the code for the page that uses this template
>
> <template:insert template='./templates/template.jsp'>
> <template:put name='HtmlTitle' content='<bean:message
> key="window.title"/>' direct='true' />
> </template:insert>
>
> TIA
> +trish