Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Can I change ServletRequest.getServerName() value?

843841Feb 24 2005 — edited Feb 25 2005
Hello all!

Does anybody know if there is possibility to change (in Java code) the value returned by ServletRequest.getServerName() ?
By default it:
"Returns the host name of the server that received the request. For HTTP servlets, same as the value of the CGI variable SERVER_NAME"

For example, I have a filter and want to replace SERVER_NAME in request with some custom value for all further handlers (servlets, JSPs).

Thank you in advance,
Vlad.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 25 2005
Added on Feb 24 2005
2 comments
490 views