I'm pretty sure it is an XSP feature, but is possibly a documentation bug.
The feature allows you to, for example, declare instance variables or declare instance or static methods to be used in the body of the XSP. Wouldn't you agree?

I'm actually using it in some of my XSP pages, so please don't report it as a bug - or someone might actually fix it. :-)

Glad I could help.
--
Ilya

Eric Everman wrote:

THANKYOU!

That was the problem - Implicit variables are not created until the content tag is reached, thus logic referencing them will fail if prior to the content tag.

The code that I reference for placing the logic outside the content tag was from a JavaWorld article. Did this used to work and now doesn't?

This seems like a bug or at least an anti-feature. Should I report it?

Thanks,

Eric Everman



At 10/29/2002, you wrote:

Try putting a document tag around all of your content and logic.
I.e.:

=====================================================
<?xml version="1.0"?>
<xsp:page language="java" xmlns:xsp="http://apache.org/xsp";>

<content>
<xsp:logic>
String keyword = request.getParameter("value");
</xsp:logic>

The 'value' parameter was: <xsp:expr>keyword</xsp:expr>
</content>

</xsp:page>
=====================================================

I think the problem might come from the fact that until first XML data is emited, you are not in the context of the request handler, but in the context of the class. I am not 100% sure, but it would be easy for you to check if you looked at the generated source code. The "request" variable probably isn't set until you are actually in the handler method.

Also, the namespace URI you have for xsp prefix (xmlns:xsp="http://apache.org/xsp";) seems to be correct - that's what the xsp.xsl logicsheet is using.

G'luck.
--
Ilya

Eric Everman wrote:

At 10/28/2002, you wrote:

You do not appear to have declared `keyword'.

i.e., try:

 String  keyword = request.getParameter("value");

Dave



Ha, fair enough. But believe it or not, this is a copy/paste error.
Here is the simplest xsp page that causes the problem (verbatim this time):

=====================================================
<?xml version="1.0"?>
<xsp:page language="java" xmlns:xsp="http://apache.org/xsp";>

<xsp:logic>
String keyword = request.getParameter("value");
</xsp:logic>

<content>
The 'value' parameter was: <xsp:expr>keyword</xsp:expr>
</content>

</xsp:page>
=====================================================

This xsp causes a NPE:
java.lang.NullPointerException
at org.apache.cocoon.www.examples.db1_xsp.(D:\Program Files\Apache Group\Tomcat 4.1\work\Standalone\localhost\cctest\cocoon-files\org/apache/cocoon/www/examples\db1_xsp.java:62)

Line 62 is "String keyword = request.getParameter("value");"

Sorry for the initial mis-post. Any ideas?

Eric Everman


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>

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



---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

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


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

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




---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

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

Reply via email to