cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vadim Gritsenko <va...@reverycodes.com>
Subject Re: Rhino beans
Date Thu, 30 Sep 2004 10:52:49 GMT
Ugo Cei wrote:

> A little question for any Rhino gurus out there. Assuming you have a 
> Javascript prototype defined like this (and assuming this is sensible, 
> since my knowledge of JS is quite limited):
> 
> function PropertyHello() {
>     this.message = "hello world";
> }
> 
> PropertyHello.prototype.sayHello = function() {
>     return this.message;
> }
> 
> would it be possible to have the 'message' property be accessible via 
> regular Java reflection. In other words, would it be possible to have 
> this prototype behave like a Javabean:
> 
> public class PropertyHello {
>   private String message = "hello world";
>   public String getMessage() { return message; }
>   public void setMessage(String m) { message = m; }
> }
> 
> In my case, the getter and setter methods would be called via reflection.

Probably not much help, but PropertyHello JS Bean will be seen from Java code as 
org.mozilla.javascript.Scriptable. If you can plug it in into BeanUtils, than 
you can use BeanUtils.

Vadim


Mime
View raw message