You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jetspeed-user@portals.apache.org by Sebastian Komander <se...@gehacked.org> on 2005/08/08 14:26:57 UTC

Using Servlet in a StrutsPortlet

Hi..


I want to forward vom a struts action to a servlet.
Here are some parts of web.xml ..


<servlet>
 <servlet-name>XMLHandler</servlet-name>
 <servlet-class>test.servlet.TestServlet</servlet-class>
 <display-name>xml handler servlet</display-name>
</servlet>
<servlet-mapping>
 <servlet-name>xmlHandler</servlet-name>
 <url-pattern>/XMLHandler/*</url-pattern>
</servlet-mapping>


struts-config.xml

<global-forwards>
 <forward name="output" path="XMLHandler"
</global-forwards>

public ActionForward execute....{
...do something...


System.out.println("Now the forward should be done...");
mapping.findForward("output");

}



If I view the portlet at the browser, nothing happens. The Action loads,
"Now the forward..." is printed out, but nothing happens after...


Can you tell me how this works ? I thought i can work with the
RequestDispatcher, but I don't have access to it in my strutsaction-class



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


AW: Using Servlet in a StrutsPortlet

Posted by Sven Thiergen <s....@itcampus.de>.
> request.getRequestDispatcher("<servlet-name>").include(request, response);
> But this is not quit a good way, is it ? Is there another possibility ?

This is exactly the way you are expected to do it ;-)


---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org


Re: Using Servlet in a StrutsPortlet

Posted by Sebastian Komander <se...@gehacked.org>.
Ok..I find a way to do this:

in the execute-method do the following:

request.getRequestDispatcher("<servlet-name>").include(request, response);


But this is not quit a good way, is it ? Is there another possibility ?



---------------------------------------------------------------------
To unsubscribe, e-mail: jetspeed-user-unsubscribe@portals.apache.org
For additional commands, e-mail: jetspeed-user-help@portals.apache.org