0

I am trying to do something like CURL in jsp page. I need to check if website has some string in it. I am very bad in Java, that's why this is maybe stupid question, but it might be useful for someone else also.

Thanks a lot!

Bob
  • 8,392
  • 12
  • 55
  • 96
  • thanks but you dont need to downvote because I couldn't formulate question as they did – Bob Mar 18 '13 at 17:45

2 Answers2

2

Check HttpClient from apache...

http://hc.apache.org/httpclient-3.x/

Will do anything you may need.

Thanks!

@leo.

lemil77
  • 341
  • 1
  • 8
0

I would imagine for a one-off you could use Guava's Resources.readLines(URL url, Charset charset) command. If this was something you're doing on every page (:shudder:), you'd definitely want to look into apache commons' http client and use a connection pool. Though if you have a problem set that involves having to download someone else's web page before displaying your own, you're certainly going to have scaling/performance problems.

See: http://docs.guava-libraries.googlecode.com/git/javadoc/com/google/common/io/Resources.html

drobert
  • 1,230
  • 8
  • 21