Read from a URL

hello, I'm trying to get the text of this URL in Java:
https://www.lcsd.gov.hk/en/forms_lcs71_online.php?act_code=40216827 Then I wrote the code like this:
try{
URL url = new URL("https://www.lcsd.gov.hk/en/forms_lcs71_online.php?act_code=40216827");
}catch ... It failed as URL class cannot recognize the filename The following variables of the URL are as follows:
------------------------------------------------------------------------
protocol = https
authority = www.lcsd.gov.hk
host = www.lcsd.gov.hk
port = -1
path = b5/forms_lcs71_online.php
query = act_code=40216827
filename = b5/forms_lcs71_online.php?act_code=40216827
ref = null
-------------------------------------------------------------------------
Could anyone suggest me a way to read a URL that is not ended with file extensions (.html, .txt....)? Thank you.

I clicked the URL and Firefox pointed out the self-signed certificate -- i.e., the https installation is suspect. I don't know if that's what's giving you problems, or if you just haven't taken the necessary steps to handle https in general. See here for details about that.

In any case, it has nothing to do with "recognizing the filename" -- the format of the part of the URL after the server name is irrelevant. It's up to the server to understand it, not your code.

Yes, the URL I need to get is a web form provided by the government for citizens to apply courses.
The form needs authentication for security. And, an exception is caught.

In the article you give to me, Java Tip 96: Use HTTPS in your Java client code(Page 2),
"What about applets? Performing HTTPS-based communication from within an applet seems like a natural extension of scenarios described above. In reality, it's even easier in most cases. In 4.0 and later versions of Netscape Navigator and Internet Explorer, HTTPS is enabled by default for their respective VMs. ... simply specify HTTPS as your protocol when creating an instance of the URL class:
URL url = new URL("https://[your server]");"Does it mean if I write an Applet, instead of Java Application, I need not worry about https?