You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Volker Schneider <vo...@danet.de> on 2002/05/14 14:47:34 UTC

xsp-formval:is-toosmall causes xsp compilation error

Dear colleagues,

if have this xsp file, in order to show the form validation error but I
stuck there for hours:

<?xml version="1.0" encoding="iso-8859-1"?>

<xsp:page xmlns:xsp="http://apache.org/xsp"
          xmlns:xsp-formval="http://apache.org/xsp/form-validator/2.0">

<xsp:logic>
  String theErrorMessage = "No error message specified.";

  if (<xsp-formval:is-toosmall name="startzip"/>)
  {
  };

</xsp:logic>

<message>
  FormValidationError: <xsp:expr>theErrorMessage</xsp:expr>
</message>

</xsp:page>

And I got this error message:

description org.apache.cocoon.ProcessingException: Language Exception:
org.apache.cocoon.components.language.LanguageException: Error compiling
ErrorFormVal_xsp: Line 68, column 2: illegal start of type Line 0, column 0:
1 error

The java file looks like (whereby Line 68 is where the 'if' statement
begins):

    public class ErrorFormVal_xsp extends XSPGenerator {

        static {
            dateCreated = 1021380103370L;
            dependencies = new File[] {

            };
        }

        /* Built-in parameters available for use */
        // context    - ServletContext
        // request    - org.apache.cocoon.environment.Request
        // response   - org.apache.cocoon.environment.Response
        // parameters - parameters defined in the sitemap

        /* User Class Declarations */

  String theErrorMessage = "No error message specified.";

  if (


(XSPFormValidatorHelper.getParamResult(objectModel,"startzip").equals(Valida
torActionResult.TOOSMALL))
      )
  {
  };



      /**
       * Generate XML data.
       */
      public void generate() throws SAXException, IOException,
ProcessingException {

            ...

I have no idea what went wrong, because I took the syntax from
documentation.

Who can help?

Thank you, best regards
- Volker -


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

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


RE: xsp-formval:is-toosmall causes xsp compilation error

Posted by Volker Schneider <vo...@danet.de>.
Thank you.

-----Original Message-----
From: KOZLOV Roman [mailto:r-kozlov@opencascade.com]
Sent: Dienstag, 14. Mai 2002 16:26
To: cocoon-users@xml.apache.org
Subject: Re: xsp-formval:is-toosmall causes xsp compilation error


Hi Volker,

Perhaps you have to enclose your xsp:page content in some intermediate tag.
Otherwise the "if" is out of any method.

Roman

Volker Schneider wrote:

> Dear colleagues,
>
> if have this xsp file, in order to show the form validation error but I
> stuck there for hours:
>
> <?xml version="1.0" encoding="iso-8859-1"?>
>
> <xsp:page xmlns:xsp="http://apache.org/xsp"
>           xmlns:xsp-formval="http://apache.org/xsp/form-validator/2.0">
>
> <xsp:logic>
>   String theErrorMessage = "No error message specified.";
>
>   if (<xsp-formval:is-toosmall name="startzip"/>)
>   {
>   };
>
> </xsp:logic>
>
> <message>
>   FormValidationError: <xsp:expr>theErrorMessage</xsp:expr>
> </message>
>
> </xsp:page>
>
> And I got this error message:
>
> description org.apache.cocoon.ProcessingException: Language Exception:
> org.apache.cocoon.components.language.LanguageException: Error compiling
> ErrorFormVal_xsp: Line 68, column 2: illegal start of type Line 0, column
0:
> 1 error
>
> The java file looks like (whereby Line 68 is where the 'if' statement
> begins):
>
>     public class ErrorFormVal_xsp extends XSPGenerator {
>
>         static {
>             dateCreated = 1021380103370L;
>             dependencies = new File[] {
>
>             };
>         }
>
>         /* Built-in parameters available for use */
>         // context    - ServletContext
>         // request    - org.apache.cocoon.environment.Request
>         // response   - org.apache.cocoon.environment.Response
>         // parameters - parameters defined in the sitemap
>
>         /* User Class Declarations */
>
>   String theErrorMessage = "No error message specified.";
>
>   if (
>
>
(XSPFormValidatorHelper.getParamResult(objectModel,"startzip").equals(Valida
> torActionResult.TOOSMALL))
>       )
>   {
>   };
>
>       /**
>        * Generate XML data.
>        */
>       public void generate() throws SAXException, IOException,
> ProcessingException {
>
>             ...
>
> I have no idea what went wrong, because I took the syntax from
> documentation.
>
> Who can help?
>
> Thank you, best regards
> - Volker -
>
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>
> To unsubscribe, e-mail: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>


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

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


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

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


Re: xsp-formval:is-toosmall causes xsp compilation error

Posted by KOZLOV Roman <r-...@opencascade.com>.
Hi Volker,

Perhaps you have to enclose your xsp:page content in some intermediate tag.
Otherwise the "if" is out of any method.

Roman

Volker Schneider wrote:

> Dear colleagues,
>
> if have this xsp file, in order to show the form validation error but I
> stuck there for hours:
>
> <?xml version="1.0" encoding="iso-8859-1"?>
>
> <xsp:page xmlns:xsp="http://apache.org/xsp"
>           xmlns:xsp-formval="http://apache.org/xsp/form-validator/2.0">
>
> <xsp:logic>
>   String theErrorMessage = "No error message specified.";
>
>   if (<xsp-formval:is-toosmall name="startzip"/>)
>   {
>   };
>
> </xsp:logic>
>
> <message>
>   FormValidationError: <xsp:expr>theErrorMessage</xsp:expr>
> </message>
>
> </xsp:page>
>
> And I got this error message:
>
> description org.apache.cocoon.ProcessingException: Language Exception:
> org.apache.cocoon.components.language.LanguageException: Error compiling
> ErrorFormVal_xsp: Line 68, column 2: illegal start of type Line 0, column 0:
> 1 error
>
> The java file looks like (whereby Line 68 is where the 'if' statement
> begins):
>
>     public class ErrorFormVal_xsp extends XSPGenerator {
>
>         static {
>             dateCreated = 1021380103370L;
>             dependencies = new File[] {
>
>             };
>         }
>
>         /* Built-in parameters available for use */
>         // context    - ServletContext
>         // request    - org.apache.cocoon.environment.Request
>         // response   - org.apache.cocoon.environment.Response
>         // parameters - parameters defined in the sitemap
>
>         /* User Class Declarations */
>
>   String theErrorMessage = "No error message specified.";
>
>   if (
>
> (XSPFormValidatorHelper.getParamResult(objectModel,"startzip").equals(Valida
> torActionResult.TOOSMALL))
>       )
>   {
>   };
>
>       /**
>        * Generate XML data.
>        */
>       public void generate() throws SAXException, IOException,
> ProcessingException {
>
>             ...
>
> I have no idea what went wrong, because I took the syntax from
> documentation.
>
> Who can help?
>
> Thank you, best regards
> - Volker -
>
> ---------------------------------------------------------------------
> Please check that your question has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>
>
> To unsubscribe, e-mail: <co...@xml.apache.org>
> For additional commands, e-mail: <co...@xml.apache.org>


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

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


RE: xsp-formval:is-toosmall causes xsp compilation error

Posted by Volker Schneider <vo...@danet.de>.
Dear colleagues,

I found the solution myself:

<xsp:logic> should have a surrounding tag:

<message>
  <xsp:logic>
    String theErrorMessage = "No error message specified.";

    if (<xsp-formval:is-toosmall name="startzip"/>)
    {
      theErrorMessage = "Start ZIP is too small");
    }
  </xsp:logic>

  <xsp:expr>theErrorMessage</xsp:page>
</message>

Sorry,
- Volker -

-----Original Message-----
From: Volker Schneider [mailto:volker.schneider@danet.de]
Sent: Dienstag, 14. Mai 2002 14:48
To: cocoon-users@xml.apache.org
Subject: xsp-formval:is-toosmall causes xsp compilation error


Dear colleagues,

if have this xsp file, in order to show the form validation error but I
stuck there for hours:

<?xml version="1.0" encoding="iso-8859-1"?>

<xsp:page xmlns:xsp="http://apache.org/xsp"
          xmlns:xsp-formval="http://apache.org/xsp/form-validator/2.0">

<xsp:logic>
  String theErrorMessage = "No error message specified.";

  if (<xsp-formval:is-toosmall name="startzip"/>)
  {
  };

</xsp:logic>

<message>
  FormValidationError: <xsp:expr>theErrorMessage</xsp:expr>
</message>

</xsp:page>

And I got this error message:

description org.apache.cocoon.ProcessingException: Language Exception:
org.apache.cocoon.components.language.LanguageException: Error compiling
ErrorFormVal_xsp: Line 68, column 2: illegal start of type Line 0, column 0:
1 error

The java file looks like (whereby Line 68 is where the 'if' statement
begins):

    public class ErrorFormVal_xsp extends XSPGenerator {

        static {
            dateCreated = 1021380103370L;
            dependencies = new File[] {

            };
        }

        /* Built-in parameters available for use */
        // context    - ServletContext
        // request    - org.apache.cocoon.environment.Request
        // response   - org.apache.cocoon.environment.Response
        // parameters - parameters defined in the sitemap

        /* User Class Declarations */

  String theErrorMessage = "No error message specified.";

  if (


(XSPFormValidatorHelper.getParamResult(objectModel,"startzip").equals(Valida
torActionResult.TOOSMALL))
      )
  {
  };



      /**
       * Generate XML data.
       */
      public void generate() throws SAXException, IOException,
ProcessingException {

            ...

I have no idea what went wrong, because I took the syntax from
documentation.

Who can help?

Thank you, best regards
- Volker -


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

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


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

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>


RE: xsp-formval:is-toosmall causes xsp compilation error

Posted by Vadim Gritsenko <va...@verizon.net>.
> From: Volker Schneider [mailto:volker.schneider@danet.de]
> 
> Dear colleagues,
> 
> if have this xsp file, in order to show the form validation error but
I
> stuck there for hours:

But where is root element tag???



> <?xml version="1.0" encoding="iso-8859-1"?>
> 
> <xsp:page xmlns:xsp="http://apache.org/xsp"
>
xmlns:xsp-formval="http://apache.org/xsp/form-validator/2.0">

<my-root>
 
> <xsp:logic>
>   String theErrorMessage = "No error message specified.";
> 
>   if (<xsp-formval:is-toosmall name="startzip"/>)
>   {
>   };
> 
> </xsp:logic>
> 
> <message>
>   FormValidationError: <xsp:expr>theErrorMessage</xsp:expr>
> </message>

</my-root>
 
> </xsp:page>
 

Vadim


> And I got this error message:
> 
> description org.apache.cocoon.ProcessingException: Language Exception:
> org.apache.cocoon.components.language.LanguageException: Error
compiling
> ErrorFormVal_xsp: Line 68, column 2: illegal start of type Line 0,
column 0:
> 1 error
> 
> The java file looks like (whereby Line 68 is where the 'if' statement
> begins):
> 
>     public class ErrorFormVal_xsp extends XSPGenerator {
> 
>         static {
>             dateCreated = 1021380103370L;
>             dependencies = new File[] {
> 
>             };
>         }
> 
>         /* Built-in parameters available for use */
>         // context    - ServletContext
>         // request    - org.apache.cocoon.environment.Request
>         // response   - org.apache.cocoon.environment.Response
>         // parameters - parameters defined in the sitemap
> 
>         /* User Class Declarations */
> 
>   String theErrorMessage = "No error message specified.";
> 
>   if (
> 
> 
>
(XSPFormValidatorHelper.getParamResult(objectModel,"startzip").equals(Va
lida
> torActionResult.TOOSMALL))
>       )
>   {
>   };
> 
> 
> 
>       /**
>        * Generate XML data.
>        */
>       public void generate() throws SAXException, IOException,
> ProcessingException {
> 
>             ...
> 
> I have no idea what went wrong, because I took the syntax from
> documentation.
> 
> Who can help?
> 
> Thank you, best regards
> - Volker -


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

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>