The attached files do something like you want ...

> Hi,
>
> I'm having a hard time understanding the tutorial on authentication from
> the coccon website.
> My case:
> I have a loginpage (login) with a field for user and password. If the user
> is logged in successfully, he should be redirected to services, which is
> protected.
> My questions:
> How / Where do I check the parameters, if I wanna check the parameters with
> entries in a database.
>
> If I try to access the page services now directly, I get the following
> error message:
>
> The
> org.apache.cocoon.www.file_.C_.Apache_Group.Tomcat_4_1.webapps.cocoon.mount
>.fraud.sitemap_xmap notifies that
> org.apache.avalon.framework.component.ComponentException says:
> UnnamedSelector: ComponentSelector could not find the component for hint
> [auth-protect]
> More precisely:
> org.apache.avalon.framework.component.ComponentException: UnnamedSelector:
> ComponentSelector could not find the component for hint [auth-protect]
>
> Here is my sitemap:
>
>                  ....
>                  ....
>       <map:matchers default="wildcard"/>
>       </map:components>
>       <!-- =========================== Pipelines
> ================================= -->
>       <map:pipelines>
>             <map:component-configurations>
>                         <authentication-manager>
>                               <handlers>
>                                           <handler name="userPortal">
>                                                 <redirect-to uri="login"/>
>                                                 <authentication uri
> ="userLogin"/>
>                                           </handler>
>                                     </handlers>
>                         </authentication-manager>
>             </map:component-configurations>
>             <map:pipeline>
>                   <map:match pattern="login">
>                         <map:generate type="xsp" src="login.xsp"/>
>                         <map:serialize/>
>                   </map:match>
>                   <map:match pattern="userLogin">
>                         <map:act type="auth-login">
>                               <map:parameter name="handler" value
> ="userPortal"/>
>                               <map:parameter name="parameter_userid" value
> ="{request:user}"/>
>                               <map:parameter name="parameter_password"
> value="{request:password}"/>
>                               <map:redirect-to uri="services"/>
>                         </map:act>
>                         <!-- authentication failed: Back to login-page -->
>                         <map:generate type="xsp" src="login.xsp"/>
>                         <map:serialize/>
>                   </map:match>
>                   <map:match pattern="services">
>                         <map:act type="auth-protect">
>                               <map:parameter name="handler" value
> ="userPortal"/>
>                               <map:generate type="xsp" src="services.xsp"/>
>                               <map:serialize/>
>                         </map:act>
>                   </map:match>
>
> Greetings
> Jonny
>
> ---------------------------------------------------------------------------
>-------------------------
>
> This electronic message contains information from the mmo2 plc Group which
> may be
> privileged or confidential. The information is intended to be for the use
> of the
> individual(s) or entity named above. If you are not the intended recipient
> be aware
> that any disclosure, copying, distribution or use of the contents of this
> information
> is prohibited. If you have received this electronic message in error,
> please notify
> us by telephone or email (to the numbers or address above) immediately.
>
>
>
>
> ---------------------------------------------------------------------
> Please check that your question  has not already been answered in the
> FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>
>
> To unsubscribe, e-mail:     <[EMAIL PROTECTED]>
> For additional commands, e-mail:   <[EMAIL PROTECTED]>

-- 
Kind regards,
Yves Vindevogel

Implements
Kortrijkstraat 2 bus 1  --  9700 Oudenaarde  --  Belgium
Phone/Fax: +32 (55) 45.74.73  --  Mobile: +32 (478) 80.82.91
Mail: [EMAIL PROTECTED]  --  www.implements.be

Quote: The winner never says participating is more important than winning.
<?xml version="1.0" encoding="ISO-8859-1"?>

    <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">

        <html>

            <esql:connection>
                <esql:pool>pierrefabre</esql:pool>

                <esql:execute-query>
			<esql:query>
				select * from tblLogin
                                	where name = '<xsp-request:get-parameter name="username"/>'
                                 	and password = '<xsp-request:get-parameter name="password"/>' ;
			</esql:query>

                    <esql:results>
			<xsp-session:set-attribute name="user">admin</xsp-session:set-attribute>
                        
		    	<body onload="window.location = './../frames.html'"></body>
                    </esql:results>

		    <esql:no-results>
		            	<head>
                			<link rel="stylesheet" type="text/css" href="./../css/pierrefabre.css"/>
                			<title>Pierre Fabre Médicament</title>
                                        <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
            			</head>

				<body class="top" onload="window.alert ('Mot de passe ou nom d' + '&quot;' + 'utilisateur ne sont pas corrects') ; window.location = './../admin/password.html'">
				</body>
		    </esql:no-results>
                </esql:execute-query>

            </esql:connection>
	</html>
    </xsp:page>
Utilisateur:
Mot de passe:
---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail:     <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>

Reply via email to