cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From JD Daniels ...@datatrio.com>
Subject Re: auth with database
Date Tue, 09 Mar 2004 14:13:20 GMT
Not sure how those semi colons got there... odd...

Try taking the session set-attribute right out.. it is not needed as the 
user info is stored in the session with the authentication.

JD

Zamek wrote:

>Hello All,
>
>I tried to authenticate from database based on JD. Daniels's:
>http://www.mail-archive.com/users@cocoon.apache.org/msg09607.html
>
>I have some problems:
>1. 
><?xml version="1.0"?>
> <xsp:page language="java"
>     xmlns:xsp="http://apache.org/xsp";
>     xmlns:esql="http://apache.org/cocoon/SQL/v2";
>     xmlns:xsp-request="http://apache.org/xsp/request/2.0";
>     xmlns:xsp-session="http://apache.org/xsp/session/2.0";
> create-session="true"
>     xmlns:source="http://apache.org/cocoon/source/1.0";
>     xmlns:util="http://apache.org/xsp/util/2.0";
>     >
>- there are semicolons on end of all lines, which is seems to be syntax 
>error.
>-  create-session="true" also a syntax error
>
>2 I changed it, and try to run, and I get an error:
>
>ERROR   (2004-03-09) 10:24.55:955   [core.authentication-manager] 
>(/cocoon/~zamek/a/do-login-portal) Thread-11/PipelineAuthenticator: 
>authenticator: Language Exception
>org.apache.cocoon.ProcessingException: Language Exception: 
>org.apache.cocoon.components.language.LanguageException: Error compiling 
>authdb_xsp:
>ERROR 1 
>(org/apache/cocoon/www/file_/home/zamek/public_html/a/java/authdb_xsp.java):
>...
>
>        this.characters("\n                    ");
>
>      session.setAttribute(String.valueOf("userId"),
>// start error (lines 516-516) "String literal is not properly closed by a 
>double-quote"
>          "
>// end error
>
>here is the snippet:
>
><authentication>
>    <esql:connection>
>        <esql:pool>portal</esql:pool>
>        <esql:execute-query>
>           <esql:query>
>              SELECT usrid, firstName, lastName, email, role_id, role
>              FROM authenticate ('<xsp-request:get-parameter 
>name="username"/>',
>                                 '<xsp-request:get-parameter 
>name="password"/>')
>              LIMIT 1;
>           </esql:query>
>           <esql:results>
>             <esql:row-results>
>                <ID><esql:get-int column="usrid"/></ID>
>                <role><esql:get-string column="role"/></role>
>                <data>
>                    <xsp-session:set-attribute name="userId">  
>
><----------------- maybe here is the language exception
>
>                      <esql:get-string column="usrid"/>
>                    </xsp-session:set-attribute>
>                    <xsp-session:set-attribute name="userRole">
>                      <esql:get-string column="role"/>
>                    </xsp-session:set-attribute>
>                    <xsp-session:set-attribute name="userFirstName">
>
>
>So can anybody send me a working version of this xsp?
>
>  
>


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


Mime
View raw message