This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 73402

Summary: Obtaining servlet path from framework provider
Product: javaee Reporter: Petr Pisl <ppisl>
Component: CodeAssignee: Petr Pisl <ppisl>
Status: RESOLVED FIXED    
Severity: blocker CC: pjiricka
Priority: P2 Keywords: API_REVIEW_FAST
Version: 5.x   
Hardware: All   
OS: All   
Issue Type: ENHANCEMENT Exception Reporter:
Bug Depends on:    
Bug Blocks: 73003    

Description Petr Pisl 2006-03-08 22:19:47 UTC
I'm asking for a review for  compatible API change. The target is 5.5

Every jsp can be run directly through the Run File action. In the web project
this action call browser with the url, which is composed in this way:
http://targetserver:serverport/contextpath/servletpath?query. Generally the
serlvet path is relative path between document root of the web application and
the jsp file. But the frameworks can influence the servlet path and change the
servlet path in the way that is needed by the framework.

I proposed to add  method to the FrameworkProvider, which returns the
servletPath for the given FileObject (usually jsp file). The method can return
null and then is used the general approach for obtaining servlet path. The
method will have no impact on framework providers, which are already implemented.

/**
     * Returns the servlet path of the request's URL that calls the web component.
     * This path starts with a "/" character and includes either the servlet name
     * or a path to the servlet/jsp. Includes as well the mapping, but does not
include
     * any extra path information or a query string.
     * The method can return null. Then common servlet path is used.
     * <br/>
     * JSF Example: There is index.jsp directly in the document base. Normally
the URL
     * for accessing this page in browser should be
http://server:port/contextpath/index.jsp.
     * The servletpath is /index.jsp.
     * Because the index.jsp includes jsf tags, should be called with
appropriate JSF servlet
     * mapping. If the mapping is /faces/*, then the right url is
     * http://server:port/contextpath/faces/index.jsp and this method should
returns /faces/index.jsp.
     * @param fo arbitrary FileObject. Should be a jsp file.
     * @return A string that contains the servletPath including mapping as well.
Can return null.
     *
     */
    public String getServletPath(FileObject file){
        return null;
    }
Comment 1 Pavel Buzek 2006-03-09 14:29:54 UTC
This looks good to me. Thanks.
Comment 2 Petr Pisl 2006-03-27 15:31:32 UTC
If there are no comments, I'm going commit the changes into release55 branch.
Comment 3 Petr Jiricka 2006-04-03 12:50:02 UTC
Isn't this issue completed?
Comment 4 Petr Pisl 2006-04-03 13:32:02 UTC
Commited to trunk on Thursday.