You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Jason Carpenter <Ja...@greyhound.com> on 2002/09/04 20:22:27 UTC

[tiles] XmlDefinition.resolveInheritance(XmlDefinitionsSet)

All,

Before setting the path in this method, a check is done to see if the child's path is null. If it is, the child's path gets set to the parent's path.

The question I have is, should the check be for null or empty string instead of just null? ( path == null || "".equals( path ) )

My rationale...
I recently started to use the Struts Console 2.1.1 which allows one to maintain tiles config files. I am using inheritance with my definitions. The problem (really it is with the console I guess) is  when the console saves the file it puts in an empty string for the path attribute. This, in turn,  causes the above mentioned method to not set the child's path to the parent's path becuase the  method logic only checks to see if the child's path is null and not also to see if the child's path is empty.

I end up getting 404s when forwarding to a page because the path is "empty".

Since I know where the problem is coming from, I can fix it, but I thought I would propose the question anyway...

Thanks for the replies.

Jason


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: [tiles] XmlDefinition.resolveInheritance(XmlDefinitionsSet)

Posted by Cedric Dumoulin <ce...@apache.org>.
  We can add the check for empty String in Tiles. But this is more a bug 
from the Console which should not put an empty path ...
What an empty path mean ;-) ???

    Cedric

Jason Carpenter wrote:

>All,
>
>Before setting the path in this method, a check is done to see if the child's path is null. If it is, the child's path gets set to the parent's path.
>
>The question I have is, should the check be for null or empty string instead of just null? ( path == null || "".equals( path ) )
>
>My rationale...
>I recently started to use the Struts Console 2.1.1 which allows one to maintain tiles config files. I am using inheritance with my definitions. The problem (really it is with the console I guess) is  when the console saves the file it puts in an empty string for the path attribute. This, in turn,  causes the above mentioned method to not set the child's path to the parent's path becuase the  method logic only checks to see if the child's path is null and not also to see if the child's path is empty.
>
>I end up getting 404s when forwarding to a page because the path is "empty".
>
>Since I know where the problem is coming from, I can fix it, but I thought I would propose the question anyway...
>
>Thanks for the replies.
>
>Jason
>
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>
>  
>



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>