如何从 portlet 输出纯 xml?
我们正在尝试使用 Spring 3.0 mvc 框架从在 Websphere Portal Server 6.1 上运行的 286 portlet 输出纯 xml。
我们在 jsp 顶部有以下内容:
<%@ page isELIgnored="false" language="java" contentType="text/xml; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
如果 jsp 中只有 xml 元素,则浏览器中生成的页面将在 xml 周围包含门户主题 html。有人有推荐吗(如果可能的话,请提供示例片段)?
We are trying to output pure xml from a 286 portlet running on Websphere Portal Server 6.1 using the Spring 3.0 mvc framework.
We had the following at the top of the jsp:
<%@ page isELIgnored="false" language="java" contentType="text/xml; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt"%>
If we just have xml elements in a jsp, the resultant page at the browser has the portal theme html around the xml. Does anyone have a recommendation (with example snippets if at all possible) please?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
Portlet 是页面片段;标记应与周围的主题相匹配。将您的 XML 文件作为资源提供。
Portlets are page fragments; markup should match the surrounding theme. Serve your XML file as a resource.
正如上面评论中提到的,我们通过在战争中打包 servlet 找到了答案。我原来的问题没有包含重要的信息...我们试图在从遗留系统调用后输出 xml...所以它不能使用 portlet 资源 url。
We have an answer we found by packaging a servlet in the war as mentioned in the comments above. My original question didnt include an important piece of info... we were trying to output the xml after a call from a legacy system... so it cant use the portlet resource urls.