File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Web Browser Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Web Browser" Watch "Web Browser" New topic
Author

Web Browser

Eric Gero
Ranch Hand

Joined: Jul 20, 2005
Posts: 73
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

Joined: Oct 29, 2001
Posts: 8843
    
    7

Have a look at Jakarta Commons HttpClient. It exposes the headers so you can set the user-agent.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
Eric Gero
Ranch Hand

Joined: Jul 20, 2005
Posts: 73
Thank you, I will have to dig into it a little, but from the website, it appears to be exactly what I need.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Web Browser
 
Similar Threads
parsing the user-agent to get OS version
Best way to open new browser window - HTTP request in java or webpage
web spider setting HTTP User-Agent
URL reader error in my web application
User Agent String???