Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Weblogic Servlet Filter to modify request or response header for "Connection"

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here is my problem, I need to modify HTTP Connection header in the response. Weblogic is sending "Connection:close", I want to send "Connection: Keep-Alive", I know this is violating the standards, but one of the HTTPClients is behaving wierd, that is the reason I am forced to do this on the server side.

In order to achieve this I am trying to write a Servlet Filter. But the problem is, weblogic is wrapping request and response to its internal classes.
weblogic.servlet.internal.ServletRequestImpl;
weblogic.servlet.internal.ServletResponseImpl;

How can I achieve something like avoid using weblogic internal classes (i.e., may be remove weblogic.jar) from classpath and add j2ee.jar in the classpath so that I can get HttpServletRequestWrapper and HttpServletResponseWrapper so that I can override getHeader(String) Method by extending HttpServletRequestWrapper class using a filter.



When I remove weblogic.jar from classpath, I am not able to start weblogic server.

Any clues??

Thanks in advance for your help. BTW I am using Weblogic 9.x



 
Ranch Hand
Posts: 147
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What WL version?

In WL10 there are a couple of HTTP config settings for the managed servers which look like they may control this.
Check what the "Enable Keepalives", Duration and HTTS Duration are set at.


Though the docs show the min value is 5 seconds, so might be barking up the wrong tree here.

http://e-docs.bea.com/wls/docs100/ConsoleHelp/pagehelp/Corecoreserverserverprotocolshttptitle.html#attributes

 
Sri Sri
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ed Ward,

Thanks for your reply. I am using Weblogic 9.2. It seems in Weblogic there is no way you can modify standard HTTP headers using Servlet Filters.

The configuration you are pointing is to enable/disable keep-alive and modify keep alive time.

Thanks,
Harish
 
Yes, my master! Here is the tiny ad you asked for:
We need your help - Coderanch server fundraiser
https://coderanch.com/t/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic