PLEASE PLEASE!

Don't do this!!!!

 <%! String cname %>
 <% cname =  request.getParameter("cname"); %>

Instead use simply
 <% String cname ;
    cname =  request.getParameter("cname"); %>

I really don't know why you're using <%! %> tags here. What's more, it's
completely wrong. Don't ever store requestParameters in variables declared
with <%! %> tags are you're in for some very serious debugging of
concurrency issues. Worst of all, you'll never notice the problem during
development! Only when your app becomes successful. And at that time it's
often too late to do this type of changes easily.

DON'T EVER USE <%! %> TAGS unless you really know what theey are
(and apparently, you don't ;-)

Geert Van Damme




> -----Original Message-----
> From: A mailing list about Java Server Pages specification and reference
> [mailto:[EMAIL PROTECTED]]On Behalf Of Rajinder Sandhu
> Sent: dinsdag 21 augustus 2001 12:11
> To: [EMAIL PROTECTED]
> Subject: Is it Possible to add dynamic string in ????
>
>
> Hi all,
>
> if i get a srint and assign it to a String variable like this :
>
> <%! String cname %>
> <% cname =  request.getParameter("cname"); %>
>
> now can i add this dynamically to the usebean tag like this :
>
> <jsp:useBean id="ClassName" class="<%= cname %>" scope="session"/>
>
> right now i am getting this error.
> If this cant be implemented like this, any suggestions on doing
> it other way
> please ?
>
>
> Cheers!!
> Raj
>
> ==================================================================
> =========
> 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
>

===========================================================================
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