File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes why is getInitParameter() fetched only when i use url pattern? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "why is getInitParameter() fetched only when i use url pattern?" Watch "why is getInitParameter() fetched only when i use url pattern?" New topic
Author

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

Sourabh Bawage
Ranch Hand

Joined: Sep 03, 2013
Posts: 33

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??


SCJP
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10046
    
163

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?


[My Blog] [JavaRanch Journal]
Sourabh Bawage
Ranch Hand

Joined: Sep 03, 2013
Posts: 33


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....
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: why is getInitParameter() fetched only when i use url pattern?