AW: AW: Session problems

2003-02-07 Thread Marco Rolappe
hi roberto, please see bottom of mail.

 -Ursprüngliche Nachricht-
 Von: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED]]Im
 Auftrag von Roberto Cipollini
 Gesendet: Freitag, 7. Februar 2003 10:16
 An: [EMAIL PROTECTED]; [EMAIL PROTECTED]
 Betreff: Re: AW: Session problems


 Unfortunatly the encodeRedirectURL did not work :(

 It may sounds good i have crossing webapplications.

 My goal is to have a single deployment of cocoon under the
 jakarta dir, and
 store all the file of multiple virtualhosts in another directory
 (/usr/webapps/.).

 I got it working  [maybe it's wrong] configuring the tomcat server.xml to
 redirct some requests to the cocoon container and then let cocoon do the
 job.
 Just to understand the prefix/suffix:
 pfw is my cocoon environment. it stands for Publishing Frame Work and in
 all my virtual hosts uri i know that when calling the pfw i invoke the
 cocoon entity.
 ex: myvh.com/index.jsp -- tomcat
 myvh.com/pfw/myvh/read.pfw --cocoon [where pfw is a page generated from
 sitemap.xmap stored in /usr/webapps/myvh/pfw/sitemap.xmap virtual host
 directory]
 This is a pice of my server.xml:

 host name=myvh.com appBase=/usr/webapps/myvh  autoDeploy=0
 Context reloadable=true path=/pfw
 docBase=/opt/jakarta-tomcat-4.0.4/webapps/cocoon debug=0
 Context reloadable=true path=*.pfw
 docBase=/opt/jakarta-tomcat-4.0.4/webapps/cocoon debug=0
 /host

 When i invoke something in the url like
 myvh.com/pfw/myvh/page.pfw , tomcat
 redirect the request to cocoon to process the request.
 Cocoon knows what to do :) in the master subsitemap.xmap there's this
 fragment code:
 map:pipeline
 map:match pattern=myvh/**
 map:mount check-reload=yes
 src=file:///usr/webapps/myvh/pfw/sitemap.xmap uri-prefix=myvh /
 /map:pipeline


 In the sub sitemap.xamp stored in the myvh dir there's this fragment code:

 map:match pattern=*.pfw
 map:aggregate element=ALL 
 map:part src=setup_env.xml
 map:part src=cocoon:/{1}.xml
 /map:aggregate
 map:transform src=xsl/{1}.xsl /
 map:serialize type=html /

 /map:match



 So, after all, do you think i cross? I don't know if this call/over-call
 procedure is fine and if this is the cause of my session failure.

 Can anyone help?

 bye.
 Roberto



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


yes, you're crossing contexts (which I totally forgot to mention in the
beginning).

 ex: myvh.com/index.jsp -- tomcat
 myvh.com/pfw/myvh/read.pfw --cocoon [where pfw is a page generated from
 sitemap.xmap stored in /usr/webapps/myvh/pfw/sitemap.xmap virtual host
 directory]
 This is a pice of my server.xml:

 host name=myvh.com appBase=/usr/webapps/myvh  autoDeploy=0
 Context reloadable=true path=/pfw
 docBase=/opt/jakarta-tomcat-4.0.4/webapps/cocoon debug=0
 Context reloadable=true path=*.pfw
 docBase=/opt/jakarta-tomcat-4.0.4/webapps/cocoon debug=0
 /host

that means, that the JSP and the cocoon stuff live in seperate (webapp)
contexts (you can of course let cocoon handle JSPs). thus, the
encodeRedirectURL can't work, of course. note though that the
encodeRedirectURL should be done when redirecting within your webapp. for
url rewriting based sessions, this appends the ';JSESSIONID=...' to the url.
so, not doing this causes losing the session then.

so what can you do? from the top of my head two ideas:

1. let cocoon handle the JSPs
2. deliver the parameters (username/pw) via request parameters/attributes
(don't know if the latter works, though).



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




AW: AW: Session problems

2003-02-07 Thread Marco Rolappe


 -Ursprüngliche Nachricht-
 Von: [EMAIL PROTECTED]
 [mailto:[EMAIL PROTECTED]]Im
 Auftrag von SAXESS - Hussayn Dabbous
 Gesendet: Donnerstag, 6. Februar 2003 21:07
 An: [EMAIL PROTECTED]
 Betreff: Re: AW: Session problems


snip/


 If your servlet runs in the same context as cocoon, then i can't see
 at the moment, why you loose your session. from the standard
 behaviour of a servlet container i would expect, that once a session
 is created within one context, this session is kept. I dont think,

my point here was url encoding based session tracking. if cookies are
switched off url encoding is used to keep track of the session (via the
appended ';JSESSIONID=...'). so if you don't encode your urls correctly you
lose your session (in case of url based...).

 that xsp will always create new sessions. if create-session=true
 I would expect, it creates a session, if none is existing, but once a

well, it does (non-believer ;-), at least in 2.0.4. here the snippet from
the session logicsheet:

...
  xsl:variable name=create
xsl:choose
  xsl:when test=@create-session='yes' or
@create-session='true'true/xsl:when
  xsl:when test=@create-session='no' or
@create-session='false'false/xsl:when
  xsl:otherwisetrue/xsl:otherwise
/xsl:choose
  /xsl:variable
  xsp:init-page
Session session = request.getSession(xsl:value-of
select=$create/);
  /xsp:init-page
...


 session is created it should be keep living for subsequent requests...

 After having saying this, i bet you cross webapp boundaries ...

 regards, hussayn

 Marco Rolappe wrote:

  hi roberto,
 

snip/


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