tiles-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Antonio Petrelli <antonio.petre...@gmail.com>
Subject Re: How to check if a JSP exists from a Tiles preparer
Date Mon, 09 Feb 2009 08:27:50 GMT
2009/2/9 Ignacio de Córdoba <icordoba@skios.es>:
> i need to check if JSPs exist in the webapp from the execute() method in a
> Tiles Preparer. Currently I am doing:
>
> ServletContext context =
> (ServletContext)tilesRequestContext.getApplicationContext().getContext();
> (I need to cast as getContext() returns an Object)
> Then I do:
> if (context.getResourceAsStream(templateBodyPathValue)!=null)
>    ...
>
> I guess checking if that InputStream is not null is not the best way. Any
> other ideas? Objects received in the preparer execute() method are
> TilesRequestContext and AttributeContext. Maybe there is some Tiles2
> aproach.

Whoa, this is a tough question, I don't think that there is a way,
even in pure Servlet+JSP. What do you need it for?

Antonio

Mime
View raw message