geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Han Hong Fang (JIRA)" <>
Subject [jira] Updated: (GERONIMO-5405) In servlet, getServletConfig().getServletContext().getRealPath("/") return null
Date Tue, 20 Jul 2010 09:56:50 GMT


Han Hong Fang updated GERONIMO-5405:

    Attachment: Geronimo-5405.patch

Patch for this problem is uploaded. Please help to review, thanks!

Here is the implementation details.  According to servlet 3.0 spec quoted below, in Geronimo,

- return the unpacked location for the resources located in the META-INF/resources directory
of the jar file
- for all other situation it returns null.

If same resources exist in different jar files, getRealPath() return the location once resource
with specified name is found in one of the jar file.


Servlet 3.0 Spec quotation:

"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

> In servlet, getServletConfig().getServletContext().getRealPath("/") return null
> -------------------------------------------------------------------------------
>                 Key: GERONIMO-5405
>                 URL:
>             Project: Geronimo
>          Issue Type: Bug
>      Security Level: public(Regular issues) 
>    Affects Versions: 3.0-M1, 3.0
>            Reporter: Forrest Xia
>            Assignee: Han Hong Fang
>         Attachments: Geronimo-5405.patch
> In the OSGi environment, no expanded web app directories in the geronimo repository,
so we need a way to get the resource within jar/war/ear/car.
> This bug causes daytrader app cannot initialize the database tables from the enclosed
sql file.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message