camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: How to forward another JSP or servlet. Camel-jetty or Camel-servlet
Date Tue, 02 Feb 2016 07:21:20 GMT
You cannot do that, you should likely use standard servlets if you
want to do servlet forwarding.

You can then from a servlet call Camel if you need to.

On Tue, Feb 2, 2016 at 7:34 AM, tko429 <yahata.kousuke@nttcom.co.jp> wrote:
> Nice to meet you , everyone. from Japan
>
> I want to construct servlet system with Camel.
>
> the above is my image.
>
> camel-servlet or camel-jetty receive HTTP Request.
>
> Then, next Processor parse HTTP Request and forward another JSP or servlet.
>
> But I have no idea about this way.
>
> I tried to follow,
>
> =====
>
>  .from(jetty:http://localhost:8080//・・・)  // receive http request
>  .to( uri="Proc1"/);                                 //overrided by above
> URI
>   <bean class="testDisp" id="Proc1"/>
>
>  Proc.java
>
>     public class Proc1 implements Processor {
>
>         @Override
>         public void process(Exchange exchange) throws Exception {
>             exchange.setProperty(Exchange.CHARSET_NAME, "utf-8");
>             exchange.getIn().setHeader(Exchange.CONTENT_TYPE, "text/html;
> charset=utf-8");
>
>             HttpServletRequest req =
> exchange.getIn().getBody(HttpServletRequest.class);
>             HttpServletResponse res =
> exchange.getIn().getBody(HttpServletResponse.class);
>
>             RequestDispatcher dispatch =
> req.getRequestDispatcher("/services/testDisp");
>             dispatch.forward(req, res);
>
> =======
>
> Please teach me how to forward another JSP or servlet
>
>
>
> Thank you.
>
> P.S. I am not good at English,sorry
>
>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/How-to-forward-another-JSP-or-servlet-Camel-jetty-or-Camel-servlet-tp5777129.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2: https://www.manning.com/ibsen2

Mime
View raw message