• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

init parameters for jsp

 
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello friends,

I have doubt which i have already posted in sun.java forum....but did not get any help from there. My doubt is, JSPs are ultimately servlets,....so just like servlets, can init parameters be defined for jsps also in web.xml ?
Please let me know the syntax also.

Thanks and Regards
Omkar Patkar
 
Sheriff
Posts: 67756
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by omkar patkar:
JSPs are ultimately servlets

That is an implementation detail upon which your code should not erly.

Moreover, because modern JSPs should contain no Java code, of what use would such init parameters be?
 
omkar patkar
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Bear, but my question was just for knowledge point of view and from point of view of commerical usuage of jsp

When will a code like be be useful in jsps then ?

Can their be any situation where i can use this facility for jsp ?

Thanks and Regards
Omkar Patkar
 
Bear Bibeault
Sheriff
Posts: 67756
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by omkar patkar:
Can their be any situation where i can use this facility for jsp ?


Again, not if you want to follow accepted best practices which dictate no Java code in a JSP.

The EL -- which should be used in modern JSPs -- can access context parameters via its built-in variables.
 
omkar patkar
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok ... so init parameters can be accessed, whether its EL or java code...but then how are init parameters set for jsp ....any sample code would be of great help for me to understand how init parameters can be set for jsp, if they can be accessed using EL.

Thanks and Regards
Omkar Patkar.
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This was discussed at length in this thread.
 
Bear Bibeault
Sheriff
Posts: 67756
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by omkar patkar:
Ok ... so init parameters can be accessed, whether its EL or java code..

I did not say that.

I said context parameters can be accessed.
 
omkar patkar
Ranch Hand
Posts: 231
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ohh Sorry and Thank you also!.... i got the necessary information in the thread specified.

Thanks and Regards
Omkar Patkar
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic