You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Todd O'Bryan <to...@mac.com> on 2004/10/17 20:06:07 UTC

Stylesheet confusion--Solved, but still confused

I moved my stylesheet out of the WEB-INF directory (where the page is) 
and into the context directory, and made the context-asset 
path="dmorg.css" (the name of my stylesheet) and now it works.

But, I don't understand. Is it impossible to place assets inside the 
WEB-INF directory? If not, how do you refer to them?

Thanks,
Todd


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


Re: Content type of zip?

Posted by James Sherwood <js...@romulin.com>.
It seems to be working fine now

I rebooted my machine but before I had did that I did a little cleanup and
placed the

cycle.getRequestContext().getResponse().setHeader(
    "Content-Disposition",
    "attachment; filename=")

after the

out.setContentType("application/x-zip");

SO, im not sure if the reboot fixed the problem or the placement of the
sets(although im going with the reboot:)

doing it this way I do not put the extension or it gets
doubled(filename.zip.zip) when setting the filename.  If I put it before the
setcontenttype I do put the extension.

But it seems to work great now so I am not going to test it further.

Thanks for all the help guys!


----- Original Message ----- 
From: "Filip S. Adamsen" <fi...@stubkjaer-adamsen.dk>
To: "'Tapestry users'" <ta...@jakarta.apache.org>
Sent: Monday, October 18, 2004 11:35 AM
Subject: RE: Content type of zip?


> Have you tried setting "application/octet-stream" as the content type?
>
> > -----Original Message-----
> > From: James Sherwood [mailto:jsherwood@romulin.com]
> > Sent: Monday, October 18, 2004 2:09 PM
> > To: Tapestry users
> > Subject: Content type of zip?
> >
> > Hello,
> >
> > The file service everyone helped me create is working for every file I
> > have
> > tested it against except .zip files.
> >
> > I have tried the setContentType of application/x-zip and application/zip
> > and
> > neither seem to work.
> >
> > When I save it and try to open it, it is corrupt.
> >
> > Any ideas?
> >
> > Thanks in advance,
> > James
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>



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


RE: Content type of zip?

Posted by "Filip S. Adamsen" <fi...@stubkjaer-adamsen.dk>.
Have you tried setting "application/octet-stream" as the content type?

> -----Original Message-----
> From: James Sherwood [mailto:jsherwood@romulin.com]
> Sent: Monday, October 18, 2004 2:09 PM
> To: Tapestry users
> Subject: Content type of zip?
> 
> Hello,
> 
> The file service everyone helped me create is working for every file I
> have
> tested it against except .zip files.
> 
> I have tried the setContentType of application/x-zip and application/zip
> and
> neither seem to work.
> 
> When I save it and try to open it, it is corrupt.
> 
> Any ideas?
> 
> Thanks in advance,
> James
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org




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


Content type of zip?

Posted by James Sherwood <js...@romulin.com>.
Hello,

The file service everyone helped me create is working for every file I have
tested it against except .zip files.

I have tried the setContentType of application/x-zip and application/zip and
neither seem to work.

When I save it and try to open it, it is corrupt.

Any ideas?

Thanks in advance,
James



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


Re: Stylesheet confusion--Solved, but still confused

Posted by Erik Hatcher <er...@ehatchersolutions.com>.
On Oct 17, 2004, at 6:10 PM, Todd O'Bryan wrote:
> Right. But even when I have an asset point to the file, it doesn't 
> seem to work. That was the problem with my first version.
>
> So, can my stylesheet be an asset in the WEB-INF directory or not?

I'll go out on a limb and risk giving the wrong answer, but no, they 
cannot be in WEB-INF.  Assets get served up in two possible ways, one 
with a direct URL to them (and WEB-INF and below is restricted from 
direct access) or through the classpath (which includes 
WEB-INF/classes) (like using private assets inside components).

I recommend that you move the CSS to above WEB-INF and use a context 
asset.  This gives you some nice additional features: localization and 
externalization.

	Erik


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


Re: Stylesheet confusion--Solved, but still confused

Posted by Todd O'Bryan <to...@mac.com>.
Right. But even when I have an asset point to the file, it doesn't seem  
to work. That was the problem with my first version.

So, can my stylesheet be an asset in the WEB-INF directory or not?

Todd

On Oct 17, 2004, at 2:41 PM, David Teare wrote:

> Just a guess, but the files in the WEB-INF directory are not viewable  
> on the web, and therefore you can't include a direct reference to it  
> in your rendered HTML.  If you want to serve css, images, etc from  
> that directory, you need to define it as an asset.
>
> Hope that helps!
>
> Todd O'Bryan wrote:
>
>> I moved my stylesheet out of the WEB-INF directory (where the page  
>> is) and into the context directory, and made the context-asset  
>> path="dmorg.css" (the name of my stylesheet) and now it works.
>>
>> But, I don't understand. Is it impossible to place assets inside the  
>> WEB-INF directory? If not, how do you refer to them?
>>
>> Thanks,
>> Todd
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>>
>>
>
> --  
> ----------------------------------------------------------------------- 
> -
> Cheers,
> David Teare - IT Consultant
> Teare Software Solutions Inc.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>


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


Re: Stylesheet confusion--Solved, but still confused

Posted by David Teare <dt...@tearesolutions.com>.
Just a guess, but the files in the WEB-INF directory are not viewable on 
the web, and therefore you can't include a direct reference to it in 
your rendered HTML.  If you want to serve css, images, etc from that 
directory, you need to define it as an asset.

Hope that helps!

Todd O'Bryan wrote:

> I moved my stylesheet out of the WEB-INF directory (where the page is) 
> and into the context directory, and made the context-asset 
> path="dmorg.css" (the name of my stylesheet) and now it works.
>
> But, I don't understand. Is it impossible to place assets inside the 
> WEB-INF directory? If not, how do you refer to them?
>
> Thanks,
> Todd
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: tapestry-user-help@jakarta.apache.org
>
>

-- 
------------------------------------------------------------------------
Cheers,
David Teare - IT Consultant
Teare Software Solutions Inc.


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