Win a copy of Head First Agile this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

to find the exact path  RSS feed

 
Rajesh Veluchamy
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i want to find the value of string variable "ct"
for that i want to know, where will be the "properties" class
since i have more that some 25 folders and some 200 files in
this big project folder( i am giving you a part of small project)
how to find?



-Rajesh.V
Software Consultant (IT)
 
Rajesh Veluchamy
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
really i want to assign some thing to "ct" variable, but not here
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Agreed this code should not be in the JSP.

There are a number of options for finding static files in web applications.

The most popular are to either use the ServletContext methods getRealPath or (preferably) getResourceAsStream(), or to use the ClassLoader to load from the application classpath, again preferably as a Stream.

The benefit of loading as a Stream is that it also works when the application is packaged in a JAR, WAR or EAR file, and you can pass the Stream to the properties.load() method to get the data for you.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!