• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

import javax.servlet.*;

 
santhosh.R gowda
Ranch Hand
Posts: 296
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

As we know in every Servlet we are importing servlet package even though if we dont import this package this code will compile what is the use of using servlet package any how HTTpServlet package is used in our code for proceesing the request and response .
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See the JavaDocs. This will explain what all the classes in that package are for.
 
Vijitha Kumara
Bartender
Posts: 3908
9
Chrome Fedora Hibernate
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
santhosh.R gowda wrote:As we know in every Servlet we are importing servlet package even though if we dont import this package this code will compile


How ? Have you tried it ?
 
santhosh.R gowda
Ranch Hand
Posts: 296
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry for miss judging now i got the solution also ...in servlet package servlet Exception class has been there so in dopost if we write throws servletException it could not find the exception class we throws so it gives us the compiler error wright.
 
Vijitha Kumara
Bartender
Posts: 3908
9
Chrome Fedora Hibernate
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Pie
Posts: 15150
31
Android IntelliJ IDE Java Scala Spring
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It seems like you don't fully understand the concept of packages and what the import statement does. Have a look at Creating and Using Packages in Sun's Java Tutorials.
 
santhosh.R gowda
Ranch Hand
Posts: 296
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for all
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic