Skip to main content

[JIRA] Commented: (SERVLET_SPEC-11) Clarification required for ServletContext.getRealPath and HttpServletRequest.getPathTranslated

  • From: "Rajiv Mordani (JIRA)" <jira-no-reply@...>
  • To: issues@...
  • Subject: [JIRA] Commented: (SERVLET_SPEC-11) Clarification required for ServletContext.getRealPath and HttpServletRequest.getPathTranslated
  • Date: Thu, 28 Jun 2012 21:05:55 +0000 (GMT+00:00)
  • Auto-submitted: auto-generated


    [ 
http://java.net/jira/browse/SERVLET_SPEC-11?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=342176#action_342176
 ] 

Rajiv Mordani commented on SERVLET_SPEC-11:
-------------------------------------------

In section 3.6 of the spec we clearly say 

In situations where the servlet container cannot determine a valid file path 
for these methods, such as when the Web application is executed from an 
archive, on a remote file system not accessible locally, or in a database, 
these methods must return null. Resources inside the META-INF/resources 
directory of JAR file must be considered only if the container has unpacked 
them from their containing JAR file when a call to getRealPath() is made, and 
in this case MUST return the unpacked location.

and the javadocs also says along the same lines. What do you think will make 
it clearer?

> Clarification required for ServletContext.getRealPath and 
> HttpServletRequest.getPathTranslated
> ----------------------------------------------------------------------------------------------
>
>                 Key: SERVLET_SPEC-11
>                 URL: http://java.net/jira/browse/SERVLET_SPEC-11
>             Project: servlet-spec
>          Issue Type: Bug
>            Reporter: markt_asf
>            Assignee: Rajiv Mordani
>
> There appear to be different interpretations of the required behaviour of 
> ServletContext.getRealPath(java.lang.String path) and 
> HttpServletRequest.getPathTranslated() if the virtual path can be mapped to 
> a physical path but the physical path does not exist.
> My reading of the specification and the Javadoc is that the physical path 
> does not have to exist, just that the mapping has to be possible. However, 
> I can see how someone else could read the specification as requiring the 
> physical path to exist and null to be returned if it does not.
> This should be clarified for Servlet 3.1 and ideally the clarification 
> included in any subsequent maintenance releases of the earlier 
> specification versions.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://java.net/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


[JIRA] Commented: (SERVLET_SPEC-11) Clarification required for ServletContext.getRealPath and HttpServletRequest.getPathTranslated

Rajiv Mordani (JIRA) 06/28/2012

<Possible follow-up(s)>

[JIRA] Commented: (SERVLET_SPEC-11) Clarification required for ServletContext.getRealPath and HttpServletRequest.getPathTranslated

markt_asf (JIRA) 06/28/2012

[JIRA] Commented: (SERVLET_SPEC-11) Clarification required for ServletContext.getRealPath and HttpServletRequest.getPathTranslated

Rajiv Mordani (JIRA) 06/29/2012
 
 
Close
loading
Please Confirm
Close