I've added a method to my JSP, which in a simplified form looks something
like the following:
<%!
private void output(String text)
{
System.out.println(text);
}
%>
I want to change this so that it also displays 'text' on the html page, but
I can't work out how this can be done from within the method.
If I do the following:
<%!
private void output(String text)
{
System.out.println(text);
%>
<p><%= text %></p>
<%
}
%>
I get an error because it thinks the method is not terminated with a }.
If I do the following:
<%!
private void output(String text)
{
System.out.println(text);
%>
<p><%= text %></p>
<%!
}
%>
it thinks that 'text' is no longer in scope.
Can anyone help?
Thanks,
Catharine
===========================================================================
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