Zsombor,
I have tried the code as suggested, but I get a compilation error. Here is the code I tried:
<?xml version="1.0"?>
<xsp:page xmlns:xsp="http://apache.org/xsp
"
xmlns:esql="http://apache.org/cocoon/SQL/v2">
<login>
<xsp:logic>
String upw = request.getParameter
("password");
String dbpw = new String("");
<esql:execute-query>
<esql:query>
SELECT pw
FROM ....
</esql:query>
<esql:results>
<esql:row-results>
<xsp:logic>
dbpw = <esql:get-string column="pw"/>
</xsp:logic>
</esql:row-results>
</esql:results>
</esql:execute-query>
if (dbpw.compareTo
(upw) == 0)
{
session.setAttribute("authenticated", "yes");
}
</xsp:logic>
</login>
</xsp:page>
Upon invoking Cocoon for this page, I get the following errors. Again, if I knew how to get to the Java Source file for this XSP, I could try to fix this.
org.apache.cocoon.components.language.LanguageException:
Error compiling authenticate_xsp:
ERROR 1 (org\apache\cocoon\www\tosh\ibm_proto5\portal\login\authenticate_xsp.java):
...
dbpw =
(
// start error (lines 336-336) "Invalid cast type _expression_"
EsqlHelper.getAscii(_esql_query.getResultSet(),"pw","")
// end error
)
this.characters("\n ");
...
ERROR 2 (org\apache\cocoon\www\tosh\ibm_proto5\portal\login\authenticate_xsp.java):
...
if (dbpw.compareTo(upw) == 0)
{
// start error (lines 374-374) "session cannot be resolved"
session.setAttribute("a", "b");
// end error
}
this.characters("\n \n \n ");
...
Line 336, column 0: Invalid cast type _expression_
Line 374, column 0: session cannot be resolved
Any clue? Your help is appreciated.
- PDP
- Re: Setting Java variables in esql (in XSPs) Paritosh Patel
- Re: Setting Java variables in esql (in XSPs) Lars Huttar
- RE: Setting Java variables in esql (in XSPs) Varga, Zsombor
- Re: RE: Setting Java variables in esql (in XSPs) Paritosh Patel
