Ist es möglich, für eine Website, die URL beginnend mit "http://" über das HTTPS-Protokoll

Ich habe eine Website, deren URL beginnt mit "http://", aber das ist mir eine Ausnahme mit der Meldung - nicht Unterstützte Protokoll: https. Ist es möglich, dass die Website über das HTTPS-Protokoll noch die URL beginnend mit "http://" und nicht "https://".

public ActionForward executeAction(ActionMapping mapping, ActionForm form,
              HttpServletRequest request, HttpServletResponse response)
      throws Exception {

    ActionForward forward = mapping.findForward(Constants.SUCCESS);
    String link = "http://abc.fgh.jkl.mno";
    URL thisURL;
    HttpURLConnection conn = null;
    try {
        thisURL = new URL(link);
        conn = (HttpURLConnection) thisURL.openConnection();
        System.out.println(conn.getResponseCode());
        System.out.println(conn.getResponseMessage());
        } catch (Exception ex) {
        ex.printStackTrace();
    }
    return forward;
}       

Stack-trace

java.net.ProtocolException: Unsupported protocol: https'
    at weblogic.net.http.HttpClient.openServer(HttpClient.java:342)
    at weblogic.net.http.HttpClient.New(HttpClient.java:238)
    at weblogic.net.http.HttpURLConnection.connect(HttpURLConnection.java:172)
    at weblogic.net.http.HttpURLConnection.followRedirect(HttpURLConnection.java:643)
    at weblogic.net.http.HttpURLConnection.getInputStream(HttpURLConnection.java:422)
    at           weblogic.net.http.SOAPHttpURLConnection.getInputStream(SOAPHttpURLConnection.java:36)
    at weblogic.net.http.HttpURLConnection.getResponseCode(HttpURLConnection.java:947)
    at com.cingular.cscape.da.struts.action.thisAction.executeAction(thisAction.java:56)
    at com.cingular.cscape.da.struts.action.BaseAction.execute(BaseAction.java:300)
    at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:421)
    at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:226)
    at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1164)
    at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:397)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
    at org.extremecomponents.table.filter.AbstractExportFilter.doFilter(AbstractExportFilter.java:53)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3496)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(Unknown Source)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2180)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2086)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)                  
  • Die Seite selbst geladen werden konnte über http aber verlangen Ressourcen (Skripte, Bilder, etc.) über https, die möglicherweise geben Sie auch diesen Fehler.
  • Wie kann ich bekommen, um diesen Fehler - Sollte ich eine HTTPSURLCONNECTION statt . Derzeit bin ich mit HTTPURLCONNECTION.
  • Ich weiß wirklich nicht, was Sie tun, versuchen, zu erreichen, etc. Die Frage ist sehr leicht auf die tatsächlichen details.
  • Ich werde versuchen, die http-status-code von der Website mit dem folgenden code - String link = "abc.def.ghi.jkl"; URL thisURL; HttpURLConnection conn = null; thisURL = new URL(link); conn = (HttpURLConnection) thisURL.openConnection(); System.aus.println(conn.getResponseCode()); // erste Ausnahme in diesem line-System.aus.println(conn.getResponseMessage()); Können Sie bitte helfen?
  • sollten Sie dies zu Ihrer Frage, wie zusätzliche info, viel einfacher zu Lesen
  • Ich habe es auf meine Frage. Danke.
  • Es könnte sein, dass eine Umleitung auch. Schlage vor, Sie verwenden Sie fiddler, um festzustellen, was eigentlich Los ist mit der Verbindung.
  • Ich weiß nicht viel über fiddler. Können Sie bitte erläutern?

Schreibe einen Kommentar