You are viewing a plain text version of this content. The canonical link for it is here.
Posted to taglibs-user@tomcat.apache.org by jo...@dancik.com on 2006/03/02 16:52:36 UTC

Cache Taglib

I'm trying to use the cache taglib, and either I'm not doing something 
right, or the docs aren't telling me everything I need to do.

Here's the test page I'm trying to cache and then print the cached HTML to 
System.out:

<%@ taglib uri="http://jakarta.apache.org/taglibs/cache-1.0" 
prefix="cache" %>
<cache:cache name="myBody" scope="page">
        <%@include file="test.jspf"%>
</cache:cache>
<%
        System.out.println((String) pageContext.getAttribute("myBody"));
%>

I'm running Tomcat 4.1.29.  I have the taglibs-cache.tld in my apps 
WEB-INF folder, and the taglibs-cache.jar in my WEB-INF/lib folder.  I 
also added the following to my WEB-INF/web.xml:

<taglib>
 <taglib-uri>http://jakarta.apache.org/taglibs/cache-1.0</taglib-uri>
        <taglib-location>/WEB-INF/taglibs-cache.tld</taglib-location>
</taglib>

(Note:  FYI - the documentation has an error - it says to use: 
<taglib-location>/WEB-INF/cache.tld</taglib-location>, when it should be: 
<taglib-location>/WEB-INF/taglibs-cache.tld</taglib-location>.)

When I access this page, I get the normal HTML output generated by the 
test.jspf sent to the browser, but I get "null" sent to System.out.

Is there something I'm not getting, not doing right, or is it not working? 
 Or is it that I can't access the cached output in the same page?

Any help is greatly appreciated!

Thanks,
Johnny

RE: File download custom tag or bean

Posted by "T. Lamine Ba" <la...@hotmail.com>.
Thanks for the tip Martin.
Unfortunately, I am not using Struts.

Any other suggestions would be appreciated?

-----Original Message-----
From: mfncooper@gmail.com [mailto:mfncooper@gmail.com] On Behalf Of
Martin Cooper
Sent: Sunday, March 05, 2006 1:18 PM
To: Tag Libraries Users List
Subject: Re: File download custom tag or bean

Not a tag, but if you're using Struts, you can use DownloadAction:

http://struts.apache.org/struts-extras/apidocs/org/apache/struts/actions
/DownloadAction.html

--
Martin Cooper


On 3/5/06, T. Lamine Ba <la...@hotmail.com> wrote:
>
> I know that you can download a file from a specific location within
your
> webapp by writing a servlet using OutputStream services.  However, it
> has been done so many times, somebody must have created a custom tag
or
> bean for this feature.
>
> Where can I find a custom tag or bean that would allow me to download
> PDF and PPT files from my webapp and via a dialog box that would allow
> you to either open the file from the browser or store it in your
> desktop?
>
> Thanks,
>
> Lamine.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
>
>

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


Re: File download custom tag or bean

Posted by Martin Cooper <ma...@apache.org>.
Not a tag, but if you're using Struts, you can use DownloadAction:

http://struts.apache.org/struts-extras/apidocs/org/apache/struts/actions/DownloadAction.html

--
Martin Cooper


On 3/5/06, T. Lamine Ba <la...@hotmail.com> wrote:
>
> I know that you can download a file from a specific location within your
> webapp by writing a servlet using OutputStream services.  However, it
> has been done so many times, somebody must have created a custom tag or
> bean for this feature.
>
> Where can I find a custom tag or bean that would allow me to download
> PDF and PPT files from my webapp and via a dialog box that would allow
> you to either open the file from the browser or store it in your
> desktop?
>
> Thanks,
>
> Lamine.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: taglibs-user-help@jakarta.apache.org
>
>

File download custom tag or bean

Posted by "T. Lamine Ba" <la...@hotmail.com>.
I know that you can download a file from a specific location within your
webapp by writing a servlet using OutputStream services.  However, it
has been done so many times, somebody must have created a custom tag or
bean for this feature.

Where can I find a custom tag or bean that would allow me to download
PDF and PPT files from my webapp and via a dialog box that would allow
you to either open the file from the browser or store it in your
desktop?

Thanks,

Lamine.

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