cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christoph Stocker" <chris.stoc...@gmx.at>
Subject AW: once again urlrewriting
Date Tue, 29 Oct 2002 16:10:12 GMT
hi!

ok - i changed this, but the problem is still there.

but thank your for your hint.


greetings, chris


-----Urspr√ľngliche Nachricht-----
Von: Peter Nuetzel . inglobo [mailto:peter.nuetzel@inglobo.de] 
Gesendet: Dienstag, 29. Oktober 2002 13:02
An: cocoon-users@xml.apache.org
Betreff: Re: once again urlrewriting


Hi

I don't know what may cause your problem. But I realized that your
sitemap snippet is wrong: The <map:serialize> must be in the <map:act>
element

-peter

> .
> .
> <map:match pattern="startOR">
>    <map:act type="ORAction">
>       <map:generate src="orneu/{nextpage}.xsp" type="serverpages"/>
>       <map:transform src="orneu/xml2html.xsl" type="xslt"/> 
> <map:transform type="encodeURL"/>
>    </map:act>
>    <map:serialize type="html"/>
> </map:match>
>







---------------------------------------------------------------------
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:     <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>




hi all!

does nobody has an idea what my problem is?

please help, i can't continue my work!


greetings, chris

-----Urspr√ľngliche Nachricht-----
Von: Christoph Stocker [mailto:chris.stocker@gmx.at] 
Gesendet: Montag, 28. Oktober 2002 11:46
An: cocoon-users@xml.apache.org
Betreff: once again urlrewriting


hi all!

i use cocoon 2.0.2, win2000 and weblogic 6.0sp2

sorry to write again about my problem with url-rewriting.
i want to tell again, in a detailed from, my problem. maybe someone can
help me.



i wrote a web-app using a java action described in
http://comphy.fsu.edu/xml/docs/actions.html with additional
session-handling. with the use of cookies, everthing is fine - now i
want to do it with url-rewriting and i did it the following way.


my action looks as following (here a code snipped from the main-part)
--->

package com.isolab.or.action;

import org.apache.avalon.framework.parameters.Parameters;
import org.apache.cocoon.acting.AbstractAction;
import org.apache.cocoon.Constants;
import org.apache.cocoon.environment.Redirector;
import org.apache.cocoon.environment.Request;
import org.apache.cocoon.environment.SourceResolver;
import org.apache.cocoon.environment.Session;
import org.apache.cocoon.environment.ObjectModelHelper;
import org.apache.cocoon.environment.Response;

import java.util.*;
import java.util.Map;
import java.util.HashMap;

public class ORMainAction extends AbstractAction {

  public Map act(Redirector redirector, SourceResolver resolver, Map
objectModel,
            String source, Parameters params) {


      Map sitemapParams = new HashMap();
      Request req = ObjectModelHelper.getRequest(objectModel);
      Session session = req.getSession();


	if (session.isNew()) {
	   session.setAttribute("atr1", "TestAttribute1");		

         sitemapParams.put("nextpage", "test1");
	}
	else {
         session.setAttribute("atr2", "TestAttribute2");

	   sitemapParams.put("nextpage", "test2");
	}    

      return sitemapParams;
  }
}


my sitemap looks as following -->
as described in 
http://xml.apache.org/cocoon/userdocs/transformers/encodeurl-transformer
.html

.
.
<map:transformer logger="sitemap.transformer.encodeURL" name="encodeURL"
src="org.apache.cocoon.transformation.EncodeURLTransformer"/>
.
.
<map:action name="ORAction" src="com.isolab.or.action.ORMainAction"/>
.
.
.
<map:match pattern="startOR">
   <map:act type="ORAction">
      <map:generate src="orneu/{nextpage}.xsp" type="serverpages"/>
      <map:transform src="orneu/xml2html.xsl" type="xslt"/>
	<map:transform type="encodeURL"/>
   </map:act>
   <map:serialize type="html"/>
 </map:match>



i turned off the use of cookies in my weblogic-property file
"weblogic.xml"


------->
if i call my page an the action is called the first time, everthing
works fine (a new session is created, ...). but the second time with the
same browser (when the session is still there), the session is creted
again). this doesn't happen when i enable cookies in my "welogic.xml"
propertiy file

"welogic.xml" -->

<?xml version="1.0" encoding="UTF-8"?>
<weblogic-web-app>
	<session-descriptor>
		<session-param>
			<param-name>CookiesEnabled</param-name>
			<param-value>True</param-value>
		</session-param>
		<session-param>
			<param-name>URLRewritingEnabled</param-name>
			<param-value>True</param-value>
		</session-param>
		<session-param>
			<param-name>SessionTrackingEnabled</param-name>
			<param-value>True</param-value>
		</session-param>
	</session-descriptor>
</weblogic-web-app>


i studied the EncodeURLTransformer, but it doesn't helped me (i don't
know how to 
in my action use this for url-rewriting)

i also read chapters in some books about url-rewriting, they always use
response.encodeURL("URL"); 

but how can i use this response in my action?
what do i have to modify?
how can i use the EncodeURLTransformer in my action? do i have to do
this? is the only part to change, to use url-rewriting to insert
<map:serialize type="html"/> in my sitemap?


are there some examples or has someone examples doing url-rewriting with
cocoon and actions.

i tried several tasks, but it always leeds to the error (every time a
new session is creted and the previous session information is lost)
described above. please help, if someone has an answere.

greetings, chris


---------------------------------------------------------------------
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:     <cocoon-users-unsubscribe@xml.apache.org>
For additional commands, e-mail:   <cocoon-users-help@xml.apache.org>


Mime
View raw message