jstl, request parameters
I'm considering moving a large codebase of proprietary templates to jsp, and the jstl in particular. A problem I've had so far is with using SPEL and if tag. Such as: c:if test=$param:myParam == '1'do stuff/c:if and myParam does not exist in the url query string, an exception is thrown. We have many parameters that aren't required which initialize to default values, but we want an easy way to test against their existence in jsp. The request tag library has some nice ways of doing this, but I like the idea of using one set of tag libraries, not a mish-mash of many incompatible ones. I just don't think tags like this should throw exceptions on non-unrecoverable errors. Instead, it should just return an empty string (or some reasonable equivalent). a way around this would be to use Ecmascript to hold a reference to some object, which we use get/set methods on, for example: % request.setAttribute(req,request); % but we're having a hard time passing values to this object c:if test=$req.getParameterName(myParam).../c:if but the syntax doesn't seem to work - is there a way around this? -Steve -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
loading a singleton class in jsp
Hi, I'm using struts framework and I was trying to load a singleton class that will hold my dropdown list of state in my jsp. jsp:useBean id=StateLookup scope=session class=com.blah.StateLookup.getInstance();/ StateLookup is a singleton class. I'm using the jsp:useBean so that I can use these struts tag lib html:select property=state tabindex =key html:option value=/html:option bean:define id=stateID name=StateLookup property=stateList / html:options collection=stateID property=key labelProperty=value/ /html:select Am I doing it the wrong way? Your input will be greatly appreciated. Mike -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]
Re: jstl, request parameters
The final version of JSTL will most likely be substantially more lenient with respect to values that don't exist. Unfortunately, there's not much I can advise other than, Wait for the upcoming version! :-) (Such is the nature of early-access releases.) -- Shawn Bayern Author, JSP Standard Tag Library http://www.jstlbook.com (coming this spring from Manning Publications) On Wed, 20 Feb 2002, Steve Morrison wrote: I'm considering moving a large codebase of proprietary templates to jsp, and the jstl in particular. A problem I've had so far is with using SPEL and if tag. Such as: c:if test=$param:myParam == '1'do stuff/c:if and myParam does not exist in the url query string, an exception is thrown. We have many parameters that aren't required which initialize to default values, but we want an easy way to test against their existence in jsp. The request tag library has some nice ways of doing this, but I like the idea of using one set of tag libraries, not a mish-mash of many incompatible ones. I just don't think tags like this should throw exceptions on non-unrecoverable errors. Instead, it should just return an empty string (or some reasonable equivalent). a way around this would be to use Ecmascript to hold a reference to some object, which we use get/set methods on, for example: % request.setAttribute(req,request); % but we're having a hard time passing values to this object c:if test=$req.getParameterName(myParam).../c:if but the syntax doesn't seem to work - is there a way around this? -Steve -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED] -- To unsubscribe, e-mail: mailto:[EMAIL PROTECTED] For additional commands, e-mail: mailto:[EMAIL PROTECTED]