my dog learned polymorphism
The moose likes JSP and the fly likes compilation error Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "compilation error" Watch "compilation error" New topic

compilation error

Ambika Jain
Ranch Hand

Joined: Jan 27, 2005
Posts: 48

I am getting the following error in my jsp, for the following piece of code.
Also, using application.getInitParameter("admim") works fine. But I want
to know the meaning of this error.

String admin=getServletContext.getInitParameter("admim");

error.jsp:12:33: The qualifier of this name is a package, which cannot contain methods.
String admin=getServletContext.getInitParameter("admim");

Ambika Jain
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63838

Clue: what is getServletContext? A variable? A method?

[Asking smart questions] [About Bear] [Books by Bear]
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874

Its a method. I hope you knew it but forgot to put "()" after the name. If not read the docs.

Vijay Sharma
Ranch Hand

Joined: Feb 02, 2005
Posts: 32
Hi Amba,
I think getServletContext() is a method.So,if u write
It should work fine.Just try this out.And if it works.Let me know also.

Vijay Sharma
I agree. Here's the link:
subject: compilation error
It's not a secret anymore!