Bonjour,
De suite: c'est bien de Java que je parle pas de...
Ensuite mon probléme est le suivant, j'ai des traitements à appliquer sur mes données récupéré dans un formulaire, avant de les inserer dans la BD.
je veux donc utiliser quelques expresion réguliére, etc etc...
du java dans <xsp:logic> c'est cool...
Mais je n'arrive pas à faire de class.
Sinon pour linclusion des biblio j'ai ça:
Code :
- <xsp:page language="java"
- xmlns:xsp="http://apache.org/xsp">
- <xsp:structure>
- <xsp:include>java.util.Calendar</xsp:include>
- <xsp:include>java.text.*</xsp:include>
- </xsp:structure>
- <!-- page contents -->
- </xsp:page>
|
(c'est un exemple)
Donc déjà est ce que c'est bon (ça à l'air de marcher), faut il ajouter des map component dans le sitemap .....
ensuite si je tente de faire ça:
Code :
- public String getTime()
- {
- return java.util.Calendar.getInstance().getTime().toString();
- }
|
Error:
Code :
- org.apache.cocoon.components.language.LanguageException: Error compiling membre_xsp:
- ERROR 1 (org/apache/cocoon/www/file_/home/xtof/public_html/XSP/membre_xsp.java):
- ...
- this.characters("\n " );
- this.characters("\n " );
- // start error (lines 317-317) "Syntax error on token(s), misplaced construct(s)"
- public String getTime() {
- // end error
- return java.util.Calendar.getInstance().getTime().toString();
- }
- String choix=request.getParameter("choix" );
- if(choix==null)
- ...
- ERROR 2 (org/apache/cocoon/www/file_/home/xtof/public_html/XSP/membre_xsp.java):
- ...
- this.characters("\n " );
- this.characters("\n " );
- // start error (lines 317-317) "Syntax error, insert ";" to complete Statement"
- public String getTime() {
- // end error
- return java.util.Calendar.getInstance().getTime().toString();
- }
- String choix=request.getParameter("choix" );
- if(choix==null)
- ...
- Line 317, column 0: Syntax error on token(s), misplaced construct(s)
- Line 317, column 0: Syntax error, insert ";" to complete Statement
|
Alors que:
Code :
- String test=return java.util.Calendar.getInstance().getTime().toString();
|
ça marche
Merci d'avance 