Skip to Content
author's profile photo Former Member
Former Member

Bug on getResourcePaths implementation for ServletContext class.

The getResoucePaths return incorrect data.

From JavaDoc you can read:

public java.util.Set getResourcePaths(java.lang.String path)

Returns a directory-like listing of all the paths to resources within the web application whose longest sub-path matches the supplied path argument.

Paths indicating subdirectory paths end with a '/'.

The returned paths are all relative to the root of the web application and have a leading '/'.

For example, for a web application containing

/welcome.html

/catalog/index.html

/catalog/products.html

/catalog/offers/books.html

/catalog/offers/music.html

/customer/login.jsp

/WEB-INF/web.xml

/WEB-INF/classes/com.acme.OrderServlet.class,

getResourcePaths("/catalog/") returns {"/catalog/index.html", "/catalog/products.html", "/catalog/offers/"}.

Instead with SAP NetWeaver Sneak Preview 6.40 SR1 (6.40 PatchLevel 87289.311)

getResourcePaths("/catalog/") returns {"index.html", "products.html", "offers/"}.

and this is not correct.

You can test it with this simple JSP

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">

<HTML>

<BODY>

<%

java.util.Set vSet = getServletContext().getResourcePaths("/WEB-INF/");

Object[] vArr = vSet.toArray();

for(int i = 0; i < vArr.length; i++)

{

out.println(vArr<i> + "<br>");

}

%>

</BODY>

</HTML>

i don't know if there are other place where report this bug.

I cannot access to the service.sdn.com site because i'm not a customer or business partner.

Add a comment
10|10000 characters needed characters exceeded

Related questions

1 Answer

  • Posted on Feb 15, 2005 at 11:36 PM

    Hi Roberto,

    this is a serious violation of the servlet specification. I also checked this for 6.20 (even if not officially servlet 2.3), same result.

    I have opened an OSS message (002007974700000619382005).

    Hope it'll help,

    Detlev

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.