Can't get RenderParameters to render

7 views
Skip to first unread message

argherna

unread,
Sep 8, 2009, 10:39:45 PM9/8/09
to Cernunnos Discussion
I'm writing a Cernunnos portlet that is in it's own context (war
file). I have the simplest scripts in the actions/ and views/
directories. The one in the actions directory is like this:

<!--
| doSimple.crn
+-->
<with>
<attribute key="webapps">${groovy
(WebAttributes.REQUEST.getPortletSession().getPortletContext
().getRealPath('/'))}</attribute>
<subtasks>

<groovy>
<script>
WebAttributes.RESPONSE.setRenderParameter('myresult', 'SUCCESS'); //
Assume until we know otherwise
</script>
<subtasks>
<log logger-name="doDeploy" level="debug">yay!</log>
</subtasks>
</groovy>
</subtasks>
</with>

The view looks like this:

<!--
| simple.crn
+-->
<request-dispatcher resource="/WEB-INF/jsp/SimplePortlet/simple.jsp"/>

And the JSP:

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="portlet" uri="http://java.sun.com/portlet"%>

<portlet:defineObjects/>

<form method="POST" action="<portlet:actionURL><portlet:param
name="action" value="doDeploy"/><portlet:param name="view"
value="deploy"/></portlet:actionURL>">
<input type="submit" value="Do Something Simple"/>
</form>


<c:if test="${myresult != null}">
<p>result: <c:out value="${myresult}"/></p>
</c:if>

There is a spring context file (SimplePortlet-Portlet.xml) and it
looks like this:

<beans>
<bean id="settings" class="java.util.HashMap">
<constructor-arg>
<map>
<entry key="CernunnosPortlet.ACTION_PREFIX"><value>/
WEB-INF/actions/SimplePortlet/</value></entry>
<entry key="CernunnosPortlet.VIEW_PREFIX"><value>/WEB-
INF/views/SimplePortlet/</value></entry>
<entry
key="CernunnosPortlet.DEFAULT_VIEW"><value>simple</value></entry>
</map>
</constructor-arg>
</bean>
</beans>

Now, when I deploy this to uPortal running on my workstation, the JSP
renders just fine. But when I click the button, I expect to see
SUCCESS, but I don't see anything. Any suggestions?

argherna

unread,
Sep 8, 2009, 10:42:06 PM9/8/09
to Cernunnos Discussion
Goofed. Here's the form tag:

<form method="POST" action="<portlet:actionURL><portlet:param
name="action" value="doSimple"/><portlet:param name="view"
value="simple"/></portlet:actionURL>">

Andrew Wills

unread,
Sep 9, 2009, 1:26:41 AM9/9/09
to cernunnos-...@googlegroups.com
Andy,

I get the same result as you, but I also figured out that it works if
you reference it like this:

<c:if test="${renderRequest.parameterMap.myresult != null}">
<p>result: <c:out value="${renderRequest.parameterMap.myresult[0]}"/></p>
</c:if>

Tomorrow I'm going to take a deeper look at that syntax you had and
how it's meant to work in portlet JSPs.

drew

Andy Gherna

unread,
Sep 9, 2009, 9:20:45 AM9/9/09
to cernunnos-...@googlegroups.com
Thanks Drew. I based it off the import-export portlet. It seems to
work in uPortal, but not outside of uPortal.
--
Andy Gherna
argh...@gmail.com
Twitter - http://twitter.com/argherna
Reply all
Reply to author
Forward
0 new messages