How can I display external HTML contents in jsp page? I have tried with iFrame, Object and embed none of them are working in Microsoft Edge.

Manuraj Jayachandra 0 Reputation points
2023-04-19T01:03:43.9366667+00:00

I have tried with below code to display HTML contents (table and values). None of them are working in Microsoft Edge browser and my browser Version is 112.0.1722.48 (Official build) (64-bit). But this is working fine in Firefox browser.

  1. <iframe id="qprIframe" src="some url" style="width: 100%; height:150px" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="yes"></iframe>
  2. <div> <iframe id="qprIframe" src="some url" style="width: 100%; height:150px" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="yes"></iframe> </div>
  3. <object data="some url" style="width: 100%; height:150px" type="text/html">Alternative Content</object>
  4. <object data="<c:out value="some url" width="600" height="400"> <embed src="some url" width="600" height="400"> </embed> Error: Embedded data could not be displayed. </object> All the time I am getting below error message Unauthorised Access / Session Timed Out. Please help me to resolve this issue. Let me know if there is any alternative element can be used to get the html contents.
Microsoft Edge | Microsoft Edge development
{count} votes

1 answer

Sort by: Most helpful
  1. Manuraj Jayachandra 0 Reputation points
    2023-04-19T21:54:53.2+00:00

    Hi,Generated result.pdf See below code and I have also tried with embed and Object elements. Getting the same issue, Unauthorised Access / Session Timed Out error in edge. But this perfectly works fine in Firefox browser. Here src is pointing to https://***.nz/EVE/gateway-datasnapshot-service/queryQpr I have attached output from both the browsers.

    <c:choose>    
    <c:when test="${!empty requestScope.viewQprListForm}"> 
           
    <iframe id="qprIframe" src="<c:out value="${viewQprListForm.qprListUrl}" />" style="width: 100%; height:150px" marginwidth="0" marginheight="0" hspace="0" vspace="0" frameborder="0" scrolling="yes">
    
    </iframe>    
    </c:when>
    </c:choose>
    

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.