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 - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -