You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-dev@portals.apache.org by James Liao <ji...@gmail.com> on 2005/11/11 08:18:05 UTC

ContentFilter issue

Hi all,
There is a bug about contentfilter.
1. Login j2 as a portal user(admin).
2. Click the CSS Demo page.
3. Click the CSS portlet maximize windown icon.(a
java.lang.IllegalStateException had been logged in jetspeed.log)
4. Click the default-page.psml.
5. The following is the displayed in browser.

javax.servlet.ServletException: Fatal error encountered while
processing portal request:
org.apache.jetspeed.pipeline.PipelineException:
org.apache.jetspeed.pipeline.PipelineException:
org.apache.jetspeed.pipeline.PipelineException:
org.apache.jetspeed.pipeline.PipelineException:
java.lang.IllegalStateException: You cannot invoke
getRenderedContent() until the content has been set.
	org.apache.jetspeed.engine.JetspeedServlet.doGet(JetspeedServlet.java:235)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:689)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

6. The current browser can not view j2 anymore.

The cause of this is a FileNotFoundException throw in ContentFilter. The
following is the detail:
1. The css-demo.psml use blue-gradient as its portlet-decorator. The
following lines are from blue-gradient's css file

.blue-gradient .portlet-msg-status {
background: url(content/tigris/images/icon_status_sml.gif);
background-repeat: no-repeat;
padding-left: 20px;
min-height: 15px;
}

The above gif file could never be found according to the current content
list paths.

2. A FileNotFoundException will be thrown out when browser try to request
for these gif files at the following code:

SimpleContentLocator contentLocator = new SimpleContentLocator(
this.contentDir, urlHints, useCache, httpRequest .getContextPath(),
requestURI, getContentSearchPathes(httpRequest));

so the following code could never be called:

httpRequest.setAttribute("org.apache.jetspeed.content.filtered", "true");

3. This will lead to when browser request a *.gif file, the jetspeed
pipeline get called and then a java.lang.IllegalStateException got fired.

A quick fix is moved the line "httpRequest.setAttribute("
org.apache.jetspeed.content.filtered", "true");" before creating
SimpleContentLocator.

I also notice that JS2-398
<http://issues.apache.org/jira/browse/JS2-398>might fix this issue
gracefully too, then just ignore me.

- James Liao