referencing this in a JSP page

J

Jon Smith

Can you reference "this" in a JSP page. I am using log4j to log errors but
this wants the class name so I was looking to user this.getClass().getName()
to do this. If there another way?

Many Thanks

Mike
 
T

Tor Iver Wilhelmsen

Jon Smith said:
Can you reference "this" in a JSP page.

Yes, but it's not that useful. "this" will be an instance of the
autogenerated servlet class the JSP compiler produces the source for.
 
R

Ryan Stewart

Jon Smith said:
Can you reference "this" in a JSP page. I am using log4j to log errors but
this wants the class name so I was looking to user this.getClass().getName()
to do this. If there another way?
It doesn't "want" anything. Log4J uses the idea of named loggers. You tell it
which logger you want to get by name. Typically people use class names for this
by passing the Class object (not the class name), but you can use anything you
want.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,792
Messages
2,569,639
Members
45,353
Latest member
RogerDoger

Latest Threads

Top