Hello John

I hope you don't mind if I send you an e-mail directly. I've found
this address on a mailing list.

I am using spring-portlet and it works quite nice. But now I've come
across a problem: I have a small test Portlet which manages a list of
bookmarks. I intended to count the number of times someone clicks a
link and display the list with a descending click count. So to do
this, I added another controller and in the
handleActionRequestInternal method, I increase the click count and do
a response.sendRedirect.

When I call sendRedirect, Pluto complains like this:
java.lang.IllegalStateException: Can't invoke sendRedirect() after
certain methods have been called
        at 
org.apache.pluto.core.impl.ActionResponseImpl.sendRedirect(ActionResponseImpl.java:142)
        at 
net.swisstech.portlet.bookmark.web.controller.BookmarkVisitController.handleActionRequestInternal(BookmarkVisitController.java:38)
        at 
org.springframework.web.portlet.mvc.AbstractController.handleActionRequest(AbstractController.java:221)
        at 
org.springframework.web.portlet.mvc.SimpleControllerHandlerAdapter.handleAction(SimpleControllerHandlerAdapter.java:48)
        at 
org.springframework.web.portlet.DispatcherPortlet.doActionDispatch(DispatcherPortlet.java:779)
        at 
org.springframework.web.portlet.DispatcherPortlet.doActionService(DispatcherPortlet.java:702)
        at 
org.springframework.web.portlet.FrameworkPortlet.processRequest(FrameworkPortlet.java:431)
        at 
org.springframework.web.portlet.FrameworkPortlet.processAction(FrameworkPortlet.java:408)
        at 
org.apache.pluto.core.PortletServlet.dispatch(PortletServlet.java:171)
        at org.apache.pluto.core.PortletServlet.doGet(PortletServlet.java:113)

So I looked into plutos ActionRespnseImpl. It keeps a flag which is
flipped on certain calls like for example setRenderParameter.
ParameterMappingInterceptor does call that method in preHandle on line
73. So trying to send a redirect will then throw the above exception.

Is it possible to change the spring portlet code so redirecting can
work? Or is this a bug in plutos ActionResponseImpl?

Could you please comment on this issue?

Thank you
Patrick

--
"I love deadlines. I like the whooshing sound they make as they fly
by." -- Douglas Adams

Reply via email to