cancel
Showing results for 
Search instead for 
Did you mean: 

Bug on getResourcePaths implementation for ServletContext class.

Former Member
0 Kudos

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.

Accepted Solutions (0)

Answers (1)

Answers (1)

detlev_beutner
Active Contributor
0 Kudos

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

Former Member
0 Kudos

Thank You Detlev,

i think there are many bug in the getResourceXXXX methods.

See my other post too.

I hope SAP will be fix it ASAP.

I want migrate my application from JBoss, Websphere and Weblogic to SAP Was, but will be impossible... (or impossible without change my code to bypass SAP bug!)

detlev_beutner
Active Contributor
0 Kudos

Hi Roberto,

I had some struggle to make clear how hard this violation is, but in the end: "The fix will be included in SP12 of J2EE 6.40".

I hope this solves (knick-knack) your problem,

Detlev