cancel
Showing results for 
Search instead for 
Did you mean: 

Get data from Http Header

Former Member
0 Kudos

hello all,

I was asked to check the possibility to get data from http header in web dynpro.

Does any one have an idea if this is possible?

thanks,

Michal

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Thanks Satyajit.

I'm not on CE. I found a class HTTPRequestInput, does any one have an example how to use it.

can I use servlet.jar if i'm not using CE, where do I add the jar file?

thanks,

Michal

Former Member
0 Kudos

Hi Michal,

Can you try this code to read HTTp header parameter.


String paramValue =
      WDProtocolAdapter().getProtocolAdapter().getRequestObject().
       getParameter(u201Cparamu201D); // Paramete Name

Alternatively you can download servlet.jar from:

http://java.sun.com/products/servlet/download.html

Edited by: kunal kotak on Jan 14, 2009 3:10 PM

Answers (3)

Answers (3)

Former Member
0 Kudos

yes, thanks. I figured out the parameters issue, I hope..

Former Member
0 Kudos

Hey Michal,

Did you use this code to read HTTP request header variables?

String paramValue =

WDProtocolAdapter().getProtocolAdapter().getRequestObject().

getParameter(u201Cparamu201D); // Paramete Name

It doesn't seem to read properly for me.

Former Member
0 Kudos

Thanks all.

Edited by: michal shalom on Jan 14, 2009 11:59 AM

Former Member
0 Kudos

did that solved your problem?

i suppose in yor earlier msg(before editing above msg) it looked as if you were strugling with param value

Former Member
0 Kudos

Hi,

You can read the header parameter using the HTTPServletRequest object. If you are on CE then try this:

HttpServletRequest request = (HttpServletRequest) WDProtocolAdapter.getProtocolAdapter()
                                                                   .getRequestObject()
                                                                   .getProtocolRequest();
String value = request.getHeader("<name of parameter>");

You will need "servlet.jar" added to your project or add a DC dependency to it.

Regards,

Satyajit