Before you read/write from/to a URL, you need to have a working URL that you can access. You can read content of any URL that is publicly available on the Internet. For this discussion, I will assume that you are familiar with Java Server Pages (JSP) and you have access to a web server where you can deploy a JSP page. If you do not know JSP, you can just replace the URL used in examples of this section with any publicly available URL; for example, the URL http://www.yahoo.com will work fine, and you should be able to run all examples. Writing data to a URL is a little different. It will be easier if you can run your JSP to see how writing to a URL works. I assume that you have deployed a web application on a web server and it has a web page ...
Get Beginning Java 8 APIs, Extensions and Libraries Swing, JavaFX, JavaScript, JDBC and Network Programming APIs now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.