Ajax Form Post, Shale Remoting and Glassfish

2007-10-01 Thread Brody Wong

I am using Aajx (Yahoo UI!'s asyncRequest) to post a form. 

YAHOO.util.Connect.setForm(moduleForm);
YAHOO.util.Connect.asyncRequest('POST',
'dynamic/a_backing_bean/save.jsf', ...

At backend, I am using Shale-Remoting to catch the result. I make the call 

public void save() {
//do sth
getFacesContext().responseComplete();
   
getFacesContext().getExternalContext().dispatch("/a_nested_view.jsf");
}

To return the result. At the browser, I use JavaScript to set the target's
DIV's innerHTML to be replaced by the HTML fragment returned.

It works perfectly using Tomcat 5.5 but when I switched to Glassfish. It
renders the whole page including the parent view. I would like Shale/GF just
return the nested view instead of the whole page.

I have tried to use remoting without a form post, only the target nested
view will be rendered in both Tomcat 5.5 and Glassfish.

I am also using Shale-Tiger and Shale-Spring. All shale related classes are
at version 1.0.4. I am using myfaces-1.1.5

Anybody has any ideas what I have to do to solve this problem?

Thanks in advance.
-- 
View this message in context: 
http://www.nabble.com/Ajax-Form-Post%2C-Shale-Remoting-and-Glassfish-tf4552874.html#a12992749
Sent from the Shale - User mailing list archive at Nabble.com.



Re: Accessing Spring Beans inside ShaleApplication preprocess hook

2007-08-05 Thread Brody Wong

Found the answer: I used WebApplicationContextUtils to get the Spring
WebApplicationContext.  For example, this.webApplicationContext =
WebApplicationContextUtils.getWebApplicationContext(webContext.getContext());

Brody Wong wrote:
> 
> I have written a preprocess filter for the commons chain from the
> ShaleApplicationFilter. I have also successfully integrate Shale and
> Spring using the value binding method. However, I would like to access 
> the Spring Bean Factory inside the preprocess filter. Is there anyway to
> get an instance of the Spring's WebApplicationContext inside the
> preprocess filter? The following is the sample code I wrote: public class
> PermissionFilter extends AbstractRegExpFilter {
> PermissionsManager permissionsManager ;
> 
> /**
>  * Return the servlet path (if any) concatenated with the path info
>  * (if any) for this request.
>  *
>  * @param context Context for the current request
>  */
> protected String value(ShaleWebContext context) {
> 
> if (this.permissionsManager == null) {
> 
> WebApplicationContext wac =
> (WebApplicationContext)context.getContext() ;
> this.permissionsManager =
> (PermissionsManager)wac.getBean("permissionsManager") ;
> 
> }
> String servletPath = context.getRequest().getServletPath();
> if (servletPath == null) {
> servletPath = "";
> }
> String pathInfo = context.getRequest().getPathInfo();
> if (pathInfo == null) {
> pathInfo = "";
> }
> return servletPath + pathInfo ;
> 
> }
> 
> 
> }
> But it fails when casting the servlet context to Spring's
> WebApplicationContext. Thanks in advance for your help.
> 

-- 
View this message in context: 
http://www.nabble.com/Accessing-Spring-Beans-inside-ShaleApplication-preprocess-hook-tf4219349.html#a12010504
Sent from the Shale - User mailing list archive at Nabble.com.



Accessing Spring Beans inside ShaleApplication preprocess hook

2007-08-05 Thread Brody Wong

I have written a preprocess filter for the commons chain from the
ShaleApplicationFilter. I have also successfully integrate Shale and Spring
using the value binding method. However, I would like to access  the Spring
Bean Factory inside the preprocess filter. Is there anyway to get an
instance of the Spring's WebApplicationContext inside the preprocess filter?
The following is the sample code I wrote: public class PermissionFilter
extends AbstractRegExpFilter {
PermissionsManager permissionsManager ;

/**
 * Return the servlet path (if any) concatenated with the path info
 * (if any) for this request.
 *
 * @param context Context for the current request
 */
protected String value(ShaleWebContext context) {

if (this.permissionsManager == null) {

WebApplicationContext wac =
(WebApplicationContext)context.getContext() ;
this.permissionsManager =
(PermissionsManager)wac.getBean("permissionsManager") ;

}
String servletPath = context.getRequest().getServletPath();
if (servletPath == null) {
servletPath = "";
}
String pathInfo = context.getRequest().getPathInfo();
if (pathInfo == null) {
pathInfo = "";
}
return servletPath + pathInfo ;

}


}
But it fails when casting the servlet context to Spring's
WebApplicationContext. Thanks in advance for your help.
-- 
View this message in context: 
http://www.nabble.com/Accessing-Spring-Beans-inside-ShaleApplication-preprocess-hook-tf4219349.html#a12003589
Sent from the Shale - User mailing list archive at Nabble.com.



Force refresh resource bundles

2007-05-10 Thread Brody Wong

In my project, I need to perform forced refresh for resource bundles without
shutting down the application. Is it possible in Shale? I have only found
the class LoadBundle related to this. 

If I can find a way to list all bundles for an application, I can follow the
practice in this link:

http://technology.amis.nl/blog/?p=1360

The author is using JHeadStart from Oracle.

Many thanks.
-- 
View this message in context: 
http://www.nabble.com/Force-refresh-resource-bundles-tf3725703.html#a10426598
Sent from the Shale - User mailing list archive at Nabble.com.



Newbie question: Clay and Tiger

2007-05-07 Thread Brody Wong

Hi all,

Can I use shale tiger annotation with clay?

Thanks in advance
-- 
View this message in context: 
http://www.nabble.com/Newbie-question%3A-Clay-and-Tiger-tf3707490.html#a10369353
Sent from the Shale - User mailing list archive at Nabble.com.