Your example below creates a syntactically invalid page -- if you use the
<%! ... %> construct to declare a method, the *entire* method declaration
needs to be inside the same construct.

You should really really really be using servlets for stuff like this --
trying to mix code and HTML output on the same JSP page is just going to
get you into trouble.

Craig McClanahan



On Sun, 26 Aug 2001 [EMAIL PROTECTED] wrote:

> Date: Sun, 26 Aug 2001 20:56:13 GMT
> From: [EMAIL PROTECTED]
> Reply-To: [EMAIL PROTECTED]
> To: [EMAIL PROTECTED]
> Subject: Using Normal Html in methods, or class structures in JSP
>
> I'm declaring a class inside my jsp
> <%!
>
> public class foo{
>
> public void mymethod{
>
> //Java code
>
> %>
> Html
> <%! }//mymethod
>
> }//foo
> %>
>
> The problem is that, the Html is put inside the jsp_service method in the
> generated servlet code and not inside the class structure, which otherwise works
> perfectly fine.  What I tried to do is pass a JspWriter object into my class via
> constructor, but that doesn't help.  I need the html to appear within the class
> and not the jsp_service, does anyone have any idea how to fix
> this?
>
> ---------------------------------------------
> This message was sent using Endymion MailMan.
> http://www.endymion.com/products/mailman/
>
>
>

Reply via email to