You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by Mike Davis <th...@yahoo.com> on 2003/01/18 03:07:01 UTC
WML JSPPortlet template not resolving
Hi,
- Thanks for all the responses so far regarding my other issues I have raised. I truly appreciate the advice and help! I promise that once I get this stuff working, I will contribute to the next build by adding some new demo portlets (or expand on some of the existing ones) if folks agree they are worth while
- I am trying to get a (WML media type) JSPPortlet-based portlet to work
- I am still using the default (out of the box) Velocity-based templates and have successfully created and tested my own (HTML) JSPPortlet-based portlets.
- Given the following entry in local-portlets.xreg:
<portlet-entry name="wmlJSP" hidden="false" type="ref" parent="JSP" application="false">
<meta-info>
<title>wmlJSP</title>
<description>WML JSP Portlet Example</description>
</meta-info> <classname>org.apache.jetspeed.portal.portlets.JspPortlet</classname>
<parameter name="template" value="wmlfun.jsp" hidden="true"
cachedOnName="true" cachedOnValue="true"/>
<media-type ref="wml"/>
<url cachedOnURL="true"/>
<category group="Jetspeed">demo</category>
<category group="Jetspeed">jsp.demo</category>
</portlet-entry>
I also tried value="wml/wmlfun.jsp" just for fun, it fails in exactly the same manner. Note, there is no action, however the HelloJSP portlet in demo-portlets.xreg also has no action either and it works fine...
- I can add this portlet under the customize WML no problem, so it has been added to the registry.
- I have a file called wmlfun.jsp under ../WEB-INF/templates/jsp/portlets/wml (I needed to create the WML directory, a HTML already existed to which I have previously successfully added some HTML JSP's). Text of wmlfun.jsp:
<%@ taglib uri='/WEB-INF/templates/jsp/tld/template.tld' prefix='jetspeed' %>
<card title="Hello">
<p align="center">Ready 4 fun</p>
</card>
- Quote from the tutorial: "Similarly, WML portlets would be found under /WEB-INF/templates/jsp/portlets/wml"
which is where I added wmlfun.jsp
- After successfully adding this portlet (in HTML mode) using "customize WML", I successfully login using my OpenWave emulator. It then spits back valid WML other than the following error message embedded:
org.apache.turbine.util.TurbineException: Error rendering Velocity template: null
Line from jetspeed.log:
[17 Jan 2003 16:54:28 ERROR] - Error rendering Velocity template: null: null
- It appears to me that JetSpeed is looking for a Velocity template, when I have clearly specified a JSPPortlet, thus it's not looking for the JSP template I placed in the correct directory (according to the tutorial).
- I added another entry in local-portlets.xreg which points to the same template jsp file, but it's name/title/etc. are different and the media type is html. I then simply copied my wmlfun.jsp from ../WEB-INF/templates/jsp/portlets/wml to ../WEB-INF/templates/jsp/portlets/html. And guess what, it works great... This other portlet entry text is:
<portlet-entry name="wmlHJSP" hidden="false" type="ref" parent="JSP" application="false">
<meta-info>
<title>AAwmlHJSP</title>
<description>wmlH JSP Portlet Example</description>
</meta-info>
<classname>org.apache.jetspeed.portal.portlets.JspPortlet</classname>
<parameter name="template" value="wmlfun.jsp" hidden="true"
cachedOnName="true" cachedOnValue="true"/>
<media-type ref="html"/>
<url cachedOnURL="true"/>
<category group="Jetspeed">demo</category>
<category group="Jetspeed">jsp.demo</category>
</portlet-entry>
- To restate the obvious, it SURE looks like jetspeed is not looking for the WML template in the "correct" place. BTW, The "Stocks" demo example (not "Stock Portfolio"), which is Velocity-based I believe, ALSO fails and spits out a:
org.apache.turbine.util.TurbineException: Error rendering Velocity template: null
Thus the only working WML portlets that I can see are the demo examples, Stock Portfolio and MyWeather. Both are WMLFilePortlets which serve static WML files :-(
- Side note: the Logout function for WML (last link) pukes nicely right out of the box with :
Horrible Exception: org.apache.turbine.services.InstantiationException: ServiceBroker: unknown service SecurityService requested
Thanks again,
Mike
---------------------------------
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now
Re: WML JSPPortlet template not resolving
Posted by Mike Davis <th...@yahoo.com>.
Hi,
An update...
I still have the problem with the templates resolving incorrectly for WML portlets (see below in previous message).
However, I dove into the Velocity controller/controls/layout and learned a bit more about them. The problem I have discovered is the $!portlet.getContent($data) is where I think the problem is. This is where it must be trying to resolve the template and failing. Taking a closer look at these files and making some small modifications, it appears that the whole demo example works great IF you use the WMLFilePortlet (static WML files). When I try to refer to my own new WML portlet using $jslink and the default controller (FlowPortletController) and control (ClearPortletControl), I simply see the exact same WML deck. It doesn't look like the provided example handles presenting a different WML deck based on a choice within the first deck. Does anyone have a complete example (including the appropriate Action/controllers/controls/layouts) for dynamically generated WML? To be clear on a related point, I need to refer to (via a link or action or SOMETHING) another WML deck that will contain data based on a choice from the first deck (sounds like a great new example for the next build doesn't it?). NOT everything simply contained/presented in one deck and simply using anchors to another card in the deck.
Thanks again for any help/hints, the next rabbit hole is waiting for me :-)
Mike
Mike Davis <th...@yahoo.com> wrote:
Hi,
- Thanks for all the responses so far regarding my other issues I have raised. I truly appreciate the advice and help! I promise that once I get this stuff working, I will contribute to the next build by adding some new demo portlets (or expand on some of the existing ones) if folks agree they are worth while
- I am trying to get a (WML media type) JSPPortlet-based portlet to work
- I am still using the default (out of the box) Velocity-based templates and have successfully created and tested my own (HTML) JSPPortlet-based portlets.
- Given the following entry in local-portlets.xreg:
WML JSP Portlet Example
org.apache.jetspeed.portal.portlets.JspPortlet
cachedOnName="true" cachedOnValue="true"/>
demo
jsp.demo
I also tried value="wml/wmlfun.jsp" just for fun, it fails in exactly the same manner. Note, there is no action, however the HelloJSP portlet in demo-portlets.xreg also has no action either and it works fine...
- I can add this portlet under the customize WML no problem, so it has been added to the registry.
- I have a file called wmlfun.jsp under ../WEB-INF/templates/jsp/portlets/wml (I needed to create the WML directory, a HTML already existed to which I have previously successfully added some HTML JSP's). Text of wmlfun.jsp:
Ready 4 fun
- Quote from the tutorial: "Similarly, WML portlets would be found under /WEB-INF/templates/jsp/portlets/wml"
which is where I added wmlfun.jsp
- After successfully adding this portlet (in HTML mode) using "customize WML", I successfully login using my OpenWave emulator. It then spits back valid WML other than the following error message embedded:
org.apache.turbine.util.TurbineException: Error rendering Velocity template: null
Line from jetspeed.log:
[17 Jan 2003 16:54:28 ERROR] - Error rendering Velocity template: null: null
- It appears to me that JetSpeed is looking for a Velocity template, when I have clearly specified a JSPPortlet, thus it's not looking for the JSP template I placed in the correct directory (according to the tutorial).
- I added another entry in local-portlets.xreg which points to the same template jsp file, but it's name/title/etc. are different and the media type is html. I then simply copied my wmlfun.jsp from ../WEB-INF/templates/jsp/portlets/wml to ../WEB-INF/templates/jsp/portlets/html. And guess what, it works great... This other portlet entry text is:
wmlH JSP Portlet Example
org.apache.jetspeed.portal.portlets.JspPortlet
cachedOnName="true" cachedOnValue="true"/>
demo
jsp.demo
- To restate the obvious, it SURE looks like jetspeed is not looking for the WML template in the "correct" place. BTW, The "Stocks" demo example (not "Stock Portfolio"), which is Velocity-based I believe, ALSO fails and spits out a:
org.apache.turbine.util.TurbineException: Error rendering Velocity template: null
Thus the only working WML portlets that I can see are the demo examples, Stock Portfolio and MyWeather. Both are WMLFilePortlets which serve static WML files :-(
- Side note: the Logout function for WML (last link) pukes nicely right out of the box with :
Horrible Exception: org.apache.turbine.services.InstantiationException: ServiceBroker: unknown service SecurityService requested
Thanks again,
Mike
---------------------------------
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now
---------------------------------
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now