You can't mix:
<%!
stuff with open brace {
%>
JSP CODE
<%!
 } closeing brace here
%>

Anything in <%!%> are class level declarations which live outside the jspService() method. See the generated java to see what i mean.

-Tim

Charles P. Killmer wrote:

Maybe I wasn't clear.  The code that I pasted below is throwing all
sorts of errors.  Assuming that something like this can be done.  Why
does my code throw errors?

Thanks
Charles


-----Original Message-----
From: Jason Bainbridge [mailto:[EMAIL PROTECTED] Sent: Tuesday, March 15, 2005 11:51 AM
To: Tomcat Users List
Subject: {OT] Re: Jumping in and out of JSP


On Tue, 15 Mar 2005 10:27:21 -0600, Charles P. Killmer
<[EMAIL PROTECTED]> wrote:

Is it possible to do something like the following? I have as much code as I want in Java classes. This is just to make modifying the UI


easier.

<%!
public String test() {
%>
test2
<%!
}
%>
<%=test()%>


Yes it is and one of the reaons using JSP's instead of just Servlets is
attractive.

Regards,
--
Jason Bainbridge
http://kde.org - [EMAIL PROTECTED]
Personal Site - http://jasonbainbridge.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]




--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to