• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Getting tha name of the JSP page?  RSS feed

 
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello ranchers,

I want to know is there any way to get the name of the JSP page using java . I mean is there any such concept to get the name of the Jsp page as we can get the name of the java class files using java.lang.reflect.*;
getClass() method .

I have to make a log file , where any message coming from a JSP page to Tomcat console should be logged , beside the name of the JSP.


Thanx in advance .
[ May 19, 2006: Message edited by: Bear Bibeault ]
 
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
getServletConfig().getServletName()
 
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Or you could just use log4j.
 
faisal usmani
Ranch Hand
Posts: 139
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Originally posted by Paul Sturrock:
Or you could just use log4j.



Actually i am working on log4j , but dont have much knowledge about it,can you give me some resources on log4j , besides i need to delete the content of the log file(completely) after every 50 days. The application is running on Tomcat , is there any provision given in log4j for deleting contents of the file, or if there any provision to delete the old file and create a new file with the same name.


Thanx in advance.

-faisal
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


is there any provision given in log4j for deleting contents of the file, or if there any provision to delete the old file and create a new file with the same name.


Yes. You can archive log files based on date or file size. Have a look at the FAQ which should get you started.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!