[jboss-user] [JBoss Portal] - invoque a Servlet into a portlet

khadijbal do-not-reply at jboss.com
Wed Jun 4 07:35:35 EDT 2008


 I want to use a servlet for the downalding of a file PDF, I tried to call it since my portlet with the following code ( in doView() method ):
public void doView(RenderRequest req, RenderResponse rep)
  | {
  | rep.setContentType("text/html");
  | String titre = (String) req.getParameter("titreformation");
  | if (title !=null)
  | {
  | HttpServletRequest request = null;
  | HttpServletResponse reponse = null;
  | request.setAttribute("title", title);
  | 	try {
  | 				RequestDispatcher d = (RequestDispatcher) getPortletContext().getRequestDispatcher(
  | 						"/MyServlet");
  | 				d.include(request, reponse);
  | 			} catch (ServletException se) {
  | 				System.out.print se);
  | 			}
  | 
  | }

but i have the following error:
Cause: java.lang.ClassCastException: org.jboss.portal.portlet.impl.jsr168.api.PortletRequestDispatcherImpl 
  | Message: org.jboss.portal.portlet.impl.jsr168.api.PortletRequestDispatcherImpl 
  | StackTrace: 
  | java.lang.ClassCastException: org.jboss.portal.portlet.impl.jsr168.api.PortletRequestDispatcherImpl
  | 	at portal.portlets.PListeFormation.doView(Unknown Source)
  | 	at javax.portlet.GenericPortlet.doDispatch(GenericPortlet.java:133)
  | 	at javax.portlet.GenericPortlet.render(GenericPortlet.java:306)
  | 	at org.jboss.portal.portlet.impl.jsr168.PortletContainerImpl.invokeRender(PortletContainerImpl.java:483)


Someone can help me please

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4155642#4155642

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4155642



More information about the jboss-user mailing list