Java HTTP Url连接Est。但不开放
我已连接到一个URL 使用此代码:Java HTTP Url连接Est。但不开放,java,http,jsf,url,httpconnection,Java,Http,Jsf,Url,Httpconnection,我已连接到一个URL 使用此代码: public void ExecURL() { try { URL myURL = new URL("http://helpdesk.wi-tribe.net.pk:8080/secure/CreateIssueDetails!init.jspa?pid="+projID+"&issuetype="+issueID+"&"+customerField+"="+searchID+"&customfield_1001
public void ExecURL()
{
try {
URL myURL = new URL("http://helpdesk.wi-tribe.net.pk:8080/secure/CreateIssueDetails!init.jspa?pid="+projID+"&issuetype="+issueID+"&"+customerField+"="+searchID+"&customfield_10014="+searchMAC+"&customfield_10016="+custMobile+"&reporter="+emailID);
URLConnection myURLConnection = myURL.openConnection();
myURLConnection.connect();
System.out.println("connection est: " + myURL.toString() );
}
catch (MalformedURLException e) {
// new URL() failed
// ...
} catch (IOException e) {
// openConnection() failed
// ...
}
}
我通过以下方式呼叫此连接:
现在,我知道已经建立了连接,但我的目标是在Mozilla或Chrome的新窗口中打开此URL,使用。无论action方法返回什么字符串,commandLink标记都将用作导航目标。如果操作方法返回null或void,将重新加载当前页面
因此,为了让JSF转到ExecURL中内置的URL,您需要返回它。代码需要如下所示:
public String ExecURL() {
return "http://helpdesk.wi-tribe.net.pk:8080/secure/CreateIssueDetails!init.jspa?pid=" + projID + "&issuetype=" + issueID + "&" + customerField + "=" + searchID + "&customfield_10014=" + searchMAC + "&customfield_10016=" + custMobile + "&reporter=" + emailID;
}
我仍然无法找到URL。单击呈现的链接后会发生什么?