You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by tko429 <ya...@nttcom.co.jp> on 2016/02/02 07:34:54 UTC
How to forward another JSP or servlet. Camel-jetty or Camel-servlet
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.
Re: How to forward another JSP or servlet. Camel-jetty or
Camel-servlet
Posted by raja <ra...@meru.co.in>.
Hi tko429,
Did you find the Solution?
What about bridgeEndpoint?
<route>
<from uri="servlet:myapp?matchOnUriPrefix=true"/>
<to
uri="http://realserverhostname:8090/myapp?bridgeEndpoint=true&throwExceptionOnFailure=false"/>
</route>
--
View this message in context: http://camel.465427.n5.nabble.com/How-to-forward-another-JSP-or-servlet-Camel-jetty-or-Camel-servlet-tp5777129p5799552.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: How to forward another JSP or servlet. Camel-jetty or
Camel-servlet
Posted by tko429 <ya...@nttcom.co.jp>.
Mr.Claus Ibsen
Thank you for replying.
I will try another way.
Thanks.
--
View this message in context: http://camel.465427.n5.nabble.com/How-to-forward-another-JSP-or-servlet-Camel-jetty-or-Camel-servlet-tp5777129p5777173.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: How to forward another JSP or servlet. Camel-jetty or Camel-servlet
Posted by Claus Ibsen <cl...@gmail.com>.
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 <ya...@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