• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Sourabh Bawage
Ranch Hand
Posts: 33
Eclipse IDE Java Tomcat Server
  • 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??

 
Jaikiran Pai
Marshal
Pie
Posts: 10447
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 Java Tomcat Server
  • 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