Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to get resource from server using doGet

 
kamalakannan kamal
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I just started learning servlet. Can any of you explain me how to get resource from server using doGet method.... Also please explain about <mime-mapping> in web.xml....

Thanks,
G. Kamal
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It depends on what you mean by "get resource".

Also, if you're just starting out, you probably don't need to worry about mime-mappings yet.
 
kamalakannan kamal
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ben,

Thanks for your reply. Resource here i mean any file say xml, pdf, anything...
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13064
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I understand your question correctly, Java provides classes in the java.net package which let you create a URL addressing a server resource, create a request and handle the returned response data.

See for example java.net.URLConnection and HttpURLConnection.

Bill
 
kamalakannan kamal
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks williams
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic