File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Beginning Java and the fly likes why?help me! : the import javax.servlet is never used Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "why?help me! : the import javax.servlet is never used " Watch "why?help me! : the import javax.servlet is never used " New topic

why?help me! : the import javax.servlet is never used

li java

Joined: Mar 26, 2004
Posts: 1
package packagename;
import javax.servlet.*;
import javax.servlet.http.*;
public class hello {
public void test(){
String ls="" ;
ls = "dxf";
System.out.println(ls+": is "+ls);
then save the class,general error:
the import javax.servlet is never used
the import javax.servlet.http is never used
eammon bannon
Ranch Hand

Joined: Mar 16, 2004
Posts: 140
These won't be errors, but warnings. There is nothing in your code which won't make it compile or run, but you are importing the packages javax.servlet and javax.servlet.http and not using any classes from either package, hence the warning. Just remove the import statements.
Dirk Schreckmann

Joined: Dec 10, 2001
Posts: 7023
li java,
Welcome to JavaRanch!
We ain't got many rules 'round these parts, but we do got one. Please change your display name to comply with The JavaRanch Naming Policy.
Around a website focused on Java programming, we aren't too likely to believe that anybody's name is Java.
Thanks Pardner! Hope to see you 'round the Ranch!

[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
subject: why?help me! : the import javax.servlet is never used
Similar Threads
SingleThreadModel Servlet with class variable
Why should we import javax.servlet.http.* when we already imported javax.servlet.*?
import servlet packages
Executing System Commands
invoking exe from java