Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
li java
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
why?
 
eammon bannon
Ranch Hand
Posts: 140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic