You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Nicolas Spilman <sp...@umn.edu> on 2003/07/22 18:48:32 UTC

[HELP]Language Exception

COCOON VERSION: 2.1m3 servlet
OS: Redhat Linux 7.3

I am trying to pass parameters to an XSP page using the sitemap.  The
sitemap snippet is:

    <map:match type="regexp" pattern="directory/([A-Z]).html">
      <map:generate type="serverpages" src="xsp/directory.xsp">
        <parameter name="letter" value="{1}"/>
      </map:generate>
      <map:transform type="xslt" src="style/main.xsl"/>
      <map:serialize type="xhtml"/>
    </map:match>


The trace is as follows:

Description:org.apache.cocoon.ProcessingException: Language Exception:
org.apache.cocoon.components.language.LanguageException: Error compiling
directory_xsp:
ERROR 1 (org/apache/cocoon/www/intranet/xsp/directory_xsp.java):
...
        // resolver   - org.apache.cocoon.environment.SourceResolver

        /* User Class Declarations */


// start error (lines 67-67) "Default constructor cannot handle exception
type ParameterException thrown by implicit super constructor. Must define an
explicit constructor"
  String letter = parameters.getParameter("letter");

// end error


        /**
         * Generate XML data.

...
Line 67, column 0: Default constructor cannot handle exception type
ParameterException thrown by implicit super constructor. Must define an
explicit constructor


I am basically trying to setup the site so that /directory/A.html will show
all people who's lastname starts with a 'A' instead of having to do
something like /directory/l.xsp?letter=A.  Any thoughts would be good.
Thanks.

Nicolas Spilman
spilman@umn.edu


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: [HELP]Language Exception

Posted by Andreas Hartmann <an...@apache.org>.
Geoff Howard wrote:

> Nicolas Spilman wrote:
> ...
> 
>> // start error (lines 67-67) "Default constructor cannot handle exception
>> type ParameterException thrown by implicit super constructor. Must 
>> define an
>> explicit constructor"
>>   String letter = parameters.getParameter("letter");
>>
>> // end error
> 
> 
> I think this is just because parameters.getParameter(String) throws an 
> exception which you are not catching.  An alternative is to use the 
> version with a default parameters.getParameter(String, String) which 
> does not throw the exception.
> 
> Why it gave the specific exception you see I don't quite know.

It's because the declaration is in the class body and therefore
executed in the default constructor (which does not handle this
exception).

Andreas



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: [HELP]Language Exception

Posted by Geoff Howard <co...@leverageweb.com>.
Nicolas Spilman wrote:
...
> // start error (lines 67-67) "Default constructor cannot handle exception
> type ParameterException thrown by implicit super constructor. Must define an
> explicit constructor"
>   String letter = parameters.getParameter("letter");
> 
> // end error

I think this is just because parameters.getParameter(String) throws an 
exception which you are not catching.  An alternative is to use the 
version with a default parameters.getParameter(String, String) which 
does not throw the exception.

Why it gave the specific exception you see I don't quite know.

Geoff


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org