You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Eduardo Simioni <si...@gmail.com> on 2006/11/09 14:22:09 UTC

Tiles +GetTag +Tomcat 5.? problem

Hi all,

I'm facing a problem with Tiles GetTag on recent Tomcat versions
(couldn't find the exact version, but is the one packaged with Sun
Application Server EE 8).

I have (among others) a <tiles:get name="menu" /> tag.

That "menu" can be present or not as it is programmatically inserted.

If it's not present, the page should just omit it. That's what happens
on earlier Tomcat versions (like the one packaged in Sun Application
Server EE 7, again, don't know exactly which version).

If the the attribute is null:

((org.apache.struts.tiles.ComponentContext)request.getAttribute("org.apache.struts.taglib.tiles.CompContext")).getAttribute("menu")
== null

Tiles doesn't find the attribute (ok until here), but then, it tries
to process it as a URL and falls on the following error: "The
requested resource (/jsp/_template/menu) is not available". This error
is shown on the page, where nothing should appear.

This happens even if I set the attribute ignore="true" in the tag
(what is not necessary on earlier Tomcat versions).

If I put a blank "menu" file on _template dir, it works ok, but this
is not a solution as I have many other parts dynamically inserted.

The application works well with Struts 1.1, 1.2.9 and 1.3.5 on SAS7
but doesn't work with any of these versions on SAS8.

I know it it's not a bug in Struts, but in Tomcat. Does anyone know a
decent workaround for this bug?


Any help would be greatly appreciated.

Regards,

Eduardo Simioni.

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


Re: Tiles +GetTag +Tomcat 5.? problem

Posted by Chris Pratt <th...@gmail.com>.
Yes, add the type=string to the tiles:put tags.
  (*Chris*)

On 11/9/06, Eduardo Simioni <ed...@summa-tech.com> wrote:
>
> Chris, I'm just supporting the "developers" team on this error, don't
> know much about the project.
> I know that nothing is being defined in the tiles definition file.
> Page components are being defined on the caller page, via <tiles:put
> />, and the menu attribute is being defined programmatically.
>
> The main problem is that it used to work as it is on Sun Application
> Server 7, and on SAS8  something has to be made to get it working
> again.
>
> That's why I thought it wasn't a bug on Tiles. But it's difficult to
> point.
>
> The solution I found is ok from my point of view, easy to implement.
>
> Again, thanks for helping!
>
> Eduardo Simioni.
>
> On 11/9/06, Chris Pratt <th...@gmail.com> wrote:
> > In your tiles definition, where you define the menu attribute, make sure
> > that it is marked type=string.  You should have something similar to:
> >
> >   <definition name="register2.pane" extends="default.pane">
> >     <put name="pagetitle" value="members" type="string"/>
> >     <put name="body" value="register2.layout" type="definition"/>
> >     <putList name="breadcrumbs">
> >       <add value="/|head.home" type="string"/>
> >       <add value="/home|members" type="string"/>
> >       <add value="member.registration" type="string"/>
> >     </putList>
> >   </definition>
> >
> > either in your tiles-defs.xml or using the JSP version in one of your
> > pages.  If now, how are you defining the menu tiles attribute?
> >   (*Chris*)
> >
> > On 11/9/06, Eduardo Simioni <ed...@summa-tech.com> wrote:
> > >
> > > I was reading some posts on dev list and realized that GetTag is
> > > obsolete and going to be removed soon.
> > >
> > > Well, the tag lib for tiles doesn't define attribute 'type' for get
> > > nor insert tags. So I didn't understand Chris' suggestion.
> > >
> > > If I change
> > > <tiles:get name="menu" />
> > > for
> > > <tiles:insert attribute="menu" ignore="true" />
> > > it works well.
> > > Here there's no doubt about the kind of component I'm trying to
> insert.
> > > Then, the processAttribute() method throws a JspException and the
> > > error is ignored.
> > >
> > > Get is failing to ignore the error cause it happens on the last line
> > > of doStartTag() method, not on the line surrounded by the 'try'.
> > >
> > > *******
> > >                 try {
> > >                         tagHandler = createTagHandler(); // With
> insert,
> > > error happens here
> > >
> > >                 } catch (JspException e) {
> > >                         if (isErrorIgnored) {
> > >                                 processEndTag = false;
> > >                                 return SKIP_BODY;
> > >                         } else {
> > >                                 throw e;
> > >                         }
> > >                 }
> > >
> > >                 return tagHandler.doStartTag(); // With get, error
> happens
> > > here
> > > *******
> > >
> > > Unfortunately I don't have time to prepare a simple example for test.
> > > I have to support the programmers on the next problem.
> > > World is getting full of pseudo Java programmers :/
> > >
> > >
> > > Thanks for your help!
> > >
> > > Eduardo Simioni.
> > >
> > > On 11/9/06, Chris Pratt <th...@gmail.com> wrote:
> > > > Make sure you define the menu attribute to by type=string, it seems
> to
> > > be
> > > > assuming that menu is type=page.
> > > >   (*Chris*)
> > > >
> > > > On 11/9/06, Antonio Petrelli <ap...@apache.org> wrote:
> > > > >
> > > > > Eduardo Simioni ha scritto:
> > > > > > Hi all,
> > > > > >
> > > > > > I'm facing a problem with Tiles GetTag on recent Tomcat versions
> > > > > > (couldn't find the exact version, but is the one packaged with
> Sun
> > > > > > Application Server EE 8).
> > > > > >
> > > > > > I have (among others) a <tiles:get name="menu" /> tag.
> > > > > >
> > > > > > That "menu" can be present or not as it is programmatically
> > > inserted.
> > > > > > If it's not present, the page should just omit it.
> > > > > > ...
> > > > > > If the the attribute is null:
> > > > > > ...
> > > > > > Tiles doesn't find the attribute (ok until here), but then, it
> tries
> > > > > > to process it as a URL and falls on the following error: "The
> > > > > > requested resource (/jsp/_template/menu) is not available". This
> > > error
> > > > > > is shown on the page, where nothing should appear.
> > > > > >
> > > > > > This happens even if I set the attribute ignore="true" in the
> tag
> > > > > > (what is not necessary on earlier Tomcat versions).
> > > > >
> > > > > I don't think it's a Tomcat bug, but a Tiles one: the "ignore"
> > > attribute
> > > > > should manage your case. Can you provide a small test case and, if
> it
> > > > > fails, can you open a JIRA issue?
> > > > > Thank you
> > > > > Antonio
> > > > >
> > > > >
> > > > >
> ---------------------------------------------------------------------
> > > > > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > > > For additional commands, e-mail: user-help@struts.apache.org
> > > > >
> > > > >
> > > >
> > > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > For additional commands, e-mail: user-help@struts.apache.org
> > >
> > >
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: Tiles +GetTag +Tomcat 5.? problem

Posted by Eduardo Simioni <ed...@summa-tech.com>.
Chris, I'm just supporting the "developers" team on this error, don't
know much about the project.
I know that nothing is being defined in the tiles definition file.
Page components are being defined on the caller page, via <tiles:put
/>, and the menu attribute is being defined programmatically.

The main problem is that it used to work as it is on Sun Application
Server 7, and on SAS8  something has to be made to get it working
again.

That's why I thought it wasn't a bug on Tiles. But it's difficult to point.

The solution I found is ok from my point of view, easy to implement.

Again, thanks for helping!

Eduardo Simioni.

On 11/9/06, Chris Pratt <th...@gmail.com> wrote:
> In your tiles definition, where you define the menu attribute, make sure
> that it is marked type=string.  You should have something similar to:
>
>   <definition name="register2.pane" extends="default.pane">
>     <put name="pagetitle" value="members" type="string"/>
>     <put name="body" value="register2.layout" type="definition"/>
>     <putList name="breadcrumbs">
>       <add value="/|head.home" type="string"/>
>       <add value="/home|members" type="string"/>
>       <add value="member.registration" type="string"/>
>     </putList>
>   </definition>
>
> either in your tiles-defs.xml or using the JSP version in one of your
> pages.  If now, how are you defining the menu tiles attribute?
>   (*Chris*)
>
> On 11/9/06, Eduardo Simioni <ed...@summa-tech.com> wrote:
> >
> > I was reading some posts on dev list and realized that GetTag is
> > obsolete and going to be removed soon.
> >
> > Well, the tag lib for tiles doesn't define attribute 'type' for get
> > nor insert tags. So I didn't understand Chris' suggestion.
> >
> > If I change
> > <tiles:get name="menu" />
> > for
> > <tiles:insert attribute="menu" ignore="true" />
> > it works well.
> > Here there's no doubt about the kind of component I'm trying to insert.
> > Then, the processAttribute() method throws a JspException and the
> > error is ignored.
> >
> > Get is failing to ignore the error cause it happens on the last line
> > of doStartTag() method, not on the line surrounded by the 'try'.
> >
> > *******
> >                 try {
> >                         tagHandler = createTagHandler(); // With insert,
> > error happens here
> >
> >                 } catch (JspException e) {
> >                         if (isErrorIgnored) {
> >                                 processEndTag = false;
> >                                 return SKIP_BODY;
> >                         } else {
> >                                 throw e;
> >                         }
> >                 }
> >
> >                 return tagHandler.doStartTag(); // With get, error happens
> > here
> > *******
> >
> > Unfortunately I don't have time to prepare a simple example for test.
> > I have to support the programmers on the next problem.
> > World is getting full of pseudo Java programmers :/
> >
> >
> > Thanks for your help!
> >
> > Eduardo Simioni.
> >
> > On 11/9/06, Chris Pratt <th...@gmail.com> wrote:
> > > Make sure you define the menu attribute to by type=string, it seems to
> > be
> > > assuming that menu is type=page.
> > >   (*Chris*)
> > >
> > > On 11/9/06, Antonio Petrelli <ap...@apache.org> wrote:
> > > >
> > > > Eduardo Simioni ha scritto:
> > > > > Hi all,
> > > > >
> > > > > I'm facing a problem with Tiles GetTag on recent Tomcat versions
> > > > > (couldn't find the exact version, but is the one packaged with Sun
> > > > > Application Server EE 8).
> > > > >
> > > > > I have (among others) a <tiles:get name="menu" /> tag.
> > > > >
> > > > > That "menu" can be present or not as it is programmatically
> > inserted.
> > > > > If it's not present, the page should just omit it.
> > > > > ...
> > > > > If the the attribute is null:
> > > > > ...
> > > > > Tiles doesn't find the attribute (ok until here), but then, it tries
> > > > > to process it as a URL and falls on the following error: "The
> > > > > requested resource (/jsp/_template/menu) is not available". This
> > error
> > > > > is shown on the page, where nothing should appear.
> > > > >
> > > > > This happens even if I set the attribute ignore="true" in the tag
> > > > > (what is not necessary on earlier Tomcat versions).
> > > >
> > > > I don't think it's a Tomcat bug, but a Tiles one: the "ignore"
> > attribute
> > > > should manage your case. Can you provide a small test case and, if it
> > > > fails, can you open a JIRA issue?
> > > > Thank you
> > > > Antonio
> > > >
> > > >
> > > > ---------------------------------------------------------------------
> > > > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > > For additional commands, e-mail: user-help@struts.apache.org
> > > >
> > > >
> > >
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>
>

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


Re: Tiles +GetTag +Tomcat 5.? problem

Posted by Chris Pratt <th...@gmail.com>.
In your tiles definition, where you define the menu attribute, make sure
that it is marked type=string.  You should have something similar to:

  <definition name="register2.pane" extends="default.pane">
    <put name="pagetitle" value="members" type="string"/>
    <put name="body" value="register2.layout" type="definition"/>
    <putList name="breadcrumbs">
      <add value="/|head.home" type="string"/>
      <add value="/home|members" type="string"/>
      <add value="member.registration" type="string"/>
    </putList>
  </definition>

either in your tiles-defs.xml or using the JSP version in one of your
pages.  If now, how are you defining the menu tiles attribute?
  (*Chris*)

On 11/9/06, Eduardo Simioni <ed...@summa-tech.com> wrote:
>
> I was reading some posts on dev list and realized that GetTag is
> obsolete and going to be removed soon.
>
> Well, the tag lib for tiles doesn't define attribute 'type' for get
> nor insert tags. So I didn't understand Chris' suggestion.
>
> If I change
> <tiles:get name="menu" />
> for
> <tiles:insert attribute="menu" ignore="true" />
> it works well.
> Here there's no doubt about the kind of component I'm trying to insert.
> Then, the processAttribute() method throws a JspException and the
> error is ignored.
>
> Get is failing to ignore the error cause it happens on the last line
> of doStartTag() method, not on the line surrounded by the 'try'.
>
> *******
>                 try {
>                         tagHandler = createTagHandler(); // With insert,
> error happens here
>
>                 } catch (JspException e) {
>                         if (isErrorIgnored) {
>                                 processEndTag = false;
>                                 return SKIP_BODY;
>                         } else {
>                                 throw e;
>                         }
>                 }
>
>                 return tagHandler.doStartTag(); // With get, error happens
> here
> *******
>
> Unfortunately I don't have time to prepare a simple example for test.
> I have to support the programmers on the next problem.
> World is getting full of pseudo Java programmers :/
>
>
> Thanks for your help!
>
> Eduardo Simioni.
>
> On 11/9/06, Chris Pratt <th...@gmail.com> wrote:
> > Make sure you define the menu attribute to by type=string, it seems to
> be
> > assuming that menu is type=page.
> >   (*Chris*)
> >
> > On 11/9/06, Antonio Petrelli <ap...@apache.org> wrote:
> > >
> > > Eduardo Simioni ha scritto:
> > > > Hi all,
> > > >
> > > > I'm facing a problem with Tiles GetTag on recent Tomcat versions
> > > > (couldn't find the exact version, but is the one packaged with Sun
> > > > Application Server EE 8).
> > > >
> > > > I have (among others) a <tiles:get name="menu" /> tag.
> > > >
> > > > That "menu" can be present or not as it is programmatically
> inserted.
> > > > If it's not present, the page should just omit it.
> > > > ...
> > > > If the the attribute is null:
> > > > ...
> > > > Tiles doesn't find the attribute (ok until here), but then, it tries
> > > > to process it as a URL and falls on the following error: "The
> > > > requested resource (/jsp/_template/menu) is not available". This
> error
> > > > is shown on the page, where nothing should appear.
> > > >
> > > > This happens even if I set the attribute ignore="true" in the tag
> > > > (what is not necessary on earlier Tomcat versions).
> > >
> > > I don't think it's a Tomcat bug, but a Tiles one: the "ignore"
> attribute
> > > should manage your case. Can you provide a small test case and, if it
> > > fails, can you open a JIRA issue?
> > > Thank you
> > > Antonio
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > > For additional commands, e-mail: user-help@struts.apache.org
> > >
> > >
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: Tiles +GetTag +Tomcat 5.? problem

Posted by Eduardo Simioni <ed...@summa-tech.com>.
I was reading some posts on dev list and realized that GetTag is
obsolete and going to be removed soon.

Well, the tag lib for tiles doesn't define attribute 'type' for get
nor insert tags. So I didn't understand Chris' suggestion.

If I change
 <tiles:get name="menu" />
for
 <tiles:insert attribute="menu" ignore="true" />
it works well.
Here there's no doubt about the kind of component I'm trying to insert.
Then, the processAttribute() method throws a JspException and the
error is ignored.

Get is failing to ignore the error cause it happens on the last line
of doStartTag() method, not on the line surrounded by the 'try'.

*******
		try {
			tagHandler = createTagHandler(); // With insert, error happens here

		} catch (JspException e) {
			if (isErrorIgnored) {
				processEndTag = false;
				return SKIP_BODY;
			} else {
				throw e;
			}
		}

		return tagHandler.doStartTag(); // With get, error happens here
*******

Unfortunately I don't have time to prepare a simple example for test.
I have to support the programmers on the next problem.
World is getting full of pseudo Java programmers :/


Thanks for your help!

Eduardo Simioni.

On 11/9/06, Chris Pratt <th...@gmail.com> wrote:
> Make sure you define the menu attribute to by type=string, it seems to be
> assuming that menu is type=page.
>   (*Chris*)
>
> On 11/9/06, Antonio Petrelli <ap...@apache.org> wrote:
> >
> > Eduardo Simioni ha scritto:
> > > Hi all,
> > >
> > > I'm facing a problem with Tiles GetTag on recent Tomcat versions
> > > (couldn't find the exact version, but is the one packaged with Sun
> > > Application Server EE 8).
> > >
> > > I have (among others) a <tiles:get name="menu" /> tag.
> > >
> > > That "menu" can be present or not as it is programmatically inserted.
> > > If it's not present, the page should just omit it.
> > > ...
> > > If the the attribute is null:
> > > ...
> > > Tiles doesn't find the attribute (ok until here), but then, it tries
> > > to process it as a URL and falls on the following error: "The
> > > requested resource (/jsp/_template/menu) is not available". This error
> > > is shown on the page, where nothing should appear.
> > >
> > > This happens even if I set the attribute ignore="true" in the tag
> > > (what is not necessary on earlier Tomcat versions).
> >
> > I don't think it's a Tomcat bug, but a Tiles one: the "ignore" attribute
> > should manage your case. Can you provide a small test case and, if it
> > fails, can you open a JIRA issue?
> > Thank you
> > Antonio
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> > For additional commands, e-mail: user-help@struts.apache.org
> >
> >
>
>

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


Re: Tiles +GetTag +Tomcat 5.? problem

Posted by Chris Pratt <th...@gmail.com>.
Make sure you define the menu attribute to by type=string, it seems to be
assuming that menu is type=page.
  (*Chris*)

On 11/9/06, Antonio Petrelli <ap...@apache.org> wrote:
>
> Eduardo Simioni ha scritto:
> > Hi all,
> >
> > I'm facing a problem with Tiles GetTag on recent Tomcat versions
> > (couldn't find the exact version, but is the one packaged with Sun
> > Application Server EE 8).
> >
> > I have (among others) a <tiles:get name="menu" /> tag.
> >
> > That "menu" can be present or not as it is programmatically inserted.
> > If it's not present, the page should just omit it.
> > ...
> > If the the attribute is null:
> > ...
> > Tiles doesn't find the attribute (ok until here), but then, it tries
> > to process it as a URL and falls on the following error: "The
> > requested resource (/jsp/_template/menu) is not available". This error
> > is shown on the page, where nothing should appear.
> >
> > This happens even if I set the attribute ignore="true" in the tag
> > (what is not necessary on earlier Tomcat versions).
>
> I don't think it's a Tomcat bug, but a Tiles one: the "ignore" attribute
> should manage your case. Can you provide a small test case and, if it
> fails, can you open a JIRA issue?
> Thank you
> Antonio
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>

Re: Tiles +GetTag +Tomcat 5.? problem

Posted by Antonio Petrelli <ap...@apache.org>.
Eduardo Simioni ha scritto:
> Hi all,
>
> I'm facing a problem with Tiles GetTag on recent Tomcat versions
> (couldn't find the exact version, but is the one packaged with Sun
> Application Server EE 8).
>
> I have (among others) a <tiles:get name="menu" /> tag.
>
> That "menu" can be present or not as it is programmatically inserted.
> If it's not present, the page should just omit it.
> ...
> If the the attribute is null:
> ...
> Tiles doesn't find the attribute (ok until here), but then, it tries
> to process it as a URL and falls on the following error: "The
> requested resource (/jsp/_template/menu) is not available". This error
> is shown on the page, where nothing should appear.
>
> This happens even if I set the attribute ignore="true" in the tag
> (what is not necessary on earlier Tomcat versions).

I don't think it's a Tomcat bug, but a Tiles one: the "ignore" attribute
should manage your case. Can you provide a small test case and, if it
fails, can you open a JIRA issue?
Thank you
Antonio


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