[jboss-user] [JBoss Portal] - Re: Problem regarding renderURL param
je.a.le
do-not-reply at jboss.com
Thu May 22 04:55:49 EDT 2008
with plain jsp i don't know, but using a little trick inside the portlet do view you could.
the problem is from the processAction / doView method. doView keep renderParam (set in processAction), therefore, render 'old' data when switching back using the tab button. Unfortunately ActionRequest doesn't allow us to remove a renderParam - That would solve the problem - I tried using Attributes, properties but none seem to work.
The 'trick' I'm using in a similar problems is to pass param from processAction to doView using... session ! yes, it's quite dirty. Sample :
| public void processAction(ActionRequest request, ActionResponse response) throws PortletException, IOException {
|
| PortletSession session = request.getPortletSession(true);
| if (session != null) {
| String todo = request.getParameter("articleedit_todo");
| session.setAttribute("todo", todo);
| }
| //......
| }
|
| public void doView(RenderRequest request, RenderResponse response) throws PortletException, IOException {
| //.......
| PortletSession session = request.getPortletSession(true);
| Object todo = session.getAttribute("todo");
| session.setAttribute("todo", null);
| if ((todo == null ? "" : todo.toString()).compareTo("goedit") == 0) {
| getPortletContext().getRequestDispatcher("/WEB-INF/jsp/articles/ACAdminArticleEditPortlet_view.jsp").include(request, response);
| } else {
| getPortletContext().getRequestDispatcher("/WEB-INF/jsp/articles/ACAdminArticlePortlet_view.jsp").include(request, response);
| }
| }
| }
A+
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4152587#4152587
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4152587
More information about the jboss-user
mailing list