Hari, Piyush wrote:
I want to display another JSP page in a portlet once the user clicks on a
'Submit' button. I associated the action to the processAction(ActionRequest
request, ActionResponse response) function. I am sure it gets called. What
should I include under this to accomplish my goal ?
Please help . Your hel would be greatly appreciated. I am sitting over this
issue for long now.
Thanks in advance,
Piyush
Hi Piyush,
Try the Bridges GenericServletPortlet, or a similar approach.
It allows you to override the view page in a request attribute, and then
fall back to the prefs. Could probably use a PORTLET_SCOPE session
variable as well here.
public void doView(RenderRequest request, RenderResponse response)
throws PortletException, IOException
{
String viewPage = this.defaultViewPage;
// allow ViewPage override by the request
String reqViewPage = (String)
request.getAttribute(PARAM_VIEW_PAGE);
if(reqViewPage != null)
{
viewPage = reqViewPage;
}
if (this.allowPreferences == true)
{
PortletPreferences prefs = request.getPreferences();
if (prefs != null && reqViewPage == null)
{
viewPage = prefs.getValue(PARAM_VIEW_PAGE,
this.defaultViewPage);
}
}
if (viewPage != null)
{
PortletContext context = getPortletContext();
PortletRequestDispatcher rd =
context.getRequestDispatcher(viewPage);
rd.include(request, response);
}
return;
}
--
David Sean Taylor
Bluesunrise Software
[EMAIL PROTECTED]
[office] +01 707 773-4646
[mobile] +01 707 529 9194
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]