You don't understand how to put things in the context. Page scope and method
scope are two different things.
<% String A="test"; %> puts things in the method only; not the page. The
page has a context all its own (which you apparently know). When you declare
a bean via <jsp:useBean />, not only is a local variable declared for ease
of use, but it's populated from the appropriate context, and if it's being
created, it's stored in the context.
By the way, you can do this yourself:
<%
// this doesn't do everything that <jsp:useBean /> does...
String myBadlyNamedVariable="test";
pageContext.setAttribute("myBadlyNamedVariable", myBadlyNamedVariable);
%>
Now that you know about this (documented) "trick," your tags can access
variables defined in the pages at will.
>a very simple test:
>
><%
>String A="test";
>%>
>
><%
>out.println(pageContext.getAttribute("A"));
>%>
>
>prints null. If 'A' is not a 'page scope' object, than
>what is it ? :)
>Is it a bug (Tomcat,Resin) or a feature?
>The real problem is how to create objects in JSP tags
>with no way to know about already existing stuff.
_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.html
http://www.jguru.com/jguru/faq/faqpage.jsp?name=JSP
http://www.jguru.com/jguru/faq/faqpage.jsp?name=Servlets