Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HeadFirst Servlets and Jsp pg 548

 
Neil Muya
Ranch Hand
Posts: 30
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ranchers,


Just confused at HeadFirst Servlets and Jsp pg 548 .

Here is a part of a code in the jsp:


Here is the part where the attribute optionList was declared


The note that was from HFSJ : "The optionList attribute needs to specify the datatype."

Implicitly if you don't declare the <type></type> element the default would be type of String.

So then I tried to do this hoping this would produce an error


But it went out that the code was successful without errors.

Just confused , what's the use of declaring type element?

or maybe the question is, what happens when I declare type?


Thanks in Advance!
 
Christophe Verré
Sheriff
Pie
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
mmhh... The type seems to be ignored completely. I tried set an attribute of type Exception, but set the "type" to "java.util.List" in the TLD. No errors. It supposed to default to java.lang.String...
 
Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper
Pie
Posts: 2168
57
Android Chrome Eclipse IDE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Neil,

That is strange, what did it output on your page? Did you restart the server (and hit F5 a couple of times)?

To show you an example that works fine with the type element look at this thread:Enum and Tags

Regards,
Frits
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic