struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael" <mich...@idtect.com>
Subject RE: Nesting tiles:getAsString with struts bean:message
Date Tue, 03 Sep 2002 10:28:16 GMT
I just tried it and I get:

Generated servlet error:
C:\devapps\tomcat\work\Standalone\localhost\oemserver\jsp\layouts\defaul
t_0005flayout$jsp.java:159: Variable 'title' is already defined in this
method.
                  java.lang.String title = null;
                                   ^
My tiles-def.xml is:

  <definition  name="default_layout"
               path="/jsp/layouts/default_layout.jsp">
	  <put name="header"  value="/jsp/common/header.jsp" />
	  <put name="menubar" value="/jsp/common/menubar.jsp" />
	  <put name="footer"  value="/jsp/common/footer.jsp" />
	  <put name="title"	  value="default.title" />
  </definition>

  <definition name="main_page"
              extends="default_layout"
              >
    <put name="body"  value=""/>
    <put name="title" value="main_page.title" />
  </definition>

> -----Original Message-----
> From: Joss Wright [mailto:joss_wright@hotmail.com] 
> Sent: Tuesday, September 03, 2002 12:07 PM
> To: struts-user@jakarta.apache.org
> Subject: Re: Nesting tiles:getAsString with struts bean:message
> 
> 
> Micheal,
> 
> I resolved this issue by doing the following:
> 
> <tiles:useAttribute name="title" classname="java.lang.String" 
> /> <bean:message key="<%=title%>"/>
> 
> It means having a scriplet in your jsp but it works.
> 
> Regards,
> 
> Joss
> 
> 
> 
> >From: "Michael" <michael@idtect.com>
> >Reply-To: "Struts Users Mailing List" 
> <struts-user@jakarta.apache.org>
> >To: "Struts Users Mailing List" <struts-user@jakarta.apache.org>
> >Subject: Nesting tiles:getAsString with struts bean:message
> >Date: Mon, 2 Sep 2002 17:43:54 +0200
> >
> >Is it possible to nest a tiles:getAsString tag inside a struts 
> >bean:message tag?  This is what I'm trying to do:
> >
> >   <definition name="plant_status_page"
> >               extends="default_layout"
> >               >
> >     <put name="body"  value="plant_status_body"/>
> >     <put name="title" value="plant_status_page.title" />
> >   </definition>
> >
> >   <title>
> >     <bean:message key="base.title"/> -
> >     <bean:message key="<tiles:getAsString name="title"/>"/>
> >   </title>
> >
> >I get:
> >
> >org.apache.jasper.compiler.ParseException:
> >/jsp/layouts/default_layout.jsp(8,53) Attribute title has no value
> >
> >I've tried several combinations including single quotes and double 
> >quotes, and escaping the quotes with backslashes, but none of them 
> >work. If I just do this:
> >
> >   <title>
> >     <bean:message key="base.title"/> -
> >     <tiles:getAsString name="title"/>
> >   </title>
> >
> >It does in fact work.  So I think the problem is nesting the two 
> >together.
> >
> >Michael
> >
> >
> >--
> >To unsubscribe, e-mail:   
> ><mailto:struts-user-unsubscribe@jakarta.apache.org>
> >For additional commands, e-mail:
> ><mailto:struts-user-help@jakarta.apache.org>
> 
> 
> 
> 
> _________________________________________________________________
> MSN Photos is the easiest way to share and print your photos: 
> http://photos.msn.com/support/worldwide.aspx
> 
> 
> --
> To unsubscribe, e-mail:   
> <mailto:struts-user-> unsubscribe@jakarta.apache.org>
> For 
> additional commands, 
> e-mail: <mailto:struts-user-help@jakarta.apache.org>
> 


--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message