• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Paul Clapham
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Roland Mueller
  • Piet Souris
Bartenders:

getServletName() method error

 
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This is probably something simple, but I haven't been able to figure it out.
I am getting an error with the getServletName method. I am using the jsdk.jar version 2 with j2sdk1.4.1_01 compiler. My error is "cannot resolve symbol". Help.....


[ May 25, 2004: Message edited by: Linda Pan ]
 
Ranch Hand
Posts: 529
C++ Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
What is "this"? I see no class here.
 
Linda Pan
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I also have another class that extends this one. It is rather lengthy but th abstract SametimeBot class should run but it doesn't recognize the method?

I'm thinking the version of jsdk.jar has something to do with the compile errors ... hmmmm....
[ May 26, 2004: Message edited by: Linda Pan ]
 
Ranch Hand
Posts: 572
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
post the stack trace of that exception you are facing?
 
Ranch Hand
Posts: 645
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Try this
System.out.println(getServletConfig().getServletName() + ": init()");
 
Linda Pan
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Using the method getServletConfig() didn't work. Good try though.
The stack trace, I assume is the error in the CMD box? I'm still getting the "cannot resolve symbol" compile error.

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

this.getServletName() is working. The reference this refers to the current servlet.

It is not neccessary that we need to have a class to refer it with this. In this case, this refers to the current HttpServlet.

I tried the same thing using j2sdk1.4.1_01. & is working perfect.
Kavitha
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic