You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Navengit <ya...@gmail.com> on 2012/06/26 16:08:55 UTC

Camel Jetty Endpoint query

I have a Java Struts 1.1 based application which has a JSP which is sending
an HTTP request to Jetty endpoint in my Camel application. 
I have an object set in  request.setAttribute. 
How to get this object in my camel processor? 
I am able to get the request parameters but not request attributes. 
I have tried both GET and POST but in vein. 
I will appreciate any reply on the same. 

--
View this message in context: http://camel.465427.n5.nabble.com/Camel-Jetty-Endpoint-query-tp5715119.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel Jetty Endpoint query

Posted by Claus Ibsen <cl...@gmail.com>.
On Wed, Jun 27, 2012 at 5:21 AM, Navengit <ya...@gmail.com> wrote:
> Hi Willem,
>  Thanks for the reply there.
> I have tried this way as well but the attributes which I am setting in my
> HttpRequest object is getting stripped off.
> How can I set an object from a JSP in HTTP body so that I can get the same
> from my Camel exchange message using exchange.getIn().getBody;
>

Use google to search for this. For example "How to send object over
http from jsp"

You would need to use the right content-type so the object can be
marshalled over http etc.



>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-Jetty-Endpoint-query-tp5715119p5715136.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen

Re: Camel Jetty Endpoint query

Posted by Navengit <ya...@gmail.com>.
Hi Willem,
 Thanks for the reply there.
I have tried this way as well but the attributes which I am setting in my
HttpRequest object is getting stripped off.
How can I set an object from a JSP in HTTP body so that I can get the same
from my Camel exchange message using exchange.getIn().getBody;



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-Jetty-Endpoint-query-tp5715119p5715136.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel Jetty Endpoint query

Posted by Willem Jiang <wi...@gmail.com>.
Hi,

You can access the request object by looking up the message header with 
the name Exchange.HTTP_SERVLET_REQUEST like this in your processor

Message in = exchange.getIn();
Request request = (Request)in.getHeader(Exchange.HTTP_SERVLET_REQUEST);


On 6/26/12 10:08 PM, Navengit wrote:
> I have a Java Struts 1.1 based application which has a JSP which is sending
> an HTTP request to Jetty endpoint in my Camel application.
> I have an object set in  request.setAttribute.
> How to get this object in my camel processor?
> I am able to get the request parameters but not request attributes.
> I have tried both GET and POST but in vein.
> I will appreciate any reply on the same.
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-Jetty-Endpoint-query-tp5715119.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>


-- 
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
          http://jnn.javaeye.com (Chinese)
Twitter: willemjiang
Weibo: willemjiang



Re: Camel Jetty Endpoint query

Posted by Navengit <ya...@gmail.com>.
Thanks a lot for the reply there.
Can you please elaborate as to how to make an object part of HTTP body.
eg: how to do it in a JSP?



--
View this message in context: http://camel.465427.n5.nabble.com/Camel-Jetty-Endpoint-query-tp5715119p5715123.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Camel Jetty Endpoint query

Posted by Claus Ibsen <cl...@gmail.com>.
I dont think attributes on request object is part of what is sent over
HTTP. I would assume its a local object.
If you want to send that object to Camel it has to be either part of
HTTP HEADER
HTTP BODY

And since its a object you may want to send it as serialized content as bytes.


On Tue, Jun 26, 2012 at 4:08 PM, Navengit <ya...@gmail.com> wrote:
> I have a Java Struts 1.1 based application which has a JSP which is sending
> an HTTP request to Jetty endpoint in my Camel application.
> I have an object set in  request.setAttribute.
> How to get this object in my camel processor?
> I am able to get the request parameters but not request attributes.
> I have tried both GET and POST but in vein.
> I will appreciate any reply on the same.
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Camel-Jetty-Endpoint-query-tp5715119.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.com
Author of Camel in Action: http://www.manning.com/ibsen