此 portlet 无法访问路径 /WEB-INF/jsp/newportlet/view.jsp
尝试将 portlet JSP 放入 WEB-INF 文件夹中并遇到错误
Path /WEB-INF/jsp/newportlet/view.jsp is not accessible by this portlet
为什么会出现此错误?是否可以允许portlet访问WEB-INF?除了将Portlet JSP 放入WEB-INF 中之外,是否可以直接通过Web 浏览器来关闭对它们的访问?
更新 1
我刚刚通过向导创建了一个新的 portlet。没有写任何代码,只是JSP位置设置。该位置适用于向导,因为它将 JSP 放在那里。该位置在 portlet.xml
中反映为
标记的以下子标记:
<init-param>
<name>view-jsp</name>
<value>/WEB-INF/jsp/newportlet/view.jsp</value>
</init-param>
类的代码为空:
public class NewPortlet extends MVCPortlet {
}
Have tried to put portlet JSPs inside WEB-INF folder and met error
Path /WEB-INF/jsp/newportlet/view.jsp is not accessible by this portlet
Why this error occurs? Is it possible to allow portlet to access WEB-INF? Is it possible to close accessing portlet JSPs from web browser directly in the way other than putting them inside WEB-INF?
UPDATE 1
I have just created a new portlet by wizard. No code written, just JSP location set. The location worked for wizard, because it put JSP there. The location is reflected in portlet.xml
as a following subtag of <portlet>
tag:
<init-param>
<name>view-jsp</name>
<value>/WEB-INF/jsp/newportlet/view.jsp</value>
</init-param>
The code of the class is empty:
public class NewPortlet extends MVCPortlet {
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
来自此主题
另请查看 MVCPortlet.checkJSPPath(String) 方法。我相信你可以覆盖它,所以它不会抛出异常。
From this topic
Also have a look at the source code of MVCPortlet.checkJSPPath(String) method. I believe you can override it, so it does not throw an exception.