• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

why is getInitParameter() fetched only when i use url pattern?

 
Ranch Hand
Posts: 33
Eclipse IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
web.xml


index.jsp



http://localhost:6060/SCWCDApp/index.jsp

Output:



http://localhost:6060/SCWCDApp/myJsp

Output:


I dint understand why the init parameters were not fetched when i directly called the JSP??

 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Sourabh Bawage wrote:web.xml





As you see, it's a servlet specific initialization param. So unless that servlet gets invoked that initialization param isn't relevant. Directly calling the JSP will not go through that servlet.

Are you sure you wanted it to be a servlet specific initialization param and not a web application level context param?

 
Sourabh Bawage
Ranch Hand
Posts: 33
Eclipse IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


As you see, it's a servlet specific initialization param. So unless that servlet gets invoked that initialization param isn't relevant. Directly calling the JSP will not go through that servlet.



Hi Jaikiran,
I believe that 1 servlet is created by the container for the JSP, so whenever i call this JSP that particular servlet will be invoked......
so even if i call using the file name (index.jsp) or the url pattern, the SAME servlet will be invoked...

I dont get what difference is it making internally....??
Kindly help....
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!