• 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
  • Devaka Cooray
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Jeanne Boyarsky
  • Tim Cooke
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
Bartenders:

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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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....
 
What's gotten into you? Could it be this tiny ad?
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic