Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

parsing url content into string  RSS feed

 
Marko Debac
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am trying to do the same thing what I am doing with jsp import tag


within some class what I can invoke frome servlet: something like this

But something is wrong?
 
Mirko Bonasorte
Ranch Hand
Posts: 244
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
c ut also formats the result for html output (by default)
[ May 30, 2007: Message edited by: Mirko Bonasorte ]
 
Marko Debac
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, but, is there some way to take web page content source code, and put it into String in pure java, i.e. not using jstl import?
 
Mirko Bonasorte
Ranch Hand
Posts: 244
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It would be a nice idea to watch inside the jakarta jstl implementation, class ImportSupport.
It uses URLConnection got from URL class.
 
Marko Debac
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I can not find the solution.
Is there any other option, maybe some simple function where you enter url and she gives you out html source like String?

String abc = function(url); ???
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66200
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You might also want to check out the HttpClient project. it makes such things very very easy.
 
Marko Debac
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Bear, plese help me a little bit;

I have downloaded zip file commons-httpclient-3.1-rc1, extracted them, and input commons-httpclient-3.1-rc1.jar into project.

my code is:



and I am getting error



Am I closer?
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66200
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HttpClient apparently requires the Commons Logging jar to be in the classpath.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!