Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Mandatory Packages in JSP File

 
ramya ray
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

Is it mandatory to import javax.servlet.* and javax.servlet.http.* packages in a jsp file or they are imported by default.

Please clarify.

Thanks,
 
Sayak Banerjee
Ranch Hand
Posts: 292
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You don't import them.
 
Prabhu Venkatachalam
Ranch Hand
Posts: 502
Java jQuery Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
why do you want to import it? Are you planning to use any classes from these packages?
 
ramya ray
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, i want to use some classes from these packages.

Part of my question is - are these packages imported by default and i can use their classes without having import statements for the same.

Thanks,
 
Sayak Banerjee
Ranch Hand
Posts: 292
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You still don't have import them...but that was so easy to try it...wasn't it?
 
Sreeraj G Harilal
Ranch Hand
Posts: 310
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
why do you want to import it? Are you planning to use any classes from these packages?


Give respect and take respect.
 
ramya ray
Ranch Hand
Posts: 101
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you all clarifying my doubt. I got some write up also which says -

We do not have to import these packages explicitly.
java.lang.*, javax.servlet.*, javax.servlet.jsp.*, and javax.
servlet.http.* packages.

Thanks,
 
Renu Radhika
Ranch Hand
Posts: 243
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Attribute name :import

Description A comma-separated list of Java classes and packages
that we want to use in the JSP page.

Default Value/s

java.lang.*;
javax.servlet.*;
javax.servlet.jsp.*;
javax.servlet.http.*;

This is from study kit
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic