How can I get the page title information from a URL in Java?
<p>So I'm coding in JSP language but I need to do this in a java servlet. I have a way inside the java program (servlet) to get a URL entered by a user. I stored the URL inside a string. Now all that is left to do is to get the page title information from the URL or the website. Essentially I want to get the title tag inside the html code from the URL. I have never done this before so I was wondering if anyone could give me any pointers on how to do this.</p>

<p>For example lets say i want to get the page title from <a href="http://www.computerhope.com/issues/ch000746.htm" rel="nofollow">http://www.computerhope.com/issues/ch000746.htm</a> </p>

<p>When I look at the html code it shows it's "How to view the HTML source code of a web page" as shown in the html code. </p>

<p>&lt;title>How to view the HTML source code of a web page &lt;/title></p>

<p>So how would I be able to access that inside a java program?</p>