Chrish,

Thanks for finding time to reply to my question. After some hours of
churning the jsp code around I tracked down my mistake to not passing a
command line property (-Dpos.home-...) to the JVM. When I set this property
using CATALINA_OPTS=-Dpos.home=... I got the output.

Thanks again.

Regards,
Goutam


-----Original Message-----
From: Christopher Williams [mailto:[EMAIL PROTECTED] 
Sent: Monday, September 22, 2003 8:00 PM
To: Tomcat Users List
Subject: Re: newbie jasperException


Hi,

Your JSP code is wrong.  The <%@ page import... %> directive needs to go at
the top of the page.  When the Jasper compiler turns it into Java, that
directive gets turned into one or more Java import statements, and you
wouldn't stick those in the middle of your code.

Remember, all the HTML gets turned into Java code, as follows:
    out.write("<html>\r\n<head>\r\n...");
So that your import statements (and the class variable declaration "<%!
Vector v; %>") appear inside a servlet doGet() method, which is illegal
Java.  In spite of the superficial similarities, JSP is not really like PHP.
The PHP interpreter turns embedded PHP code into HTML, while the JSP
compiler turns HTML into Java (and then the Java compiler turns it into byte
code).  It will help you to keep this in mind when writing JSP code.

BTW, I'm a little troubled by that "<%! Vector v; %>" declaration.  This
turns v into an instance variable of the servlet class that Jasper creates.
Is this what you intended?  If not, remove the exclamation mark and leave
the variable declaration where it is.

Kind regards,

Chris Williams.



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