Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Web Browser

 
Eric Gero
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a very simple web browser written in Java. It uses a URLConnection and JEditorPane. I would like to mask the "user-agent" header property that the browser reports. Currently the "user-agent" displays as "Java/1.5.0_07" and some websites think it is a crawler. Any ideas on where I should look? I have tried setting System properties, and URLConnection properties, but it hasn't helped.

Thanks,
Eric
 
Joe Ess
Bartender
Posts: 9280
10
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have a look at Jakarta Commons HttpClient. It exposes the headers so you can set the user-agent.
 
Eric Gero
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you, I will have to dig into it a little, but from the website, it appears to be exactly what I need.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic