Hans wrote:
>If you promise to move the code to a servlet/bean/action later, I tell
>you how ;-) You can use a JSP declaration to declare a method:
>
> <%!
> private String createColumnClause(String column, String value) {
> ...
> return clause;
> }
> %>
>
>Note that the method has access to only instance variables (which should
>be avoided for thread-safety reasons) so you have to pass it all data
>it need as parameters.
>
>You can then call it from a scriptlet:
>
> <%
> String clause = createColumnClause("email", email);
> %>
>
>Hope this helps,
>Hans
Is it necessary to synchronize methods in JSP so as to make them thread
safe? When do I need to synchronize them? Again, if for instance my method
need to return multiple values, in which case I'm forced to use instance
variables since Java can only return a value. How can I make the JSP thread
safe?
===========================================================================
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://archives.java.sun.com/jsp-interest.html
http://java.sun.com/products/jsp/faq.html
http://www.esperanto.org.nz/jsp/jspfaq.jsp
http://www.jguru.com/faq/index.jsp
http://www.jspinsider.com