Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Getting tha name of the JSP page?

 
faisal usmani
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 ]
 
Rashid Mayes
Ranch Hand
Posts: 160
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
getServletConfig().getServletName()
 
Paul Sturrock
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic