• Post Reply Bookmark Topic Watch Topic
  • New Topic

value of "body-content" case-sensitive?  RSS feed

 
Hai Lin
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
<body-content> can be empty or JSP or tagdependent, are those value case-sensitive? How about write them as EMpty, or jsP or TAgdePEndeNt?
Actually, not only for this one element, all the value of elements of web.xml is case-sensitive or not?

Thanks a lot!

Hai
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66208
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why don't you just try it youself and see?
 
Siyaa Hoffman
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Hai,

I think all the value elements are case sensitive unless the container is taking care of ignoring cases for the fixed element values.

Tomcat definitely needs exact cases to work ...not sure about other application servers.
 
Hai Lin
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Siyaa, Bear,
I've done a test. Those value are case-insensitive. You can type as Jsp, or EmPTY... But when you type JSPw or EmTY or other wrong words, NO default will be chosen and the Exception "bad bodycontent" will be run into.

Thanks.

Hai
 
Peter den Haan
author
Ranch Hand
Posts: 3252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
On the face of it, those values appear to be case-sensitive in principle. Check out the JSP 1.2 tld or the JSP 2.0 schema. Of course application servers may ignore case to be a little bit more robust against user error, just as many of them ignore the precise order of elements in the web.xml file, but if you look at the spec there are just three or four possible values: tagdependent, JSP, empty, or (in the JSP 2.0 body-contentType) scriptless.

See sections JSP.C.1 and JSP.C.2 in the JSP 2.0 spec.

- Peter
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66208
151
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Peter makes an excellent point. Just because one container let's you get away with something, doesn't mean all will, and can lead to weird errors when porting an app between containers.

So my "try it and find out" may not have been the optimum response (although the point I was trying to make is that you should do some legwork on your own rather than writing a quick post here and expecting others to do your research for you). But you should have a copy of the Servlet and of the JSP Specifications on your desk for handy reference if you are working in this arena. If you don't, you're doing it wrong.
[ June 04, 2004: Message edited by: Bear Bibeault ]
 
Hai Lin
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Peter and Bear,
You guys make a very good point --- One container doesn't mean every container will do that. So I should say only Tomcat 5.0.25(my testing) can handle <body-content>'s value regardless of case, but it only proves the tomcat 5.0.25 servlet/Jsp container can handle this case, NOT meaning the Jsp/Servlet Specification ignore the case.

Thanks a lot!

Hai
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!