Hi,
I want to get the XML output from a URL and transfer to a HTML page.
When I tyied my http web app, is OK.
But, when I tried my https web app, no rusult, only the message showed in the log file:
###########################
Error occurs here:
https://myTestSvr/myApp/servlet/myDocList?myAccountNo=321456&myTeamNo=2&myAccessCode=A Any ideas?
Thanks in advance.
Here are some lines from my
servlet:
//********** Step 1: set property ***********************//
try
{
// set the default security protocol (shipped with JSSE1.0.2)
System.setProperty("java.protocol.handler.pkgs", "com.sun.net.ssl.internal.www.protocol");
// add the default security provider (again, in JSSE1.0.2)
java.security.Security.addProvider(new com.sun.net.ssl.internal.ssl.Provider());
}
catch (Exception e)
{
return;
}
//********** Step 3: do transform ***********************//
try
{
TransformerFactory tFactory = TransformerFactory.newInstance();
String url = "https://myTestSvr/myApp/servlet/myDocList?" +
"myAccountNo=" + myAccountNo +
"&myTeamNo=" + myTeamNo +
"&myAccessCode=" + myAccessCode ;
Source xmlSource = new StreamSource(new URL(url).openStream());
Source xslSource = new StreamSource (new FileInputStream ("D:\\myDoc.xsl"));
Transformer transformer = tFactory.newTransformer(xslSource);
transformer.transform(xmlSource, new StreamResult(out));
}
catch (Exception e)
{
System.out.println("###########################");
System.out.println("Error occurs here:");
System.out.println(e.getMessage());
return;
}