I need to download images from a website, and I have the login name and password, but if i just use URL to download the image, it will throw a exception: there is no value i
Use the HTTP Client libraries in order to write a spider for content access.
I would suggest to record the HTTP traffic for login and content access and then rebuild the communication using the library, if you want to stick with Java.
There are other libraries as well for other languages like Perl:LWP.