Re: [S2] struts 2.1.3: share portlet session with servlet (yui ajax)
I have found a solution. I have to set a cookie with JSESSIONID in my JSP (view.jsp). So the ajax request shares the same session and I can get the session object. Nils-Helge Garli Hegvik schrieb: Did you try the suggestion of encoding the session id in the url? It does sound strange indeed. Have you tried deploying to a different container, like pluto? Nils-H On Fri, Jan 16, 2009 at 4:47 PM, Frank Otto o...@delta-barth.de wrote: Yes, but no answer with a solution. I think the problem ist, that the ajax-call create for each request a new session. It doesn't use the session-id of the portal/portlet. I have no idea. Here is an other forum thread of this topic: http://forums.oracle.com/forums/thread.jspa?threadID=341338start=15tstart=0 But there is no solution too. Frank Nils-Helge Garli Hegvik schrieb: Then I'm out of ideas. Have you tried posting to the portlet-container mailing list? Nils-H On Tue, Jan 13, 2009 at 11:03 AM, Frank Otto o...@delta-barth.de wrote: I have found out, that the attribute emptySessionPath is like this: session-config cookie-properties property name=cookiePath value=/ / /cookie-properties /session-config But, it does not solve my problem. :-( Nils-Helge Garli Hegvik schrieb: This one: https://portlet-container.dev.java.net/ ? Haven't tried it. Have you tried posting to their mailing list? Maybe the information at http://wiki.apache.org/portals/Pluto/InstallPlutoGlassfish could be relevant. Nils-H On Tue, Jan 13, 2009 at 10:25 AM, Frank Otto o...@delta-barth.de wrote: The portlet and servlet are in the same war. I use glassfish with portlet container 1.0 for develop. I have read the emptySessionPath must be true for the connector (tomcat). How can I set this for classfish? Nils-Helge Garli Hegvik schrieb: Are both the portlet and the servlet in the same application (war file)? What container are you using? Nils-H On Tue, Jan 13, 2009 at 9:55 AM, Frank Otto o...@delta-barth.de wrote: hi, I have a portlet with struts. It works fine, but I can't share objects in my portlet session with the servlet/action for yui ajax calls. I set in my porlet struts 2 action an object in the portlet session: portletRequest.getPortletSession().setAttribute(MY_KEY, mySessionObject, PortletSession.APPLICATION_SCOPE); In the yui action I want get the object from the session scope: mySessionObject= (MySessionObject) servletRequest.getSession().getAttribute(MY_KEY); But is it null. I have no idea. I wonder that the session id for the portlet request is other than in the servlet request. Can someone help me please? kind regards, Frank - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: [S2] struts 2.1.3: share portlet session with servlet (yui ajax)
Did you try the suggestion of encoding the session id in the url? It does sound strange indeed. Have you tried deploying to a different container, like pluto? Nils-H On Fri, Jan 16, 2009 at 4:47 PM, Frank Otto o...@delta-barth.de wrote: Yes, but no answer with a solution. I think the problem ist, that the ajax-call create for each request a new session. It doesn't use the session-id of the portal/portlet. I have no idea. Here is an other forum thread of this topic: http://forums.oracle.com/forums/thread.jspa?threadID=341338start=15tstart=0 But there is no solution too. Frank Nils-Helge Garli Hegvik schrieb: Then I'm out of ideas. Have you tried posting to the portlet-container mailing list? Nils-H On Tue, Jan 13, 2009 at 11:03 AM, Frank Otto o...@delta-barth.de wrote: I have found out, that the attribute emptySessionPath is like this: session-config cookie-properties property name=cookiePath value=/ / /cookie-properties /session-config But, it does not solve my problem. :-( Nils-Helge Garli Hegvik schrieb: This one: https://portlet-container.dev.java.net/ ? Haven't tried it. Have you tried posting to their mailing list? Maybe the information at http://wiki.apache.org/portals/Pluto/InstallPlutoGlassfish could be relevant. Nils-H On Tue, Jan 13, 2009 at 10:25 AM, Frank Otto o...@delta-barth.de wrote: The portlet and servlet are in the same war. I use glassfish with portlet container 1.0 for develop. I have read the emptySessionPath must be true for the connector (tomcat). How can I set this for classfish? Nils-Helge Garli Hegvik schrieb: Are both the portlet and the servlet in the same application (war file)? What container are you using? Nils-H On Tue, Jan 13, 2009 at 9:55 AM, Frank Otto o...@delta-barth.de wrote: hi, I have a portlet with struts. It works fine, but I can't share objects in my portlet session with the servlet/action for yui ajax calls. I set in my porlet struts 2 action an object in the portlet session: portletRequest.getPortletSession().setAttribute(MY_KEY, mySessionObject, PortletSession.APPLICATION_SCOPE); In the yui action I want get the object from the session scope: mySessionObject= (MySessionObject) servletRequest.getSession().getAttribute(MY_KEY); But is it null. I have no idea. I wonder that the session id for the portlet request is other than in the servlet request. Can someone help me please? kind regards, Frank - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: [S2] struts 2.1.3: share portlet session with servlet (yui ajax)
Yes, but no answer with a solution. I think the problem ist, that the ajax-call create for each request a new session. It doesn't use the session-id of the portal/portlet. I have no idea. Here is an other forum thread of this topic: http://forums.oracle.com/forums/thread.jspa?threadID=341338start=15tstart=0 But there is no solution too. Frank Nils-Helge Garli Hegvik schrieb: Then I'm out of ideas. Have you tried posting to the portlet-container mailing list? Nils-H On Tue, Jan 13, 2009 at 11:03 AM, Frank Otto o...@delta-barth.de wrote: I have found out, that the attribute emptySessionPath is like this: session-config cookie-properties property name=cookiePath value=/ / /cookie-properties /session-config But, it does not solve my problem. :-( Nils-Helge Garli Hegvik schrieb: This one: https://portlet-container.dev.java.net/ ? Haven't tried it. Have you tried posting to their mailing list? Maybe the information at http://wiki.apache.org/portals/Pluto/InstallPlutoGlassfish could be relevant. Nils-H On Tue, Jan 13, 2009 at 10:25 AM, Frank Otto o...@delta-barth.de wrote: The portlet and servlet are in the same war. I use glassfish with portlet container 1.0 for develop. I have read the emptySessionPath must be true for the connector (tomcat). How can I set this for classfish? Nils-Helge Garli Hegvik schrieb: Are both the portlet and the servlet in the same application (war file)? What container are you using? Nils-H On Tue, Jan 13, 2009 at 9:55 AM, Frank Otto o...@delta-barth.de wrote: hi, I have a portlet with struts. It works fine, but I can't share objects in my portlet session with the servlet/action for yui ajax calls. I set in my porlet struts 2 action an object in the portlet session: portletRequest.getPortletSession().setAttribute(MY_KEY, mySessionObject, PortletSession.APPLICATION_SCOPE); In the yui action I want get the object from the session scope: mySessionObject= (MySessionObject) servletRequest.getSession().getAttribute(MY_KEY); But is it null. I have no idea. I wonder that the session id for the portlet request is other than in the servlet request. Can someone help me please? kind regards, Frank - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: [S2] struts 2.1.3: share portlet session with servlet (yui ajax)
hi, I have a portlet with struts. It works fine, but I can't share objects in my portlet session with the servlet/action for yui ajax calls. I set in my porlet struts 2 action an object in the portlet session: portletRequest.getPortletSession().setAttribute(MY_KEY, mySessionObject, PortletSession.APPLICATION_SCOPE); In the yui action I want get the object from the session scope: mySessionObject= (MySessionObject) servletRequest.getSession().getAttribute(MY_KEY); But is it null. I have no idea. I wonder that the session id for the portlet request is other than in the servlet request. Can someone help me please? kind regards, Frank - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: [S2] struts 2.1.3: share portlet session with servlet (yui ajax)
Are both the portlet and the servlet in the same application (war file)? What container are you using? Nils-H On Tue, Jan 13, 2009 at 9:55 AM, Frank Otto o...@delta-barth.de wrote: hi, I have a portlet with struts. It works fine, but I can't share objects in my portlet session with the servlet/action for yui ajax calls. I set in my porlet struts 2 action an object in the portlet session: portletRequest.getPortletSession().setAttribute(MY_KEY, mySessionObject, PortletSession.APPLICATION_SCOPE); In the yui action I want get the object from the session scope: mySessionObject= (MySessionObject) servletRequest.getSession().getAttribute(MY_KEY); But is it null. I have no idea. I wonder that the session id for the portlet request is other than in the servlet request. Can someone help me please? kind regards, Frank - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: [S2] struts 2.1.3: share portlet session with servlet (yui ajax)
The portlet and servlet are in the same war. I use glassfish with portlet container 1.0 for develop. I have read the emptySessionPath must be true for the connector (tomcat). How can I set this for classfish? Nils-Helge Garli Hegvik schrieb: Are both the portlet and the servlet in the same application (war file)? What container are you using? Nils-H On Tue, Jan 13, 2009 at 9:55 AM, Frank Otto o...@delta-barth.de wrote: hi, I have a portlet with struts. It works fine, but I can't share objects in my portlet session with the servlet/action for yui ajax calls. I set in my porlet struts 2 action an object in the portlet session: portletRequest.getPortletSession().setAttribute(MY_KEY, mySessionObject, PortletSession.APPLICATION_SCOPE); In the yui action I want get the object from the session scope: mySessionObject= (MySessionObject) servletRequest.getSession().getAttribute(MY_KEY); But is it null. I have no idea. I wonder that the session id for the portlet request is other than in the servlet request. Can someone help me please? kind regards, Frank - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: [S2] struts 2.1.3: share portlet session with servlet (yui ajax)
This one: https://portlet-container.dev.java.net/ ? Haven't tried it. Have you tried posting to their mailing list? Maybe the information at http://wiki.apache.org/portals/Pluto/InstallPlutoGlassfish could be relevant. Nils-H On Tue, Jan 13, 2009 at 10:25 AM, Frank Otto o...@delta-barth.de wrote: The portlet and servlet are in the same war. I use glassfish with portlet container 1.0 for develop. I have read the emptySessionPath must be true for the connector (tomcat). How can I set this for classfish? Nils-Helge Garli Hegvik schrieb: Are both the portlet and the servlet in the same application (war file)? What container are you using? Nils-H On Tue, Jan 13, 2009 at 9:55 AM, Frank Otto o...@delta-barth.de wrote: hi, I have a portlet with struts. It works fine, but I can't share objects in my portlet session with the servlet/action for yui ajax calls. I set in my porlet struts 2 action an object in the portlet session: portletRequest.getPortletSession().setAttribute(MY_KEY, mySessionObject, PortletSession.APPLICATION_SCOPE); In the yui action I want get the object from the session scope: mySessionObject= (MySessionObject) servletRequest.getSession().getAttribute(MY_KEY); But is it null. I have no idea. I wonder that the session id for the portlet request is other than in the servlet request. Can someone help me please? kind regards, Frank - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: [S2] struts 2.1.3: share portlet session with servlet (yui ajax)
Then I'm out of ideas. Have you tried posting to the portlet-container mailing list? Nils-H On Tue, Jan 13, 2009 at 11:03 AM, Frank Otto o...@delta-barth.de wrote: I have found out, that the attribute emptySessionPath is like this: session-config cookie-properties property name=cookiePath value=/ / /cookie-properties /session-config But, it does not solve my problem. :-( Nils-Helge Garli Hegvik schrieb: This one: https://portlet-container.dev.java.net/ ? Haven't tried it. Have you tried posting to their mailing list? Maybe the information at http://wiki.apache.org/portals/Pluto/InstallPlutoGlassfish could be relevant. Nils-H On Tue, Jan 13, 2009 at 10:25 AM, Frank Otto o...@delta-barth.de wrote: The portlet and servlet are in the same war. I use glassfish with portlet container 1.0 for develop. I have read the emptySessionPath must be true for the connector (tomcat). How can I set this for classfish? Nils-Helge Garli Hegvik schrieb: Are both the portlet and the servlet in the same application (war file)? What container are you using? Nils-H On Tue, Jan 13, 2009 at 9:55 AM, Frank Otto o...@delta-barth.de wrote: hi, I have a portlet with struts. It works fine, but I can't share objects in my portlet session with the servlet/action for yui ajax calls. I set in my porlet struts 2 action an object in the portlet session: portletRequest.getPortletSession().setAttribute(MY_KEY, mySessionObject, PortletSession.APPLICATION_SCOPE); In the yui action I want get the object from the session scope: mySessionObject= (MySessionObject) servletRequest.getSession().getAttribute(MY_KEY); But is it null. I have no idea. I wonder that the session id for the portlet request is other than in the servlet request. Can someone help me please? kind regards, Frank - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: [S2] struts 2.1.3: share portlet session with servlet (yui ajax)
I have found out, that the attribute emptySessionPath is like this: session-config cookie-properties property name=cookiePath value=/ / /cookie-properties /session-config But, it does not solve my problem. :-( Nils-Helge Garli Hegvik schrieb: This one: https://portlet-container.dev.java.net/ ? Haven't tried it. Have you tried posting to their mailing list? Maybe the information at http://wiki.apache.org/portals/Pluto/InstallPlutoGlassfish could be relevant. Nils-H On Tue, Jan 13, 2009 at 10:25 AM, Frank Otto o...@delta-barth.de wrote: The portlet and servlet are in the same war. I use glassfish with portlet container 1.0 for develop. I have read the emptySessionPath must be true for the connector (tomcat). How can I set this for classfish? Nils-Helge Garli Hegvik schrieb: Are both the portlet and the servlet in the same application (war file)? What container are you using? Nils-H On Tue, Jan 13, 2009 at 9:55 AM, Frank Otto o...@delta-barth.de wrote: hi, I have a portlet with struts. It works fine, but I can't share objects in my portlet session with the servlet/action for yui ajax calls. I set in my porlet struts 2 action an object in the portlet session: portletRequest.getPortletSession().setAttribute(MY_KEY, mySessionObject, PortletSession.APPLICATION_SCOPE); In the yui action I want get the object from the session scope: mySessionObject= (MySessionObject) servletRequest.getSession().getAttribute(MY_KEY); But is it null. I have no idea. I wonder that the session id for the portlet request is other than in the servlet request. Can someone help me please? kind regards, Frank - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
[S2] struts 2.1.3: share portlet session with servlet (yui ajax)
hi, I have a portlet with struts. It works fine, but I can't share objects in my portlet session with the servlet/action for yui ajax calls. I set in my porlet struts 2 action an object in the portlet session: portletRequest.getPortletSession().setAttribute(MY_KEY, mySessionObject, PortletSession.APPLICATION_SCOPE); In the yui action I want get the object from the session scope: mySessionObject= (MySessionObject) servletRequest.getSession().getAttribute(MY_KEY); But is it null. I have no idea. I wonder that the session id for the portlet request is other than in the servlet request. Can someone help me please? kind regards, Frank - To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org
Re: portlet with a servlet
Sorry I can't be of much help, as I have never tried a scenario like this. I assume this happens because the WSRP-container request and the servlet request acts as two different clients. I did find an interesting thread [1] that's not really the same as your problem, but might contain some interesting information anyway. Nils-H [1] http://forums.oracle.com/forums/thread.jspa?threadID=341338 On Dec 12, 2007 6:58 PM, Brian Relph [EMAIL PROTECTED] wrote: Hello, I have a struts2 portlet with a registration page that contains a captcha. The captcha i generate from a servlet that i declare in my web.xml and map to /captcha. The captcha's are identified by the session id of the request, and then are validated in my action using the ServletRequestAware interface and grabbing the session id from it. I have deployed my portlet to WAS 6.1, and have also run it using jetty/pluto, and everything seems to work fine in these environments. However, I would like to run my portlet remotely using WSRP. When doing this, it seems like there is a new session generated when accessing the captcha servlet, different from the session used to access the portlet. This means that when i try to validate the captcha in my action, no captcha exists for my portlet session id. I realize that this is a very convoluted setup, and probably not the fault of struts, but i was wondering if there was a way to garuntee that only a single session is generated, or if there was a way to find out about the captcha session from within action. I will be happy to provide any code / config files if you think that would help. Thanks, Brian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: portlet with a servlet
Thank you for the response. After more investigation, and looking over the WSRP specification, it appears that the remote portlet producer is responsible for maintaining a users session with a portlet. The particular producer i am using is from ibm, and it seems that its interpretation (or maybe this is just how it has to be) is to preserve a session, which is good, but do it by generating a new session for every interaction and copying the old session attributes into the new session. This works in almost all cases, as long as you don't care about the actual session id. For me, the session id was all i cared about, so that was why i hit a wall. My solution is to generate a unique id, store it as a hidden input on the form, and also pass it as a parameter to the captcha servlet. The captcha servlet stores the generated captcha under this parameter id, and when i submit my form, i use the hidden input to validate the correct captcha. All in all, not too bad of a solution, i just had to get away from using the session id. The session id does work fine when accessing the portlet directly, but i want to have the same code running no matter the environment, so i am going to go with my own id generation. On 12/14/07, Nils-Helge Garli Hegvik [EMAIL PROTECTED] wrote: Sorry I can't be of much help, as I have never tried a scenario like this. I assume this happens because the WSRP-container request and the servlet request acts as two different clients. I did find an interesting thread [1] that's not really the same as your problem, but might contain some interesting information anyway. Nils-H [1] http://forums.oracle.com/forums/thread.jspa?threadID=341338 On Dec 12, 2007 6:58 PM, Brian Relph [EMAIL PROTECTED] wrote: Hello, I have a struts2 portlet with a registration page that contains a captcha. The captcha i generate from a servlet that i declare in my web.xml and map to /captcha. The captcha's are identified by the session id of the request, and then are validated in my action using the ServletRequestAware interface and grabbing the session id from it. I have deployed my portlet to WAS 6.1, and have also run it using jetty/pluto, and everything seems to work fine in these environments. However, I would like to run my portlet remotely using WSRP. When doing this, it seems like there is a new session generated when accessing the captcha servlet, different from the session used to access the portlet. This means that when i try to validate the captcha in my action, no captcha exists for my portlet session id. I realize that this is a very convoluted setup, and probably not the fault of struts, but i was wondering if there was a way to garuntee that only a single session is generated, or if there was a way to find out about the captcha session from within action. I will be happy to provide any code / config files if you think that would help. Thanks, Brian - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]