我已经从wicket 1迁移了我的应用程序。X到8号门柱。现在面临在iframe上显示PDF的错误。在iframe上显示为空白。
我试图在页面加载时在HTML的iframe标签中显示PDF,但它显示为空白。
共享path下面的详细代码:https://github.com/smartuadk/Shared_Repo_StackOverflow/tree/main/PDF_Preview
请在Spring安全模块xml文件中添加下面的http security header标签,以允许Spring security在Spring应用程序中显示HTML iframe:
<security:http use-expressions="false">
<security:headers>
<security:frame-options disabled="true"></security:frame-options>
</security:headers>
</security:http>
这个解决方案对我有用,现在我的应用程序能够显示iFrame没有任何错误,并且能够在iFrame中加载PDF文件。