| Author |
Head First Book : why are we using this ? The code works without it.
|
Rahul Sudip Bose
Ranch Hand
Joined: Jan 21, 2011
Posts: 637
|
|
I replace the below stuff with <web-app> and all my code works. Why should i add all the lines as shown in the book ?
|
SCJP 6. Learning more now.
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56204
|
|
Because without it, the container doesn't know much about what level of servlet support you intend to use and will use defaults that may not be what you intend. Just because it hasn't kicked you in the ass yet, doesn't mean it won't at some point.
Just because "something works" is no excuse for sloppiness.
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Rahul Sudip Bose
Ranch Hand
Joined: Jan 21, 2011
Posts: 637
|
|
Bear Bibeault wrote:
Because without it, the container doesn't know much about what level of servlet support you intend to use and will use defaults that may not be what you intend.
What is meant by "servlet support" (have not come across it yet) ? What is that whole thing called - so that i can put that word in google and read more about it ?
Bear Bibeault wrote:
Just because it hasn't kicked you in the ass yet, doesn't mean it won't at some point.
Hope it never happens. Can you give me an (real-world) example where it may cause problems ?
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56204
|
|
For example, if you incorrectly declare the deployment descriptor to use Servlets 2.3, the EL is disabled by default in JSPs.
And again, even if "things work", it's best to be explicit as a good practice. That way, you and everyone else knows what the intentions of the code are.
|
 |
Rahul Sudip Bose
Ranch Hand
Joined: Jan 21, 2011
Posts: 637
|
|
Bear Bibeault wrote:
the EL is disabled by default in JSPs.
Sorry, this may sound foolish but what is this EL ? Never saw such things in my book.
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56204
|
|
A good example then of something that will bite you later on if you are sloppy.
The EL is the JSP Expression Language.
|
 |
 |
|
|
subject: Head First Book : why are we using this ? The code works without it.
|
|
|