PortletContextResource.java 文件源码

java
阅读 19 收藏 0 点赞 0 评论 0

项目:spring4-understanding 作者:
/**
 * Create a new PortletContextResource.
 * <p>The Portlet spec requires that resource paths start with a slash,
 * even if many containers accept paths without leading slash too.
 * Consequently, the given path will be prepended with a slash if it
 * doesn't already start with one.
 * @param portletContext the PortletContext to load from
 * @param path the path of the resource
 */
public PortletContextResource(PortletContext portletContext, String path) {
    // check PortletContext
    Assert.notNull(portletContext, "Cannot resolve PortletContextResource without PortletContext");
    this.portletContext = portletContext;

    // check path
    Assert.notNull(path, "Path is required");
    String pathToUse = StringUtils.cleanPath(path);
    if (!pathToUse.startsWith("/")) {
        pathToUse = "/" + pathToUse;
    }
    this.path = pathToUse;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号