RE: Strange JSP Compilation Problem

2001-02-12 Thread Amy Boyett

Hunter, I am a super-newbie, so I'm probably not fully qualified to answer
your question. But I previously had a similar problem, and no one *more*
qualified has answered your post, so I'll tell you what I had to learn the
hard way. It's a pretty basic concept that is re-iterated throughout the
spec, but sometimes the most basic concepts elude me until I've done my own
head-banging...

Declarations, directives, actions and custom tags are executed at
translation time (when the JSP page is turned into a servlet class).
Expressions and scriptlets are executed at request time. (There are
exceptions in JSP 1.2, where an attribute  in an action tag can have a
request-time value; these exceptions are listed in the 1.2 spec). So,
anyway, is it possible you are trying to call an object at translation time
that actually doesn't get instantiated until the request? You might also
want to check the spec regarding page, request, session, and application
scope. This was helpful to me in understanding when and where objects were
available to me.

Hopefully, if this is a totally off-base answer, it will encourage someone
more in-the-know to enlighten us both :-)

Regards,
Amy
[EMAIL PROTECTED]

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Hunter
Hillegas
Sent: Monday, February 12, 2001 2:00 PM
To: '[EMAIL PROTECTED]'
Subject: Strange JSP Compilation Problem


I have a JSP page that calls some objects that are in a package...

When I try to view the JSP, it generates a compile error:

org.apache.jasper.JasperException: Unable to compile class for
JSP/server/jakarta-tomcat-3.2.1/work/localhost_8080%2Fgroundswell/_0002fnews
_0002fbackend_0005flabel_0005fnews_0005fedit_00031_0002ejspbackend_0005flabe
l_0005fnews_0005fedit1_jsp_0.java:178: Undefined variable or class name:
currentNewsBean
out.print( currentNewsBean.getRecNum() );

Okay, this looks very simple... Like I just forgot to instantiate it... The
thing is I didn't... The object gets instantiated prior to being called...
Is there anything else that could be wrong?


Hunter Hillegas, MCP
Web Engineer / System Administrator - Jacob Stern  Sons, Inc.
[EMAIL PROTECTED]
805-565-1411 PH * 805-565-8684 FAX


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

___
tomcat-users mailing list
[EMAIL PROTECTED]
https://mailman.real-time.com/mailman/listinfo/tomcat-users


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




XML syntax bugs in Tomcat 4?

2001-02-12 Thread Amy Boyett

I am using Tomcat 4.0-M5 . . . Before I submit as bugs (and please forgive
if they are already there), can anyone tell me why this jsp in "standard"
syntax works:

jsp:plugin type="applet" code="Button.class" 
   jsp:params
jsp:param name="Background" value="background1.jpg" /
jsp:param name="Image1" value="button1.gif" /
   /jsp:params
/jsp:plugin


But this jsp in XML syntax throws a servlet exception:
jsp:root
jsp:plugin type="applet" code="Button.class" 
   jsp:params
jsp:param name="Background" value="background1.jpg" /
jsp:param name="Image1" value="button1.gif" /
   /jsp:params
/jsp:plugin
/jsp:root

The second example works just fine if I take *out* the jsp:params tags.
Seems like it should work the same whether I am in standard syntax or XML
syntax.

While we're on the topic . . . this works:

jsp:include page="foo.jsp" flush="true" /

but this does not:
jsp:root
jsp:include page="foo.jsp flush="true" /
/jsp:root

It does not matter if the included page is in standard or XML syntax -- it
always works if the container page is standard syntax and never works if the
container page is XML syntax. Is there anyone else out there who is
extensively using the "new" XML syntax of JSP 1.2? Just curious because I am
interested in using it exclusively.

Thanks,
Amy
[EMAIL PROTECTED]






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