문제

I have some Tomcat applications that perform REST lookups on other web services. These services are beginning to restrict access according to user agent. The user agent employed by Tomcat 7, by default, consists of the Java version, e.g., Java/1.6.0_21. Is there a way to change the default user agent in Tomcat?

It is of course possible to set the User Agent in a Java script, but I can find no documentation whatsoever for applying a User Agent across all Tomcat applications.

올바른 솔루션이 없습니다

다른 팁

You need to set the User-Agent header on your HTTP request.

I don't know how you do this call (HttpClient? JAX-RS?) but just to give you an idea:

HttpGet request = ...;
request.addHeader("User-Agent", "your user agent");
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top