You are trying to access a variable that hasn't been declared yet.  The <%!
%> code gets generated and run during initialization.  The <% %> code is RUN
during http requests, AFTER initialization.  You are trying to access a
"method" variable in an initialization process.  Remember, the JSP gets
converted to a servlet.  If you aren't familiar with servlets you should
acquaint yourself with them because that is the best way to become good with
JSP and understand issues like the one you are asking about.

>From: Nishit Trivedi <[EMAIL PROTECTED]>
>Reply-To: A mailing list about Java Server Pages specification and
>     reference <[EMAIL PROTECTED]>
>To: [EMAIL PROTECTED]
>Subject: using variable defined within <% %> in <%! %>
>Date: Tue, 6 Mar 2001 17:32:18 -0500
>
>hi,
>
>how do i use the variable defined within scriplet tag( <% %> ) in
>declarataion (<%! %>)?
>
>e.g
>----------------------------------------------------
><%
>   String name = "abcd"
>%>
>.
>.
><%!
>   public boolean checkName(String str){
>     boolean validity = false;
>     if(name.equals("nishit"){ //want to use "name" from above defined
>scriplet tags
>       validity = true;
>     }
>     return validity;
>   }
>%>
>------------------------------------------
>
>can any body help me in this?
>
>Nishit Trivedi
>Software Engineer
>Planet Access Networks - An InSage Company
>973-691-4704 X157
>
>===========================================================================
>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

_________________________________________________________________
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

Reply via email to