Re: Struts2 and Portlets + GWT

2007-11-01 Thread Miguel Ping
Err, a stupid question... where do I send the CLA? And I have to send it in
PDF format, right?


On 10/31/07, Musachy Barroso <[EMAIL PROTECTED]> wrote:
>
> it would be great if you write something up :), you can do it on the
> GWT plugin page, or setup a new page on the wiki.  You would need to
> file a CLA (http://www.apache.org/licenses/index.html#clas) if you
> haven't.
>
> regards
> musachy
>
> On 10/31/07, Miguel Ping <[EMAIL PROTECTED]> wrote:
> > By the way, if anyone ever want to know how to use GWT and struts2 for
> > portlet development, I'll be glad to write something up.
> >
> > On 10/31/07, Miguel Ping <[EMAIL PROTECTED]> wrote:
> > >
> > > - But doesn't that share the object in ALL sessions? I want to share a
> > > specific object per user session. Besides, I don't know how to acess
> the
> > > PortletSession. By using SessionAware I can only get a Map, the
> > > PortletSessionMap. The Portlet specs show an example with 3 arguments:
> > >
> > > session.setAttribute("home.url",url,PortletSession.APPLICATION_SCOPE);
> > > session.setAttribute("bkg.color","RED",PortletSession.PORTLET_SCOPE);
> > >
> > > but the map provided by the SessionAware interface is a regular Map.
> > >
> > > Thanks once more,
> > > Miguel
> > >
> > > On 10/31/07, Nils-Helge Garli Hegvik <[EMAIL PROTECTED]> wrote:
> > > >
> > > > If you need to share data between the servlet and the portlet, you
> > > > have to put it in the application scope, using the
> > > > PortletSession.APPLICATION_SCOPE constant in the setAttribute
> > > > operation.
> > > >
> > > > Nils-H
> > > >
> > > > On 10/31/07, Miguel Ping <[EMAIL PROTECTED]> wrote:
> > > > > I am already using the plugin :) Nice work, by the way ;)
> > > > >
> > > > > I'm having some issue sharing data between portlet sessions and
> > > > servlet
> > > > > sessions... The portlet api says that the data in servlet session
> must
> > > > be
> > > > > acessible from the portlet session. But if i put something in the
> > > > session
> > > > > map by means of the SessionAware interface, when I'm in the GWT
> > > > actions, the
> > > > > data is not acessible. Am I doing something wrong?
> > > > >
> > > > > On 10/31/07, Musachy Barroso <[EMAIL PROTECTED]> wrote:
> > > > > >
> > > > > > not sure if you can use it for this, but there is a GWT plugin
> for
> > > > struts:
> > > > > >
> > > > > > http://cwiki.apache.org/S2PLUGINS/gwt-plugin.html
> > > > > >
> > > > > > musachy
> > > > > >
> > > > > > On 10/31/07, Miguel Ping < [EMAIL PROTECTED]> wrote:
> > > > > > > Hi, thanks for the answer. Yes you are correct, GWT makes
> special
> > > > > > requests
> > > > > > > that update a part of a page. I am reading the Portlet spec
> and I
> > > > didn't
> > > > > > > knew that portlets had custom urls, thanks for the pointer :)
> > > > > > >
> > > > > > > So I guess in order to have access to portlet preferences /
> > > > principal
> > > > > > info /
> > > > > > > etc, the best is to store them in the http session.
> > > > > > > Is it an option to write a custom GWT request that passes as a
> > > > regular
> > > > > > > portlet url, so the dispatcher can process it? I understand
> that
> > > > this is
> > > > > > not
> > > > > > > directly related to struts, I just want to be sure that the
> > > > > > > Jsr168RequestDispatcher works by inspecting urls...
> > > > > > >
> > > > > > >
> > > > > > > On 10/31/07, Nils-Helge Garli Hegvik <[EMAIL PROTECTED]> wrote:
> > > > > > > >
> > > > > > > > Hi!
> > > > > > > >
> > > > > > > > The Jsr168Dispatcher only handles requests created as
> Portlet
> > > > URLs.
> > > > > > > > I'm not familiar with GWT so apoligies if my assumptions are
> > > > > > > > incorrect

Re: Struts2 and Portlets + GWT

2007-10-31 Thread Miguel Ping
By the way, if anyone ever want to know how to use GWT and struts2 for
portlet development, I'll be glad to write something up.

On 10/31/07, Miguel Ping <[EMAIL PROTECTED]> wrote:
>
> - But doesn't that share the object in ALL sessions? I want to share a
> specific object per user session. Besides, I don't know how to acess the
> PortletSession. By using SessionAware I can only get a Map, the
> PortletSessionMap. The Portlet specs show an example with 3 arguments:
>
> session.setAttribute("home.url",url,PortletSession.APPLICATION_SCOPE);
> session.setAttribute("bkg.color","RED",PortletSession.PORTLET_SCOPE);
>
> but the map provided by the SessionAware interface is a regular Map.
>
> Thanks once more,
> Miguel
>
> On 10/31/07, Nils-Helge Garli Hegvik <[EMAIL PROTECTED]> wrote:
> >
> > If you need to share data between the servlet and the portlet, you
> > have to put it in the application scope, using the
> > PortletSession.APPLICATION_SCOPE constant in the setAttribute
> > operation.
> >
> > Nils-H
> >
> > On 10/31/07, Miguel Ping <[EMAIL PROTECTED]> wrote:
> > > I am already using the plugin :) Nice work, by the way ;)
> > >
> > > I'm having some issue sharing data between portlet sessions and
> > servlet
> > > sessions... The portlet api says that the data in servlet session must
> > be
> > > acessible from the portlet session. But if i put something in the
> > session
> > > map by means of the SessionAware interface, when I'm in the GWT
> > actions, the
> > > data is not acessible. Am I doing something wrong?
> > >
> > > On 10/31/07, Musachy Barroso <[EMAIL PROTECTED]> wrote:
> > > >
> > > > not sure if you can use it for this, but there is a GWT plugin for
> > struts:
> > > >
> > > > http://cwiki.apache.org/S2PLUGINS/gwt-plugin.html
> > > >
> > > > musachy
> > > >
> > > > On 10/31/07, Miguel Ping < [EMAIL PROTECTED]> wrote:
> > > > > Hi, thanks for the answer. Yes you are correct, GWT makes special
> > > > requests
> > > > > that update a part of a page. I am reading the Portlet spec and I
> > didn't
> > > > > knew that portlets had custom urls, thanks for the pointer :)
> > > > >
> > > > > So I guess in order to have access to portlet preferences /
> > principal
> > > > info /
> > > > > etc, the best is to store them in the http session.
> > > > > Is it an option to write a custom GWT request that passes as a
> > regular
> > > > > portlet url, so the dispatcher can process it? I understand that
> > this is
> > > > not
> > > > > directly related to struts, I just want to be sure that the
> > > > > Jsr168RequestDispatcher works by inspecting urls...
> > > > >
> > > > >
> > > > > On 10/31/07, Nils-Helge Garli Hegvik <[EMAIL PROTECTED]> wrote:
> > > > > >
> > > > > > Hi!
> > > > > >
> > > > > > The Jsr168Dispatcher only handles requests created as Portlet
> > URLs.
> > > > > > I'm not familiar with GWT so apoligies if my assumptions are
> > > > > > incorrect, but I assume that you're referring to some sort of
> > "partial
> > > > > > request" that updates a section of the page? In that case, it's
> > > > > > correct that it should be invoked as a servlet request, since
> > invoking
> > > > > > it through a portlet url will change the state and corrupt your
> > entire
> > > > > > portlet (you would get the contents of the entire portal page
> > from the
> > > > > > request). So I would recommend that you build your application
> > so that
> > > > > > the AJAX part is working as a servlet.
> > > > > >
> > > > > > The Portlet 2.0 specification has better support for this kind
> > of
> > > > > > stuff, so it will improve in the future :)
> > > > > >
> > > > > > Nils-H
> > > > > >
> > > > > > On 10/31/07, Miguel Ping <[EMAIL PROTECTED]> wrote:
> > > > > > > Hi all, this is my first post to struts2 mailing list :)
> > > > > > >
> > > > > > > I'm using Struts2 and the gwt plugin by Musachy B

Re: Struts2 and Portlets + GWT

2007-10-31 Thread Miguel Ping
- But doesn't that share the object in ALL sessions? I want to share a
specific object per user session. Besides, I don't know how to acess the
PortletSession. By using SessionAware I can only get a Map, the
PortletSessionMap. The Portlet specs show an example with 3 arguments:

session.setAttribute("home.url",url,PortletSession.APPLICATION_SCOPE);
session.setAttribute("bkg.color","RED",PortletSession.PORTLET_SCOPE);

but the map provided by the SessionAware interface is a regular Map.

Thanks once more,
Miguel

On 10/31/07, Nils-Helge Garli Hegvik <[EMAIL PROTECTED]> wrote:
>
> If you need to share data between the servlet and the portlet, you
> have to put it in the application scope, using the
> PortletSession.APPLICATION_SCOPE constant in the setAttribute
> operation.
>
> Nils-H
>
> On 10/31/07, Miguel Ping <[EMAIL PROTECTED]> wrote:
> > I am already using the plugin :) Nice work, by the way ;)
> >
> > I'm having some issue sharing data between portlet sessions and servlet
> > sessions... The portlet api says that the data in servlet session must
> be
> > acessible from the portlet session. But if i put something in the
> session
> > map by means of the SessionAware interface, when I'm in the GWT actions,
> the
> > data is not acessible. Am I doing something wrong?
> >
> > On 10/31/07, Musachy Barroso <[EMAIL PROTECTED]> wrote:
> > >
> > > not sure if you can use it for this, but there is a GWT plugin for
> struts:
> > >
> > > http://cwiki.apache.org/S2PLUGINS/gwt-plugin.html
> > >
> > > musachy
> > >
> > > On 10/31/07, Miguel Ping <[EMAIL PROTECTED]> wrote:
> > > > Hi, thanks for the answer. Yes you are correct, GWT makes special
> > > requests
> > > > that update a part of a page. I am reading the Portlet spec and I
> didn't
> > > > knew that portlets had custom urls, thanks for the pointer :)
> > > >
> > > > So I guess in order to have access to portlet preferences /
> principal
> > > info /
> > > > etc, the best is to store them in the http session.
> > > > Is it an option to write a custom GWT request that passes as a
> regular
> > > > portlet url, so the dispatcher can process it? I understand that
> this is
> > > not
> > > > directly related to struts, I just want to be sure that the
> > > > Jsr168RequestDispatcher works by inspecting urls...
> > > >
> > > >
> > > > On 10/31/07, Nils-Helge Garli Hegvik <[EMAIL PROTECTED]> wrote:
> > > > >
> > > > > Hi!
> > > > >
> > > > > The Jsr168Dispatcher only handles requests created as Portlet
> URLs.
> > > > > I'm not familiar with GWT so apoligies if my assumptions are
> > > > > incorrect, but I assume that you're referring to some sort of
> "partial
> > > > > request" that updates a section of the page? In that case, it's
> > > > > correct that it should be invoked as a servlet request, since
> invoking
> > > > > it through a portlet url will change the state and corrupt your
> entire
> > > > > portlet (you would get the contents of the entire portal page from
> the
> > > > > request). So I would recommend that you build your application so
> that
> > > > > the AJAX part is working as a servlet.
> > > > >
> > > > > The Portlet 2.0 specification has better support for this kind of
> > > > > stuff, so it will improve in the future :)
> > > > >
> > > > > Nils-H
> > > > >
> > > > > On 10/31/07, Miguel Ping <[EMAIL PROTECTED]> wrote:
> > > > > > Hi all, this is my first post to struts2 mailing list :)
> > > > > >
> > > > > > I'm using Struts2 and the gwt plugin by Musachy Barroso, in a
> > > portlet
> > > > > > project, and for the front end I'm using Google Web Toolkit
> (gwt).
> > > So
> > > > > I'm
> > > > > > using struts only for the actions, except for the 'default'
> action,
> > > > > which is
> > > > > > a jsp with struts taglibs.
> > > > > >
> > > > > > In my portlet project, I have an action that implements the
> > > > > PrincipalAware
> > > > > > interface, that is the default action for my portlet. This
> action
> > >

Re: Struts2 and Portlets + GWT

2007-10-31 Thread Miguel Ping
I am already using the plugin :) Nice work, by the way ;)

I'm having some issue sharing data between portlet sessions and servlet
sessions... The portlet api says that the data in servlet session must be
acessible from the portlet session. But if i put something in the session
map by means of the SessionAware interface, when I'm in the GWT actions, the
data is not acessible. Am I doing something wrong?

On 10/31/07, Musachy Barroso <[EMAIL PROTECTED]> wrote:
>
> not sure if you can use it for this, but there is a GWT plugin for struts:
>
> http://cwiki.apache.org/S2PLUGINS/gwt-plugin.html
>
> musachy
>
> On 10/31/07, Miguel Ping <[EMAIL PROTECTED]> wrote:
> > Hi, thanks for the answer. Yes you are correct, GWT makes special
> requests
> > that update a part of a page. I am reading the Portlet spec and I didn't
> > knew that portlets had custom urls, thanks for the pointer :)
> >
> > So I guess in order to have access to portlet preferences / principal
> info /
> > etc, the best is to store them in the http session.
> > Is it an option to write a custom GWT request that passes as a regular
> > portlet url, so the dispatcher can process it? I understand that this is
> not
> > directly related to struts, I just want to be sure that the
> > Jsr168RequestDispatcher works by inspecting urls...
> >
> >
> > On 10/31/07, Nils-Helge Garli Hegvik <[EMAIL PROTECTED]> wrote:
> > >
> > > Hi!
> > >
> > > The Jsr168Dispatcher only handles requests created as Portlet URLs.
> > > I'm not familiar with GWT so apoligies if my assumptions are
> > > incorrect, but I assume that you're referring to some sort of "partial
> > > request" that updates a section of the page? In that case, it's
> > > correct that it should be invoked as a servlet request, since invoking
> > > it through a portlet url will change the state and corrupt your entire
> > > portlet (you would get the contents of the entire portal page from the
> > > request). So I would recommend that you build your application so that
> > > the AJAX part is working as a servlet.
> > >
> > > The Portlet 2.0 specification has better support for this kind of
> > > stuff, so it will improve in the future :)
> > >
> > > Nils-H
> > >
> > > On 10/31/07, Miguel Ping <[EMAIL PROTECTED]> wrote:
> > > > Hi all, this is my first post to struts2 mailing list :)
> > > >
> > > > I'm using Struts2 and the gwt plugin by Musachy Barroso, in a
> portlet
> > > > project, and for the front end I'm using Google Web Toolkit (gwt).
> So
> > > I'm
> > > > using struts only for the actions, except for the 'default' action,
> > > which is
> > > > a jsp with struts taglibs.
> > > >
> > > > In my portlet project, I have an action that implements the
> > > PrincipalAware
> > > > interface, that is the default action for my portlet. This action
> calls
> > > the
> > > > jsp. When I debug this action, I can see that the PrincipalProxy
> object
> > > is a
> > > > portlet proxy object; however all gwt calls to struts2 actions that
> > > > implement the PrincipalAware interface gives me only Serlver proxy
> > > objects.
> > > > I think that this happens because GWT calls the action directly,
> > > bypassing
> > > > the Jsr168Dispatcher. The action then 'thinks' that the request is a
> > > servlet
> > > > request instead of a portlet request.
> > > >
> > > > My question is: how can I force all requests to pass by the Jsr168
> > > request
> > > > dispatcher? I want to have access of portlet data in my actions,
> through
> > > GWT
> > > > calls.
> > > >
> > > > Thanks In advance,
> > > > Miguel Ping
> > > >
> > >
> > > -
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> >
>
>
> --
> "Hey you! Would you help me to carry the stone?" Pink Floyd
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Re: Struts2 and Portlets + GWT

2007-10-31 Thread Miguel Ping
Hi, thanks for the answer. Yes you are correct, GWT makes special requests
that update a part of a page. I am reading the Portlet spec and I didn't
knew that portlets had custom urls, thanks for the pointer :)

So I guess in order to have access to portlet preferences / principal info /
etc, the best is to store them in the http session.
Is it an option to write a custom GWT request that passes as a regular
portlet url, so the dispatcher can process it? I understand that this is not
directly related to struts, I just want to be sure that the
Jsr168RequestDispatcher works by inspecting urls...


On 10/31/07, Nils-Helge Garli Hegvik <[EMAIL PROTECTED]> wrote:
>
> Hi!
>
> The Jsr168Dispatcher only handles requests created as Portlet URLs.
> I'm not familiar with GWT so apoligies if my assumptions are
> incorrect, but I assume that you're referring to some sort of "partial
> request" that updates a section of the page? In that case, it's
> correct that it should be invoked as a servlet request, since invoking
> it through a portlet url will change the state and corrupt your entire
> portlet (you would get the contents of the entire portal page from the
> request). So I would recommend that you build your application so that
> the AJAX part is working as a servlet.
>
> The Portlet 2.0 specification has better support for this kind of
> stuff, so it will improve in the future :)
>
> Nils-H
>
> On 10/31/07, Miguel Ping <[EMAIL PROTECTED]> wrote:
> > Hi all, this is my first post to struts2 mailing list :)
> >
> > I'm using Struts2 and the gwt plugin by Musachy Barroso, in a portlet
> > project, and for the front end I'm using Google Web Toolkit (gwt). So
> I'm
> > using struts only for the actions, except for the 'default' action,
> which is
> > a jsp with struts taglibs.
> >
> > In my portlet project, I have an action that implements the
> PrincipalAware
> > interface, that is the default action for my portlet. This action calls
> the
> > jsp. When I debug this action, I can see that the PrincipalProxy object
> is a
> > portlet proxy object; however all gwt calls to struts2 actions that
> > implement the PrincipalAware interface gives me only Serlver proxy
> objects.
> > I think that this happens because GWT calls the action directly,
> bypassing
> > the Jsr168Dispatcher. The action then 'thinks' that the request is a
> servlet
> > request instead of a portlet request.
> >
> > My question is: how can I force all requests to pass by the Jsr168
> request
> > dispatcher? I want to have access of portlet data in my actions, through
> GWT
> > calls.
> >
> > Thanks In advance,
> > Miguel Ping
> >
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


Struts2 and Portlets + GWT

2007-10-31 Thread Miguel Ping
Hi all, this is my first post to struts2 mailing list :)

I'm using Struts2 and the gwt plugin by Musachy Barroso, in a portlet
project, and for the front end I'm using Google Web Toolkit (gwt). So I'm
using struts only for the actions, except for the 'default' action, which is
a jsp with struts taglibs.

In my portlet project, I have an action that implements the PrincipalAware
interface, that is the default action for my portlet. This action calls the
jsp. When I debug this action, I can see that the PrincipalProxy object is a
portlet proxy object; however all gwt calls to struts2 actions that
implement the PrincipalAware interface gives me only Serlver proxy objects.
I think that this happens because GWT calls the action directly, bypassing
the Jsr168Dispatcher. The action then 'thinks' that the request is a servlet
request instead of a portlet request.

My question is: how can I force all requests to pass by the Jsr168 request
dispatcher? I want to have access of portlet data in my actions, through GWT
calls.

Thanks In advance,
Miguel Ping