By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,739 Members | 2,014 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,739 IT Pros & Developers. It's quick & easy.

Authentication in Cocoon

P: n/a
Hi!

I'm trying to do a login form in cocoon.
Login data are taken from MySQL, but before the data are checked cocoon
throws such an error:
org.apache.cocoon.ResourceNotFoundException: Resource not found.:
org.apache.excalibur.source.SourceNotFoundExceptio n: file:/F:/Program
Files/Apache Software Foundation/Tomcat
5.0/webapps/cocoon/portal/sitemap.xmap doesn't exist.
Do you have any suggestions where to check for the error? Why does the
Cocoon change context to cocoon/protal and is looking for sitemap there?

the sitemap fragment is:
<map:match pattern="portal/user/login">
<map:generate src="portal/resources/login.xml"/>
<map:transform src="portal/styles/buildlogin.xsl">
<map:parameter name="use-request-parameters" value="true"/>
</map:transform>
<map:transform type="sql">
<map:parameter name="use-connection" value="portal"/>
</map:transform>...........

LOGIN.XML file in directory cocoon\portal\resources:

<?xml version="1.0"?>
<login/>

BUILDLOGIN.XSL in directory cocoon\portal\styles:

<xsl:param name="id"/>
<xsl:param name="password"/>
<xsl:template match="login">
<user>
<execute-query xmlns="http://apache.org/cocoon/SQL/2.0">
<query>
SELECT id,password from USERS_TABLE where id = '<xsl:value-of
select="$id"/>' and password = '<xsl:value-of select="$password"/>'
</query>
</execute-query>
</user>
</xsl:template>
</xsl:stylesheet>

login form xsl:

<form action="{pipeline}" method="post">
Your Name/Id : <input type="text" name="{idfield}"/><br/>
Your Password: <input type="password" name="{passfield}"/> <p/>
<input type="submit" value="login"/>
</form>

Thanks for your help
Adam
Jul 17 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.