You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Laurent Trillaud <lt...@jouve.fr> on 2003/11/05 15:16:44 UTC
[xsp-session-fw] language Exception
Hi
I'm trying to get information inside the authentication session context
and give it into a java variable, to process it later, in a XSP file.
<?xml version="1.0"?>
<xsp:page language="java"
xmlns:xsp="http://apache.org/xsp"
xmlns:xsp-session-fw="http://apache.org/xsp/session-fw/1.0"
create-session="true">
<xsp:logic>
String str = new String( <xsp-session-fw:getxml as="string"
context="authentication" path="/authentication/ID"/>);
</xsp:logic>
<page>
<xsp:expr>str</xsp:expr>
</page>
</xsp:page>
But this page produces this language exception.
How can I do?
Original Exception:
org.apache.cocoon.components.language.LanguageException: Error compiling
session_control_xsp:
ERROR 1
(org/apache/cocoon/www/portal/session_control/resources/session_control_
xsp.java):
...
/* User Class Declarations */
String str = new String(
// start error (lines 76-76) "Default constructor cannot handle
exception type ProcessingException thrown by implicit super constructor.
Must define an explicit constructor"
(((DocumentFragment)(XSPSessionFwHelper.getXML(this.manager,
// end error
String.valueOf("authentication"),
String.valueOf("/authentication/ID")))).getFirstChild().getNodeValue())
);
...
Line 76, column 0: Default constructor cannot handle exception type
ProcessingException thrown by implicit super constructor. Must define an
explicit constructor
at
org.apache.cocoon.components.language.programming.java.JavaLanguage.comp
ile(JavaLanguage.java:236)
at
org.apache.cocoon.components.language.programming.CompiledProgrammingLan
guage.load(CompiledProgrammingLanguage.java:208)
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
RE : [xsp-session-fw] language Exception
Posted by Laurent Trillaud <lt...@jouve.fr>.
> Why don't you just do:
>
> <xsp:logic>
> String str = <xsp-session-fw:getxml as="string"
> context="authentication" path="/authentication/ID"/>;
> </xsp:logic>
Yes it's easier, but it's the same problem.
> You may need to catch an exception, I don't have the xsp-session-fw
API
> handy.
Here is the new XSP
<xsp:logic>
try {
String str = <xsp-session-fw:getxml as="string" context="authentication"
path="/authentication/ID"/>;
} catch( Exception e) {}
</xsp:logic>
Now I got a syntax error on the try.
If I look about the java code generated, I can see that I'm not inside a
function!
Original Exception:
org.apache.cocoon.components.language.LanguageException: Error compiling
session_control_xsp:
ERROR 1
(org/apache/cocoon/www/portal/session_control/resources/session_control_
xsp.java):
...
// resolver - org.apache.cocoon.environment.SourceResolver
/* User Class Declarations */
// start error (lines 74-74) "Syntax error on keyword "try"; "boolean",
"void", "byte", "short", "int", "long", "char", "float", "double",
"Identifier", "interface", "class" expected"
try {
// end error
String str =
(((DocumentFragment)(XSPSessionFwHelper.getXML(this.manager,
String.valueOf("authentication"),
...
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
Re: [xsp-session-fw] language Exception
Posted by "John L. Webber" <Jo...@jentro.com>.
Why don't you just do:
<xsp:logic>
String str = <xsp-session-fw:getxml as="string" context="authentication" path="/authentication/ID"/>;
</xsp:logic>
You may need to catch an exception, I don't have the xsp-session-fw API
handy.
John
Laurent Trillaud wrote:
>Hi
>I'm trying to get information inside the authentication session context
>and give it into a java variable, to process it later, in a XSP file.
>
><?xml version="1.0"?>
><xsp:page language="java"
>xmlns:xsp="http://apache.org/xsp"
>xmlns:xsp-session-fw="http://apache.org/xsp/session-fw/1.0"
>create-session="true">
><xsp:logic>
>String str = new String( <xsp-session-fw:getxml as="string"
>context="authentication" path="/authentication/ID"/>);
></xsp:logic>
><page>
><xsp:expr>str</xsp:expr>
></page>
></xsp:page>
>
>
--
---------------------------------------------------------
Jentro Technologies GmbH
John L. Webber, Software Development
---------------------------------------------------------
Rosenheimer Str. 145e 81671 München
Tel. +49 700 881 199 88 mailto:John.Webber@jentro.com
Fax +49 700 881 199 88 http://www.jentro.com
---------------------------------------------------------
NOTICE: The information contained in this e-mail is confidential or may otherwise be legally privileged. It is intended for the named recipient only. If you have received it in error, please notify us immediately by reply or by calling the telephone number above and delete this message and all its attachments without any use or further distribution of its contents. Please note that any unauthorised review, copying, disclosing or otherwise making use of the information is strictly prohibited. Thank you.
---------------------------------------------------------
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
RE : [xsp-session-fw] language Exception
Posted by Laurent Trillaud <lt...@jouve.fr>.
Ok, you're right.
This XSP is working
<page>
<xsp:logic>
String str = "Undefined";
try {
str = <xsp-session-fw:getxml as="string" context="authentication"
path="/authentication/I"/>;
} catch( java.lang.Exception e) {}
</xsp:logic>
<xsp:expr>str</xsp:expr>
</page>
</xsp:page>
Thanks a lot.
Laurent Trillaud
> -----Message d'origine-----
> De : Chris Morgan [mailto:chris@atomicdog.com]
> Envoyé : mercredi 5 novembre 2003 15:23
> À : users@cocoon.apache.org
> Objet : RE: [xsp-session-fw] language Exception
>
> I've run into similar problems with the authentication session. I
think
> that the problem is that your <xsp:logic> tag precedes the
<xsp:content>
> tag. Don't know for sure, but I think the session (and therefore, the
> authentication) isn't available outside of the <xsp:content> tag.
>
>
>
> -----Original Message-----
> From: Laurent Trillaud [mailto:ltrillaud@jouve.fr]
> Sent: Wednesday, November 05, 2003 9:17 AM
> To: users@cocoon.apache.org
> Subject: [xsp-session-fw] language Exception
>
>
> Hi
> I'm trying to get information inside the authentication session
context
> and give it into a java variable, to process it later, in a XSP file.
>
> <?xml version="1.0"?>
> <xsp:page language="java"
> xmlns:xsp="http://apache.org/xsp"
> xmlns:xsp-session-fw="http://apache.org/xsp/session-fw/1.0"
> create-session="true">
> <xsp:logic>
> String str = new String( <xsp-session-fw:getxml as="string"
> context="authentication" path="/authentication/ID"/>);
> </xsp:logic>
> <page>
> <xsp:expr>str</xsp:expr>
> </page>
> </xsp:page>
>
> But this page produces this language exception.
> How can I do?
>
> Original Exception:
> org.apache.cocoon.components.language.LanguageException: Error
compiling
> session_control_xsp:
> ERROR 1
>
(org/apache/cocoon/www/portal/session_control/resources/session_control_
> xsp.java):
> ...
> /* User Class Declarations */
>
> String str = new String(
>
>
> // start error (lines 76-76) "Default constructor cannot handle
> exception type ProcessingException thrown by implicit super
constructor.
> Must define an explicit constructor"
> (((DocumentFragment)(XSPSessionFwHelper.getXML(this.manager,
>
> // end error
> String.valueOf("authentication"),
>
>
String.valueOf("/authentication/ID")))).getFirstChild().getNodeValue())
> );
>
>
> ...
> Line 76, column 0: Default constructor cannot handle exception type
> ProcessingException thrown by implicit super constructor. Must define
an
> explicit constructor
> at
>
org.apache.cocoon.components.language.programming.java.JavaLanguage.comp
> ile(JavaLanguage.java:236)
> at
>
org.apache.cocoon.components.language.programming.CompiledProgrammingLan
> guage.load(CompiledProgrammingLanguage.java:208)
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
RE: [xsp-session-fw] language Exception
Posted by Chris Morgan <ch...@atomicdog.com>.
I've run into similar problems with the authentication session. I think
that the problem is that your <xsp:logic> tag precedes the <xsp:content>
tag. Don't know for sure, but I think the session (and therefore, the
authentication) isn't available outside of the <xsp:content> tag.
-----Original Message-----
From: Laurent Trillaud [mailto:ltrillaud@jouve.fr]
Sent: Wednesday, November 05, 2003 9:17 AM
To: users@cocoon.apache.org
Subject: [xsp-session-fw] language Exception
Hi
I'm trying to get information inside the authentication session context
and give it into a java variable, to process it later, in a XSP file.
<?xml version="1.0"?>
<xsp:page language="java"
xmlns:xsp="http://apache.org/xsp"
xmlns:xsp-session-fw="http://apache.org/xsp/session-fw/1.0"
create-session="true">
<xsp:logic>
String str = new String( <xsp-session-fw:getxml as="string"
context="authentication" path="/authentication/ID"/>);
</xsp:logic>
<page>
<xsp:expr>str</xsp:expr>
</page>
</xsp:page>
But this page produces this language exception.
How can I do?
Original Exception:
org.apache.cocoon.components.language.LanguageException: Error compiling
session_control_xsp:
ERROR 1
(org/apache/cocoon/www/portal/session_control/resources/session_control_
xsp.java):
...
/* User Class Declarations */
String str = new String(
// start error (lines 76-76) "Default constructor cannot handle
exception type ProcessingException thrown by implicit super constructor.
Must define an explicit constructor"
(((DocumentFragment)(XSPSessionFwHelper.getXML(this.manager,
// end error
String.valueOf("authentication"),
String.valueOf("/authentication/ID")))).getFirstChild().getNodeValue())
);
...
Line 76, column 0: Default constructor cannot handle exception type
ProcessingException thrown by implicit super constructor. Must define an
explicit constructor
at
org.apache.cocoon.components.language.programming.java.JavaLanguage.comp
ile(JavaLanguage.java:236)
at
org.apache.cocoon.components.language.programming.CompiledProgrammingLan
guage.load(CompiledProgrammingLanguage.java:208)
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org