Session problems!!!
How does sessions work??? I created a login form like in the Cocoon developer's handbook chapter8, then the login xsp page as in the book. That works, I get on my page something like this User 'Guest' has been authentificated but when I write xsp-session:get-attribute name=user/ I don't get anything!!! Please help! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Session problems!!!
Maxime, have you already checked the list of attributes by using: xsp-session:get-attribute-names as=xml/ ? This in order to know whether it has been created (and then it is a problem with its value), or it has not (and then it is a sesison problem). Regards, - Luca Morandini GIS Consultant [EMAIL PROTECTED] http://utenti.tripod.it/lmorandini/index.html - -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Friday, February 21, 2003 9:27 AM To: [EMAIL PROTECTED] Subject: Session problems!!! How does sessions work??? I created a login form like in the Cocoon developer's handbook chapter8, then the login xsp page as in the book. That works, I get on my page something like this User 'Guest' has been authentificated but when I write xsp-session:get-attribute name=user/ I don't get anything!!! Please help! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Session problems!!!
When I write xsp-session:get-attribute-names as=xml/ I don't get anything. Does that mean my session is not created? But I specified xsp:page language=java xmlns:xsp=http://apache.org/xsp; xmlns:xsp-session=http://apache.org/xsp/session/2.0; create-session=true And then xsp-session:set-attributeuser/xsp-session:set-attribute; Where user=Guest -Original Message- From: Luca Morandini [mailto:[EMAIL PROTECTED]] Sent: Friday, February 21, 2003 9:38 AM To: [EMAIL PROTECTED] Subject: RE: Session problems!!! Maxime, have you already checked the list of attributes by using: xsp-session:get-attribute-names as=xml/ ? This in order to know whether it has been created (and then it is a problem with its value), or it has not (and then it is a sesison problem). Regards, - Luca Morandini GIS Consultant [EMAIL PROTECTED] http://utenti.tripod.it/lmorandini/index.html - -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Friday, February 21, 2003 9:27 AM To: [EMAIL PROTECTED] Subject: Session problems!!! How does sessions work??? I created a login form like in the Cocoon developer's handbook chapter8, then the login xsp page as in the book. That works, I get on my page something like this User 'Guest' has been authentificated but when I write xsp-session:get-attribute name=user/ I don't get anything!!! Please help! - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Session problems!!!
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Friday, February 21, 2003 9:53 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: Session problems!!! When I write xsp-session:get-attribute-names as=xml/ I don't get anything. Does that mean my session is not created? But I specified xsp:page language=java xmlns:xsp=http://apache.org/xsp; xmlns:xsp-session=http://apache.org/xsp/session/2.0; create-session=true And then xsp-session:set-attributeuser/xsp-session:set-attribute; Where user=Guest shouldn't it be: xsp-session:set-attribute name=useruser/xsp-session:set-attribute ? Regards, - Luca Morandini GIS Consultant [EMAIL PROTECTED] http://utenti.tripod.it/lmorandini/index.html - - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Session problems!!!
Both are correct. The problem is somewhere with the creation of the session. When I write xsp-session:get-attribute-names as=xml/ I don't get anything. Does that mean my session is not created? But I specified xsp:page language=java xmlns:xsp=http://apache.org/xsp; xmlns:xsp-session=http://apache.org/xsp/session/2.0; create-session=true And then xsp-session:set-attributeuser/xsp-session:set-attribute; Where user=Guest but xsp-session:get-attribute name=user/ is null too! shouldn't it be: xsp-session:set-attribute name=useruser/xsp-session:set-attribute ? Regards, - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Session problems!!!
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Friday, February 21, 2003 10:05 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: Session problems!!! Both are correct. The problem is somewhere with the creation of the session. Let's put it this way: this works just fine on my 2.0.3: ?xml version=1.0 encoding=iso-8859-1 standalone=yes? xsp:page xmlns:xsp=http://apache.org/xsp; xmlns:xsp-session=http://apache.org/xsp/session/2.0; create-session=true page xsp-session:set-attribute name=status/ xsp:logic String user=guest; /xsp:logic xsp-session:set-attribute name=userxsp:expruser/xsp:expr/xsp-session:set-attribute xsp-session:get-attribute-names as=xml/ xsp-session:get-attribute name=user as=xml/ /page /xsp:page Regards, - Luca Morandini GIS Consultant [EMAIL PROTECTED] http://utenti.tripod.it/lmorandini/index.html - - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Session problems!!!
If I copy the code you have I get nothing! Just Guest But that's because of xsp:expruser/xsp:expr, and when I write xsp-session:get-attribute name=user as=xml/ I don't get anything! -Original Message- From: Luca Morandini [mailto:[EMAIL PROTECTED]] Sent: Friday, February 21, 2003 10:34 AM To: [EMAIL PROTECTED] Subject: RE: Session problems!!! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Friday, February 21, 2003 10:05 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: Session problems!!! Both are correct. The problem is somewhere with the creation of the session. Let's put it this way: this works just fine on my 2.0.3: ?xml version=1.0 encoding=iso-8859-1 standalone=yes? xsp:page xmlns:xsp=http://apache.org/xsp; xmlns:xsp-session=http://apache.org/xsp/session/2.0; create-session=true page xsp-session:set-attribute name=status/ xsp:logic String user=guest; /xsp:logic xsp-session:set-attribute name=userxsp:expruser/xsp:expr/xsp-session:set-attribute xsp-session:get-attribute-names as=xml/ xsp-session:get-attribute name=user as=xml/ /page /xsp:page Regards, - Luca Morandini GIS Consultant [EMAIL PROTECTED] http://utenti.tripod.it/lmorandini/index.html - - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Session problems!!!
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Friday, February 21, 2003 10:42 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: Session problems!!! If I copy the code you have I get nothing! Just Guest But that's because of xsp:expruser/xsp:expr, and when I write xsp-session:get-attribute name=user as=xml/ I don't get anything! Hmm... therefore it should be something related to your environment, have you already searched the list or bugzilla for such anomalies ? BTW, which environment are you working on (mine is Tomcat 4.0.1 and Cocoon 2.0.3 on Windows 2000) ? Regards, - Luca Morandini GIS Consultant [EMAIL PROTECTED] http://utenti.tripod.it/lmorandini/index.html - - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Session problems!!!
The versions are the same, I'm just using it under Windows NT4 SP6. I'll try to copy the sample and modify it... What is bugzilla? -Original Message- From: Luca Morandini [mailto:[EMAIL PROTECTED]] Sent: Friday, February 21, 2003 10:48 AM To: [EMAIL PROTECTED] Subject: RE: Session problems!!! -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Friday, February 21, 2003 10:42 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: Session problems!!! If I copy the code you have I get nothing! Just Guest But that's because of xsp:expruser/xsp:expr, and when I write xsp-session:get-attribute name=user as=xml/ I don't get anything! Hmm... therefore it should be something related to your environment, have you already searched the list or bugzilla for such anomalies ? BTW, which environment are you working on (mine is Tomcat 4.0.1 and Cocoon 2.0.3 on Windows 2000) ? Regards, - Luca Morandini GIS Consultant [EMAIL PROTECTED] http://utenti.tripod.it/lmorandini/index.html - - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Session problems!!!
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Friday, February 21, 2003 10:50 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: Session problems!!! The versions are the same, I'm just using it under Windows NT4 SP6. I'll try to copy the sample and modify it... What is bugzilla? The bug repository of Cocoon (well, of many other projects, actually), check it out at: http://nagoya.apache.org/bugzilla/index.html - Luca Morandini GIS Consultant [EMAIL PROTECTED] http://utenti.tripod.it/lmorandini/index.html - - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
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]
AW: AW: Session problems
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
-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]
Re: AW: Session problems
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). Well, the second idea works fine as i've already tested it and...guess what? there are 2 different indipendent session. I put user/pwd values in the session first in the check_login.jsp page, and then send them via form/action/post/submit to the cocoon environment to let them be stored in the session of coccon. In this way, i got two session with the same values that i can retrieve in tomcat or cocoon as for my needs. This system looks like a bit non pro. it's just a way of getting round the obstacle. i don't know if this is the right way. The first idea seems likely the most useful, but i really CANT have my jsp be compiled inside the cocoon env. Just to understand my system i use redhat8, tomcat 4.0.4 and cocoon 2.0.3 I've tryed to have a jsp page be served by cocoon but i got a 505 server error pagewhat a tricky situation :) ill keep on trying see ya later thanks. 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]
Session problems
Hi. I have a problem with a jsp page and a cocoon page. I use jsp to simply check a user/password and if all is right then set some variables in the session.setAttribute. I then redirect the user to a cocoon page in wich i should grab the session variable with some xsp-logic commands buti can't see them! Ok...all of you are saying What a stupid newbie :). I know, but pls, it's been a lot of headaches trying to solve this but i still.have headaches. This is the code inside the jsp page: check_login.jsp * session.setAttribute( username, theRealUser ); session.setAttribute( azienda, theRealFirm); //pfw is my custom file format :) response.sendRedirect( /pfw/rv3/setup_env.pfw ); ** cocoon page setup_env.pfw *** ?xml version=1.0? ?cocoon-process type=xsp? ?cocoon-process type=xslt? xsp:page language=java xmlns:xsp=http://apache.org/xsp; xmlns:xsp-session=http://apache.org/xsp/session/2.0; xmlns:xsp-request=http://apache.org/xsp/request/2.0; xsp:structure xsp:includejava.util.*/xsp:include xsp:includejava.io.*/xsp:include xsp:includejava.text.*/xsp:include xsp:includejavax.*/xsp:include xsp:includejavax.*/xsp:include xsp:includeorg.apache.cocoon.environment.Session/xsp:include /xsp:structure PAGE AZIENDA xsp-session:get-attribute name=azienda / /AZIENDA UTENTE xsp-session:get-attribute name=username / /UTENTE /PAGE /xsp:page the tag AZIENDA and UTENTE are always empty!!! Can anyone help this stupid problem? thanks! R.C. - 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: Session problems
hi roberto, the reason why your elements are empty probably are the following; the session accessed in your XSP might be different from the JSP's session. since you redirect without url encoding the redirect url, the session probably doesn't survive the redirect. now in the XSP you didn't specify the xsp:page's attribute create-session=false (which is handled by the session logicsheet), which defaults to true, thus a new session is created in the XSP. I don't know if your sessions are cookie or url rewriting based. anyway, you should be url encoding the redirect url, see inline comments below. -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]Im Auftrag von Roberto Cipollini Gesendet: Donnerstag, 6. Februar 2003 18:40 An: [EMAIL PROTECTED] Betreff: Session problems Hi. I have a problem with a jsp page and a cocoon page. I use jsp to simply check a user/password and if all is right then set some variables in the session.setAttribute. I then redirect the user to a cocoon page in wich i should grab the session variable with some xsp-logic commands buti can't see them! Ok...all of you are saying What a stupid newbie :). I know, but pls, it's been a lot of headaches trying to solve this but i still.have headaches. This is the code inside the jsp page: check_login.jsp * session.setAttribute( username, theRealUser ); session.setAttribute( azienda, theRealFirm); //pfw is my custom file format :) response.sendRedirect( /pfw/rv3/setup_env.pfw ); this line should be something like: response.sendRedirect(response.encodeRedirectURL (/pfw/rv3/setup_env.pfw)); ** cocoon page setup_env.pfw *** ?xml version=1.0? ?cocoon-process type=xsp? ?cocoon-process type=xslt? xsp:page language=java xmlns:xsp=http://apache.org/xsp; xmlns:xsp-session=http://apache.org/xsp/session/2.0; xmlns:xsp-request=http://apache.org/xsp/request/2.0; xsp:structure xsp:includejava.util.*/xsp:include xsp:includejava.io.*/xsp:include xsp:includejava.text.*/xsp:include xsp:includejavax.*/xsp:include xsp:includejavax.*/xsp:include xsp:includeorg.apache.cocoon.environment.Session/xsp:include /xsp:structure PAGE AZIENDA xsp-session:get-attribute name=azienda / /AZIENDA UTENTE xsp-session:get-attribute name=username / /UTENTE /PAGE /xsp:page the tag AZIENDA and UTENTE are always empty!!! Can anyone help this stupid problem? thanks! R.C. - 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] - 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]
Re: AW: Session problems
hy, i would like to understand, in which context your servlet is running. Is it located within the cocoon webapp, or is it located elsewhere? from the redirect url i guess you are crossing webapplications ... If this is the case, you have another problem with session preserving over multiple webapps. there are solutions to this, but this is far from trivial... 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, 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 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, the reason why your elements are empty probably are the following; the session accessed in your XSP might be different from the JSP's session. since you redirect without url encoding the redirect url, the session probably doesn't survive the redirect. now in the XSP you didn't specify the xsp:page's attribute create-session=false (which is handled by the session logicsheet), which defaults to true, thus a new session is created in the XSP. I don't know if your sessions are cookie or url rewriting based. anyway, you should be url encoding the redirect url, see inline comments below. -Ursprüngliche Nachricht- Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]Im Auftrag von Roberto Cipollini Gesendet: Donnerstag, 6. Februar 2003 18:40 An: [EMAIL PROTECTED] Betreff: Session problems Hi. I have a problem with a jsp page and a cocoon page. I use jsp to simply check a user/password and if all is right then set some variables in the session.setAttribute. I then redirect the user to a cocoon page in wich i should grab the session variable with some xsp-logic commands buti can't see them! Ok...all of you are saying What a stupid newbie :). I know, but pls, it's been a lot of headaches trying to solve this but i still.have headaches. This is the code inside the jsp page: check_login.jsp * session.setAttribute( username, theRealUser ); session.setAttribute( azienda, theRealFirm); //pfw is my custom file format :) response.sendRedirect( /pfw/rv3/setup_env.pfw ); this line should be something like: response.sendRedirect(response.encodeRedirectURL (/pfw/rv3/setup_env.pfw)); ** cocoon page setup_env.pfw *** ?xml version=1.0? ?cocoon-process type=xsp? ?cocoon-process type=xslt? xsp:page language=java xmlns:xsp=http://apache.org/xsp; xmlns:xsp-session=http://apache.org/xsp/session/2.0; xmlns:xsp-request=http://apache.org/xsp/request/2.0; xsp:structure xsp:includejava.util.*/xsp:include xsp:includejava.io.*/xsp:include xsp:includejava.text.*/xsp:include xsp:includejavax.*/xsp:include xsp:includejavax.*/xsp:include xsp:includeorg.apache.cocoon.environment.Session/xsp:include /xsp:structure PAGE AZIENDA xsp-session:get-attribute name=azienda / /AZIENDA UTENTE xsp-session:get-attribute name=username / /UTENTE /PAGE /xsp:page the tag AZIENDA and UTENTE are always empty!!! Can anyone help this stupid problem? thanks! R.C. - 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] - 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] -- Dr. Hussayn Dabbous SAXESS Software Design GmbH Neuenhöfer Allee 125 D-50935 Köln tel.:+49 221 56011 0 fax.:+49 221-56011 20 email:[EMAIL PROTECTED] - 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]
SESSION PROBLEMS
Hi, I'm trying to convert an old C1 application in C2, but I found a lot of problems. All session (request/response) management has changed. For example: with C1 I wrote: xsp:logic if ((session.isNew()) and (myVariable == myValue)) { . . response.sendRedirect(response.encodeURL(My URL)); } /xsp:logic Now, with C2, how can I do this? I tried with this but without success: xsp:logic if ((session:is-new/) and (myVariable == myValue)) { . . response.sendRedirect(response.encodeURL(My URL)); } /xsp:logic Line 149, column 33: Method sendRedirect(java.lang.String) not found in interface org.apache.cocoon.environment.Response and, , another problem: if I write xsp:logic if ((session.isNew()) and (myVariable == myValue)) { . . . } /xsp:logic Cocoon return me: Line 121, column 8: Undefined variable or class name: session why? In the Cocoon examples I read a document like this (whith session object used instead of xsp tags) Please, help me! --- Outgoing mail is certified Virus Free. (FLASHH!) Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.338 / Virus Database: 189 - Release Date: 14/03/02 - 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: SESSION PROBLEMS
Stefano Bonnin wrote: Hi, I'm trying to convert an old C1 application in C2, but I found a lot of problems. All session (request/response) management has changed. For example: with C1 I wrote: xsp:logic if ((session.isNew()) and (myVariable == myValue)) { . . response.sendRedirect(response.encodeURL(My URL)); } /xsp:logic Now, with C2, how can I do this? I tried with this but without success: xsp:logic if ((session:is-new/) and (myVariable == myValue)) { . . response.sendRedirect(response.encodeURL(My URL)); } /xsp:logic Line 149, column 33: Method sendRedirect(java.lang.String) not found in interface org.apache.cocoon.environment.Response and, , another problem: if I write xsp:logic if ((session.isNew()) and (myVariable == myValue)) { . . . } /xsp:logic Cocoon return me: Line 121, column 8: Undefined variable or class name: session why? In the Cocoon examples I read a document like this (whith session object used instead of xsp tags) Please, help me! --- Outgoing mail is certified Virus Free. (FLASHH!) Checked by AVG anti-virus system (http://www.grisoft.com). Version: 6.0.338 / Virus Database: 189 - Release Date: 14/03/02 - 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] Try for use that xsp-session:is-new/ :) Regards. Yury. - 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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]