• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to restrict the container not to create the JSP implicit objects ?

 
shanthi naidu
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Recently in an interview i have been asked a question "how to disable the implicit objects in the jsp so that developer himself can create the objects whenever it is required, in other way how to restrict the container not to create the JSP implicit objects". Is it possible to restrict the container not to create the implicit objects? I would really like to know the answer for this.

Thanks & Regards,
Shanthi
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18108
52
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have not idea what these "implicit objects" are or what benefit one obtains by interfering with their normal usage.
 
Marshall Blythe
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think he's referring to the various objects like request, response, session, page, etc. that the container makes available without explicit declaration. If you're going to disable these (assuming that's even possible) then you might as well write a static HTML page instead of a JSP. Where do interviewers come up with these fringe questions?
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64724
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Stupidest. Interview question. Ever.

And no, I know of no way to do that, and cannot think of a scenario where it could possibly be appropriate or useful.
 
shanthi naidu
Ranch Hand
Posts: 39
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
:D I thought it might be possible and i only dont know the answer thinking that inverviewer knows everything :-P ... anyways thank you for the replies and clarification.. keep rocking :)
 
syed yousuf
Greenhorn
Posts: 3
Linux Netbeans IDE Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't think we can disable Implicit objects from JSP Container.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18108
52
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
syed yousuf wrote:I don't think we can disable Implicit objects from JSP Container.


I don't think we [i]should.[/b] Whatever they are supposed to be.

At any rate it's a good interview question. It shows that this shop is controlled by people who think that they are cleverer than they are and that you'll almost certainly be happier somewhere else. If for no other reason than not being there to blame when all this "clever" ends up being more trouble than it's worth.
 
James Boswell
Bartender
Posts: 1051
5
Chrome Eclipse IDE Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It sounds like one of those questions that should only be answered with another question: "Why would you want to do that?"
 
Stefan Evans
Bartender
Posts: 1692
10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The only one I think you can restrict is the creation of a session via the page directive:
ie <%@ page session="false" %>

But that is for the use case where you don't WANT a session at all. There is no point in setting this property and then creating a session yourself.
(at least not a GOOD reason I can think of)

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic