Please take our Survey
logo       

Choosing A Webhost:
A web hosting service is a type of Internet hosting service that allows individuals and organizations to provide their own website accessible via the World Wide Web. Web hosts are companies that provide space on a server they own for use by their clients as well as providing Internet connectivity, typically in a data center. Web hosts can also provide data center space and connectivity to the Internet for servers they do not own to be located in their data center, called colocation. more...

Re: [shale-remote] SesionBeans in MyFaces/Portlet Application: msg#00108

apache.shale.user

Subject: Re: [shale-remote] SesionBeans in MyFaces/Portlet Application

Could this have to do with the fact the portal container is going to
namespace you session bean? In websphere portal it adds a prefix to
the attribute name to sort of carve up the httpsession among portlets.

Then your ajax request is coming in to the faces servlet where there
is no namespace involved. So in that case you might get the bean
created twice.

I think that the myfaces impl only maps jsf session beans to the
PORTLET session scope. But there really is no reason you couldn't
change that to use the APPLICATION session scope instead.

javax.portlet.PortletSession

setAttribute(java.lang.String name, java.lang.Object value, int scope)
Binds an object to this session in the given scope, using
the name specified.

setAttribute(java.lang.String name, java.lang.Object value)
Binds an object to this session under the PORTLET_SCOPE,
using the name specified.

The key would be to override the myfaces portlet external context to
use APPLICATION_SCOPE for the scope parameter. Thats just my guess
for sharing beans between portlets and servlets.







On 4/24/07, Gary VanMatre <gvanmatre@xxxxxxxxxxx> wrote:
>From: "Strittmatter, Stephan" <Stephan.Strittmatter@xxxxxxxx>
>
> Hm, but how to get ExternalContext.encodeResourceURL within Jscript?
> I tried to put an outText with this value calculated by my managed bean,
> but the outtext is rendered in different place not within the script.
>

The URL would have to be built when the page is rendered on the server.
Maybe you could use a hidden attribute in the form.

<h:inputHidden id="remoteUrl" value="#{mybean.getRemoteUrl}"/>

Let the backing bean add the encoding.

public String getRemoteUrl() {
FacesContext context = FacesContext.getCurrentInstance();
return context.getApplication().getViewHandler().getResourceURL(context,
"dynamic/userBean/method.faces");
}

Then use the hidden attributes value in script.


Gary

> -----Original Message-----
> From: Gary VanMatre [mailto:gvanmatre@xxxxxxxxxxx]
> Sent: Monday, April 23, 2007 6:50 PM
> To: user@xxxxxxxxxxxxxxxx
> Subject: RE: [shale-remote] SesionBeans in MyFaces/Portlet Application
>
> >From: "Strittmatter, Stephan"
> >
> > If the Bean is in session scope I would expect only one bean per
> session
> > or am I wrong?
> >
>
> Session scope is defined to the web container by the "jsessionid". Does
> your remote request contain the jsessionid as a query parameters? Try
> using the ExternalContext.encodeResourceURL method to build the URL used
> by the remoting call. That's probably the only option if this is truly
> a portlet.
>
>
> > -----Original Message-----
> > From: Hermod Opstvedt [mailto:hermod@xxxxxxxxxxxx]
> > Sent: Monday, April 23, 2007 4:53 PM
> > To: user@xxxxxxxxxxxxxxxx
> > Subject: SV: [shale-remote] SesionBeans in MyFaces/Portlet Application
>
> >
> > Hi
> >
> > Indeed - Once going in on the post, and then again going out on the
> > render
> > response.
> >
> > Hermod
> >
> > -----Opprinnelig melding-----
> > Fra: Strittmatter, Stephan [mailto:Stephan.Strittmatter@xxxxxxxx]
> > Sendt: 23. april 2007 16:50
> > Til: user@xxxxxxxxxxxxxxxx
> > Emne: [shale-remote] SesionBeans in MyFaces/Portlet Application
> >
> > Hi all,
> >
> > I have made some small tests using shale-remote to make AJAX updates
> > within my MyFaces-Portlet, but I found, that the session scoped
> > ManagedBean is instantiated twice!
> > I use the:
> > * shale-remote of SVN (last week)
> > * Apache Portlet bridge 1.0
> > * MyFaces/Tomahawk 1.1.5
> >
> > I think, there are created two different contexts but not shure. Has
> > already had someone this problem?
> >
> > Regards,
> >
> > Stephan
> >
> >



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

Recently Viewed:
video.h264.deve...    technology.erps...    drivers.hostap/...    user-groups.lin...    games.railroad-...    handhelds.linux...    lang.harbour.de...    recreation.radi...    culture.publica...    xfree86.devel/2...    music.john-cage...    otrs.cvs/2003-0...    network.e-smith...    asplinux.suppor...    qnx.openqnx.dev...    ietf.nfsv4/2005...    editors.vim/200...    kde.devel.kopet...    web.zope.zwiki....    freebsd.devel.m...    java.xdoclet.de...    php.simpletest....    bacula.user/200...    security.virus....   
Home | blog view | USPTO Patent Archive | advertise | OSDir is an inevitable website. super tiny logo

Free Magazines

Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe

Systems Management News, the newspaper for IT systems administration and data center managers! Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe

The Enterprise Newsweekly eWeek is the essential technology information source for builders of e-business.
subscribe

Oracle Magazine Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe

Total Telecom Total Telecom is "The Economist of the communications industry".
subscribe

Navigation