aspose file tools*
The moose likes Sockets and Internet Protocols and the fly likes login to website as user, no browser Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "login to website as user, no browser" Watch "login to website as user, no browser" New topic
Author

login to website as user, no browser

chop ficaro
Ranch Hand

Joined: May 02, 2010
Posts: 30
there's probably no way to do this, but i was wondering if java could login as a user to a website without opening a browser
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19542
    
  16

Maybe, it depends on how the site is built. Either way, you'll need cookies to let the server know you remembered the login. I'd check out Apache's HttpClient or a similar browser emulation library. I believe JWebUnit can also do what you need.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 39547
    
  27
Yes, JWebUnit (and HtmlUnit, on which it's built) can do this, and they have a much higher level API than HttpClient, so there's much less code to write.


Ping & DNS - updated with new look and Ping home screen widget
chop ficaro
Ranch Hand

Joined: May 02, 2010
Posts: 30
thanks guys il check it out
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: login to website as user, no browser
 
Similar Threads
HttpSession sharing between browser instances on same machine!
is there any way besides cookie to keep user info?
How to maintain a single session in struts.
Pass parameters with response.sendRedirect
URLConnection class