You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Pe...@materna.de on 2005/08/09 12:58:59 UTC

Tiles showing directory listing inside WEB-INF

Hi all!

I got confused when I experimented with tiles to learn how it works. Here is
what I have done.
I have created a DeafultLayout.jsp:

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>

<html:html>
  <head>
    <title>TilesTest</title>
    <html:base/>    
    <link rel="stylesheet" type="text/css"
href="/TilesTest/stylesheets/TT-styles.css">
  </head>
  <body>
    <tiles:insert attribute="header" flush="true" ignore="true" />
    <tiles:insert attribute="navigation" flush="true" ignore="true" />
    <tiles:insert attribute="footer" flush="true" ignore="true" />
  </body>
</html:html>

So there are three regions, which I populate in a tiles definition
like this:

<definition name="tiledef.default"
path="/WEB-INF/jsp/layouts/DefaultLayout.jsp">
  <put name="header" value="/WEB-INF/jsp/common/header.jsp" />
  <put name="navigation" value="" />
  <put name="footer" value="/WEB-INF/jsp/common/footer.jsp" />
</definition>

When I use this definition in an jsp like this:

<tiles:insert definition="tiledef.deafult" />

my web-app shows the directory listing of WEB-INF/jsp/layout (besides
the header and footer). So the line

<put name="navigation" value="" />

seems to be the problem. Is it ok for my web-app to show directory listings
inside my WEB-INF folder? How can I prevent Tomcat to do so, if i forget to
put a tile into my layout? More basically: Why does Tomcat list my directory
when a tile is put with value=""? Or is it a problem of tiles? There is
another
problem, too. My stylesheets are ignored. If I use navigation.jsp for the 
navigation tile, everything is fine. Why aren't the stylesheets used in case
of value=""? You see, I only scratch the surface of tiles and need some more
in-depth covering of it.

Peter

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


RE: Tiles showing directory listing inside WEB-INF

Posted by "David G. Friedman" <hu...@ix.netcom.com>.
Peter,

You wrote your tiles:insert tag with 'ignore="true" so
just put a dummy value in for your tiles:insert tag
and if a file by that name doesn't exist, it won't show
anything.

Regarding your directory listing, I've never seen that
but I've also never tried putting a blank entry ("") as
a value.  You might try updating your tiles:put from your
definition to have 'type="String"' to try to force it to
put the value in as a String, which should result in an empty
string (from what you have listed.  (shrug - just a theory)

Regards,
David

-----Original Message-----
From: Peter.Zoche@materna.de [mailto:Peter.Zoche@materna.de]
Sent: Tuesday, August 09, 2005 6:59 AM
To: user@struts.apache.org
Subject: Tiles showing directory listing inside WEB-INF


Hi all!

I got confused when I experimented with tiles to learn how it works. Here is
what I have done.
I have created a DeafultLayout.jsp:

<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>

<html:html>
  <head>
    <title>TilesTest</title>
    <html:base/>
    <link rel="stylesheet" type="text/css"
href="/TilesTest/stylesheets/TT-styles.css">
  </head>
  <body>
    <tiles:insert attribute="header" flush="true" ignore="true" />
    <tiles:insert attribute="navigation" flush="true" ignore="true" />
    <tiles:insert attribute="footer" flush="true" ignore="true" />
  </body>
</html:html>

So there are three regions, which I populate in a tiles definition
like this:

<definition name="tiledef.default"
path="/WEB-INF/jsp/layouts/DefaultLayout.jsp">
  <put name="header" value="/WEB-INF/jsp/common/header.jsp" />
  <put name="navigation" value="" />
  <put name="footer" value="/WEB-INF/jsp/common/footer.jsp" />
</definition>

When I use this definition in an jsp like this:

<tiles:insert definition="tiledef.deafult" />

my web-app shows the directory listing of WEB-INF/jsp/layout (besides
the header and footer). So the line

<put name="navigation" value="" />

seems to be the problem. Is it ok for my web-app to show directory listings
inside my WEB-INF folder? How can I prevent Tomcat to do so, if i forget to
put a tile into my layout? More basically: Why does Tomcat list my directory
when a tile is put with value=""? Or is it a problem of tiles? There is
another
problem, too. My stylesheets are ignored. If I use navigation.jsp for the
navigation tile, everything is fine. Why aren't the stylesheets used in case
of value=""? You see, I only scratch the surface of tiles and need some more
in-depth covering of it.

Peter

---------------------------------------------------------------------
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