Home
TeamSite
Returning to Portlet from Servlet
PaulW
Using CC standard, I have a JSP portlet. The form action of this portlet is a servlet. At the end of the servlet I have the following code (straight out of Webcast example)
RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/customer/content/create/index.jsp");
// Redirect User Back To TeamSite
dispatcher.include( request, response );
But it does not return to the orginial standard view with all the portlets showing. It just displays my JSP page over the whole screen (Not as a portlet in a portal). I couldn't see anything magic being passed to the Servlet in any of the examples.
In the past with CC Pro I set the Done Page context as a hidden form, which seemed to do the job (as below). But that doesn't seem to help my situation here. Has it got anything to do with portlet context in the JSP page?
<context:hiddenForm var="donePageCtx"/>
Any ideas?
Your help is GREATLY appreciated.
Find more posts tagged with
Comments
Nicholas
Try below
RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/customer/content/create/index.jsp");
dispatcher.forward(request, response);
Thanks Nicholas
PaulW
I have used .forward() in the past for CC Pro. But I read in the documentation that portlets require the .include() call, because they are part of the portal. I tried anyway, still no luck.
any other ideas?
Nicholas
Ohh yes, we can not use forward method for portlets. It works for Servlet-Servlet/Servlet-JSP but with portlets need to use include() method only.
Can you please tell me, which class you are extending for portlets?
Thanks Nicholas
Nicholas
(GenericPortlet or PortletAdapter)?
I could be more specific for your solution, if you can detail your portlet spcifications
-- Nicholas
PaulW
Well I haven't really inherited the portlet from anything. I have a JSP page which is the portlet. And when the form inside that is submitted, control is passed to the servlet, which is inherited from HttpServlet. Then I wanted the servlet to pass control back to the Portlet, but displaying the entire portal.
Nicholas
This means you are not using any portlet sort of thing.
What I meant was if you are using PortletAdapter then it is specific to the IBM jetspeed but if you are extending thru the GenericPortlet then it will work on almost all plateforms because this a generic portlet class.
Now I don't know how to help you!
-- Nicholas
Edited by Nicholas on 05/13/05 04:05 AM (server time).
Nicholas
okay, what best I can do here, if you wish I can write a simple portlet example, which may solve your problem
or
Send your code, I can try playing with it then.
Thanks Nicholas
PaulW
I am not a J2EE expert. But I explained before, I am using the Content Center Standard Portal environment. I created a JSP page, then I added that page to "portal_custom.xml". All the TeamSite documentation is referring to what I created as a Portlet.
Does anybody have any experience that could help me with this?
PaulW
mate, that would be brilliant. I have attached the relevant files. Let me know what you think.
The example from the Portal customisation webcast redirects in the same way, the only difference is they refernce the servlet in the "portal_custom.xml" wheras, I go to the JSP first. Can't see how that would matter.
Nicholas
Okay, I am looking on this. It may take sometime.
Thanks Nicholas
Nicholas
Paul, your code and settings looks fine. Couple of more questions
Do you successfully installed and configured cssdk api?
Do you tried running the webcast filelist example?
Thanks Nicholas
Nicholas
I just found couple of differences in portal_custom.xml file. Attaching the example file, may be helpful to you.
-- Nicholas
<?xml version="1.0" encoding="utf-8"?>
<iwov-portal>
<globals>
<portlet id="_id.com.corp.custom.filelist"
label="listfiles.portlet.label"
url="/filelist?list_files_portlet-list=mymodified"
resourceBundle="com.corp.custom.strings">
<title-bar id="titlebar" type="standard"/>
</portlet>
</globals>
<portal-page id="iw.ccstd.home.portal-page"
label="ccstd_home.portal_page.title"
description="ccstd_home.portal_page.desc"
resourceBundle="com.interwoven.ui.teamsite.ccstd.portal">
<portlet-group id="iw.ccstd.home.column1.portal-group" width="30%">
<iwov-insert-after id="iw.ccstd.home.my_favorites.portlet">
<portlet id="id.com.corp.custom.filelist"
refid="_id.com.corp.custom.filelist"/>
</iwov-insert-after>
</portlet-group>
</portal-page>
</iwov-portal>