portals-jetspeed-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 23025] New: - setTemplate method doesn't work with JSP's (JspPortletAction or GenericMVCAction)
Date Tue, 09 Sep 2003 12:45:26 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23025>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23025

setTemplate method doesn't work with JSP's (JspPortletAction or GenericMVCAction)

           Summary: setTemplate method doesn't work with JSP's
                    (JspPortletAction or GenericMVCAction)
           Product: Jetspeed
           Version: 1.4b4
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: Blocker
          Priority: Other
         Component: JSP
        AssignedTo: jetspeed-dev@jakarta.apache.org
        ReportedBy: gjoseph@kiala.com


In my action class extending JspPortletAction, i try to use the setTemplate
method, but it doesn't work. I throws a NullPointerException in PortletAction
when trying to
retrieve a "VelocityPortletContext" (how surprising when working with a
JSPPortlet) Besides, I had to catch this exception myself, otherwise it
wasn't appearing anywhere in the logs, not even a single error message...

I found this had been fixed a while ago:
http://www.mail-archive.com/jetspeed-user@jakarta.apache.org/msg07770.html
Bug when looking on the cvs view, i see there's been some refactoring
afterwards, so i think the issue might have re-appeared.

my code simply looks like:

//.....blahblah do stuff
setTemplate(rundata, "mypage.jsp"); // also tried with the additional boolean
argument

But then the portlet still displays the original template (the one set in the
xreg file).
(I also tried without the .jsp extension, but result is exactly the same)

Here's how my local-portlets.xreg file looked like:
<?xml version="1.0" encoding="UTF-8"?>
<registry>
<portlet-entry name="Thingie" hidden="false" type="ref"
               parent="GenericMVCPortlet" application="false">
  <meta-info>
    <title>Thingieportlet</title>
    <description>
      Allows to search thingies using various search criterias.
    </description>
  </meta-info>
  <parameter name="viewtype" value="Jsp" hidden="true"/>
  <parameter name="template" value="thingie/searchform.jsp" hidden="false"/>
  <parameter name="action" hidden="true" value="ThingieSearchAction" />
  <media-type ref="html"/>
  <category>company</category>
  <category>company.thingie</category>
</portlet-entry>
</registry>

I also tried to use the JSP portlet as a parent with no more luck.

Here's how it looks after an example given by Scott Weaver:
<?xml version="1.0" encoding="UTF-8"?>
<registry>

<portlet-entry name="CompanyMVCPortlet" hidden="false" application="false"
               type="abstract">
  <security-ref parent="default"/>
 
<classname>org.apache.jetspeed.portal.portlets.GenericMVCPortlet</classname>
  <parameter name="viewtype" value="JSP" hidden="false"
             cachedOnName="true" cachedOnValue="true"/>
  <url cachedOnURL="true"/>
  <category group="Jetspeed">company</category>
</portlet-entry>

<portlet-entry name="Thingie" hidden="false" application="false"
               type="ref" parent="JspMVCPortlet">
  <security-ref parent="default"/>
  <meta-info>
    <title>Thingie portlet</title>
    <description>Allows to search thingies using various search
criterias.</description>
  </meta-info>
 
<classname>org.apache.jetspeed.portal.portlets.GenericMVCPortlet</classname>
  <parameter name="template" value="thingie/searchform.jsp"
             hidden="false" cachedOnName="true" cachedOnValue="true"/>
  <parameter name="action" value="ThingieSearchAction"
             hidden="false" cachedOnName="true" cachedOnValue="true"/>
  <parameter name="provides.customization" value="true"
             hidden="false" cachedOnName="true" cachedOnValue="true"/>
  <media-type ref="html"/>
  <url cachedOnURL="true"/>
  <category>company.thingie</category>
</portlet-entry>
</registry>

Here's the strackTrace of the NullPointerException mentioned above:
java.lang.NullPointerException
        at
org.apache.jetspeed.modules.actions.portlets.PortletAction.getPortlet(PortletAction.java:208)
        at
org.apache.jetspeed.modules.actions.portlets.PortletAction.setTemplate(PortletAction.java:169)
        at com.company.web.actions.SearchAction.doSearch(SearchAction.java:81)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:324)
        at
org.apache.jetspeed.modules.actions.portlets.PortletActionEvent.fireEvent(PortletActionEvent.java:215)
        at
org.apache.jetspeed.modules.actions.portlets.PortletActionEvent.executeEvents(PortletActionEvent.java:176)
        at
org.apache.jetspeed.modules.actions.portlets.GenericMVCAction.perform(GenericMVCAction.java:148)
        at org.apache.turbine.modules.ActionLoader.exec(ActionLoader.java:122)
        at
org.apache.turbine.modules.pages.DefaultPage.doBuild(DefaultPage.java:143)
        at org.apache.turbine.modules.Page.build(Page.java:90)
        at org.apache.turbine.modules.PageLoader.exec(PageLoader.java:123)
        at org.apache.turbine.Turbine.doGet(Turbine.java:563)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Unknown Source)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(Unknown Source)
        at org.apache.catalina.core.StandardWrapperValve.invoke(Unknown Source)
        at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown
Source)
        at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
        at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
        at org.apache.catalina.core.StandardContextValve.invoke(Unknown Source)
        at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown
Source)
        at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
        at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
        at org.apache.catalina.core.StandardContext.invoke(Unknown Source)
        at org.apache.catalina.core.StandardHostValve.invoke(Unknown Source)
        at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown
Source)
        at org.apache.catalina.valves.ErrorDispatcherValve.invoke(Unknown Source)
        at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown
Source)
        at org.apache.catalina.valves.ErrorReportValve.invoke(Unknown Source)
        at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown
Source)
        at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
        at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
        at org.apache.catalina.core.StandardEngineValve.invoke(Unknown Source)
        at
org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(Unknown
Source)
        at org.apache.catalina.core.StandardPipeline.invoke(Unknown Source)
        at org.apache.catalina.core.ContainerBase.invoke(Unknown Source)
        at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:223)
        at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:594)
        at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:392)
        at
org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:565)
        at
org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:619)
        at java.lang.Thread.run(Thread.java:536)


I am not sure I choose the right component, since this also covers portlets,
registry or even maybe documentation, since I might just as well have forgotten
something...

Thanks.
(Oh and i set the severity to "blocker" since it blocks me in using jetspeed any
further, i hope that's what this means)

Mime
View raw message