java - how to read file from resource folder in eclipse -


i'm trying read xml file resource folder inside webcontent in eclipse project. problem i'm unable read file resources folder working fine giving path outside(ie,e:/new/test.xml).

file file = new file(request.getsession().getservletcontext().getcontextpath()+"/resources/new/test.xml"); 

can please me solve issue..thanks in advance.

you can read content classpath follows

getclass().getresourceasstream("/new/test.xml"); 

in eclipse webcontent not in classpath, default thing in classpath /src/test see what's in classpath go project-settings -> java build path, add folders on source tab, folders in classpath.


Comments

Popular posts from this blog

php - Extract Text from HTTP referer -

Receive udp packets in android gstreamer -

authentication - ASP.NET Core 1.0. Bearer Token, cannot access custom claims -