>From: "Strittmatter, Stephan" <[EMAIL PROTECTED]> 
>
> 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:[EMAIL PROTECTED] 
> Sent: Monday, April 23, 2007 6:50 PM 
> To: user@shale.apache.org 
> 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:[EMAIL PROTECTED] 
> > Sent: Monday, April 23, 2007 4:53 PM 
> > To: user@shale.apache.org 
> > 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:[EMAIL PROTECTED] 
> > Sendt: 23. april 2007 16:50 
> > Til: user@shale.apache.org 
> > 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 
> > 
> > 

Reply via email to