Re: Tiles problem - how to put attr in right context

2005-09-30 Thread Greg Reddin
A very similar question was asked earlier this week.  Check the  
archives for more.


Here's how I've done it, but it's not extremely elegant:

tiles-defs.xml


  
  
  



  


Here's a snippet from mainlayout.jsp:
  
  

  

and here's header.jsp:
Header
Title is: 

The problem is that header.jsp is "contained" in the main.layout  
tile.  It does not inherently have any information about the tile it  
is contained in, so you have to pass any relevant attributes when you  
insert the page.


Greg


On Sep 30, 2005, at 4:59 AM, Java News wrote:


Hello,
I have problem with putting attributes in right context - my tiles
definitions look like:


extends=".mainLayout">







What I would like to achieve is:
1) I would like that .header attribute "title" was passed from
.add_product.form, so i can have only one header definition and many
rendering pages like .add_product.form, .add_product.confirm,
.add_product.thank_you and also i dont want (or other words i  
can't) extend

header definition
2) I tried to put header in .add_product.form as:

extends=".mainLayout">




and use it in jsp page as:



but when I used in header.jsp:



I got an error about lack of attr title in context:

11:38:22,134 ERROR [[action]] Servlet.service() for servlet action  
threw

exception
javax.servlet.jsp.JspException: ServletException in
'/WEB-INF/pages/tiles/header.jsp': Error - tag.getAsString : attribute
'title' not found in context. Check tag syntax
at org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(
InsertTag.java:921)
at org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java: 
460)

at
org.apache.jsp.WEB_002dINF.pages.add_005fproduct_jsp._jspx_meth_tiles_ 
get_0(

org.apache.jsp.WEB_002dINF.pages.add_005fproduct_jsp:136)
at org.apache.jsp.WEB_002dINF.pages.add_005fproduct_jsp._jspService(
org.apache.jsp.WEB_002dINF.pages.add_005fproduct_jsp:77)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.jasper.servlet.JspServletWrapper.service(
JspServletWrapper.java:322)
at org.apache.jasper.servlet.JspServlet.serviceJspFile 
(JspServlet.java:314)

at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)

What should I do to put this attribute in right context - could you  
help me?


Best Regards,
Lee




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



Tiles problem - how to put attr in right context

2005-09-30 Thread Java News
Hello,
I have problem with putting attributes in right context - my tiles
definitions look like:









What I would like to achieve is:
1) I would like that .header attribute "title" was passed from
.add_product.form, so i can have only one header definition and many
rendering pages like .add_product.form, .add_product.confirm,
.add_product.thank_you and also i dont want (or other words i can't) extend
header definition
2) I tried to put header in .add_product.form as:





and use it in jsp page as:



but when I used in header.jsp:



I got an error about lack of attr title in context:

11:38:22,134 ERROR [[action]] Servlet.service() for servlet action threw
exception
javax.servlet.jsp.JspException: ServletException in
'/WEB-INF/pages/tiles/header.jsp': Error - tag.getAsString : attribute
'title' not found in context. Check tag syntax
at org.apache.struts.taglib.tiles.InsertTag$InsertHandler.doEndTag(
InsertTag.java:921)
at org.apache.struts.taglib.tiles.InsertTag.doEndTag(InsertTag.java:460)
at
org.apache.jsp.WEB_002dINF.pages.add_005fproduct_jsp._jspx_meth_tiles_get_0(
org.apache.jsp.WEB_002dINF.pages.add_005fproduct_jsp:136)
at org.apache.jsp.WEB_002dINF.pages.add_005fproduct_jsp._jspService(
org.apache.jsp.WEB_002dINF.pages.add_005fproduct_jsp:77)
at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:97)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.jasper.servlet.JspServletWrapper.service(
JspServletWrapper.java:322)
at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:314)
at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:264)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)

What should I do to put this attribute in right context - could you help me?

Best Regards,
Lee