On Wed, 17 Jul 2002, Leif Hanack wrote: > > If you don't want to let the user set information on an object with > > <c:set>, it must not have setter methods. You can always wrap the > > underlying object in a wrapper that provides only one-way access, but an > > interface does not provide this protection. > > mmh?! thanks so fare. i'm a bit disappointed of EL concerning this pouint. > even the usebean tag has a possibility to define a type of an object. > why doesn't EL have?! > > i think the loss of using interfaces is a big disadvantage. on the > serverside it will not be clear, why i have a class User with getter > and setter and a User2 with just setter.
One of the prices we pay for more convenience for page authors is the loss of some distinctions like this. With scriptlets and <jsp:useBean>, the types of variables are kept track of. When you store objects in a Map, or in typeless containers like those that hold scoped variables, the reference you might have used at one point in your code is irrelevant. We've tossed around the idea of having a <jsp:declare> tag to keep track of the types of variables. But that wouldn't provide any meaningful safety *from* the page author, if that's what you're looking for. -- Shawn Bayern "JSTL in Action" http://www.jstlbook.com (coming in July 2002 from Manning Publications) -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>