You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Hiloliddin Karimov <HK...@central.nbu.com> on 2002/05/06 12:55:26 UTC

keep url

Hi all,

I have Login page and action pages ( for example add-action, update-action,
delete-action, ... ).
And all action pages need authorization.
So, I want that when not authorized client go to the action page (
add-action.html ), to keep the url ( add-action.html ) and redirect to the
Login page, after successfully authorization redirect again to the kept url
( add-action.html ).
Can I keep url to session in the sitemap? how?
or how can I do it?
here what I have in the sitemap:

  <map:match pattern="*-action.html">
    <map:act type="session-validator">
      <map:parameter name="descriptor"
value="context://myapp4/descriptors/params.xml"/>
      <map:parameter name="validate" value="username"/>

      <map:match pattern="*-action.html">
        <map:act set="process">
          <map:parameter name="descriptor"
value="context://myapp4/templates/user_form.xml"/>
          <map:generate type="serverpages"
src="templates/confirm_action.xsp"/>
          <map:transform src="stylesheets/myapp.xsl"/>
          <map:serialize/>
        </map:act>

        <map:generate type="serverpages" src="templates/{1}_action.xsp"/>
        <map:transform src="stylesheets/myapp.xsl"/>
        <map:serialize/>
      </map:match>

    </map:act>
    <!-- here I must keep url "{1}_action.xsp" -->
    <map:redirect-to uri="login.html"/>
  </map:match>


  <map:match pattern="login.html">
    <map:act type="form-validator">
      <map:parameter name="descriptor"
value="context://myapp4/descriptors/params.xml"/>
      <map:parameter name="validate" value="username,password"/>
      <map:act type="db-authenticator">
        <map:parameter name="descriptor"
value="context://myapp4/descriptors/auth.xml"/>
        <!-- here redirect to kept url -->
        <map:redirect-to uri="kept-action.html"/>
      </map:act>
    </map:act>
    <map:generate type="serverpages" src="templates/login.xsp"/>
    <map:transform src="stylesheets/myapp.xsl"/>
    <map:serialize/>
  </map:match>

Thanks lot,
~Hill

Cocoon 2.0; Tomcat 4.0; JDK SDK 1.3.1; OS WinNT 4.0;

---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

To unsubscribe, e-mail: <co...@xml.apache.org>
For additional commands, e-mail: <co...@xml.apache.org>