|
Steve
-- Not sure if I understand the question, but Ive had problems with
FileServerPortlet and the PortletExpirationManager not correctly expiring
resources.
I
assume thats what your talking about.
For a
quick work around, simply dont use the FileServerPortlet, write your own portlet
such as shown below. You may notice that this simple example is not exactly
optimized, it simply goes out and gets the file for each and every request.
public
class DirectFilePortlet extends AbstractPortlet
{ public
ConcreteElement getContent() {
String
htmlPage;
ClearElement element; String url = "file:/c:/path/yourfile.html"; try { htmlPage = getURL(url); element = new ClearElement( htmlPage ); this.setContent( element ); } catch (Exception ex)
{
String message = "DirectFilePortlet: Could not include the following URL: " + url + " : " + ex.getMessage(); Log.error( message, ex ); return new StringElement( message ); } return
element;
} /**
@author <a href="mailto:[EMAIL PROTECTED]">Kevin A. Burton</a> @version $Id: FileServerPortlet.java,v 1.19 2000/05/22 21:19:56 burton Exp $ */ private String getURL(String url) throws IOException { int CAPACITY =
1024;
InputStream is = new URL( url
).openStream();
ByteArrayOutputStream buffer = new ByteArrayOutputStream(); //now process the
InputStream...
byte[] bytes = new byte[CAPACITY]; int readCount =
0;
while( ( readCount = is.read( bytes )) > 0 ) { buffer.write( bytes, 0, readCount); }
is.close();
return buffer.toString(); }
}
|
- Website and Documentation Northam, Eric
- RE: Website and Documentation David Sean Taylor
- Re: Website and Documentation sbelt
- Re: Website and Documentation David Sean Taylor
- Re: Website and Documentation ingo schuster
- Re: Website and Documentation Santiago Gala
- Re: Website and Documentation ingo schuster
- Re: Website and Documentation Raphael Luta
- Re: Website and Documentat... Santiago Gala
- RE: Website and Documentation Dafang Zhang
- RE: Website and Documentation ingo schuster
- Re: Website and Documentation Jon Stevens
- Re: Website and Documentation Santiago Gala
- RE: Website and Documentation ingo schuster
