On Tue, 8 Jan 2002, Bryan P. Glennon wrote: > Shawn - > Sometimes long-shots come through. The defining tag was inside an > <html:form> block. That brings up another question - I thought that the > variable would have page scope (and I need it to). Am I just > out-of-luck?
Maybe, but you can usually find a way around issues like this. The scoped *attribute* does have page scope, but the scripting variable has a lexical scope based on the Jave code to which the JSP page compiles. So, the easiest thing to do (perhaps!) is expose ("declare") the variable earlier, and then set it with another tag later. (This is one thing the "declare" parameter in VariableInfo's constructor is for.) For instance, usage might look like this: <custom:declare varName="foo"> <html:form> <custom:set varName="foo"> </html:form> <%=foo%> <%-- uses second value --%> Just to make sure what's going on is clear, the result Java code would logically look like this: String foo; foo = pageContext.getAttribute("foo"); if (...) { // block for html:form tag foo = pageContext.getAttribute("foo"); // custom:set } // here, 'foo' is declared from before, but has value from // inner block Hope that helps! -- Shawn Bayern Author, The JSP Standard Tag Library: http://www.jstlbook.com (upcoming) -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>