aspose file tools*
The moose likes Other Application Frameworks and the fly likes  seam remoting: can I pass a pojo FROM a client TO a session bean? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark " seam remoting: can I pass a pojo FROM a client TO a session bean?" Watch " seam remoting: can I pass a pojo FROM a client TO a session bean?" New topic
Author

seam remoting: can I pass a pojo FROM a client TO a session bean?

Max Tomlinson
Ranch Hand

Joined: Jul 17, 2001
Posts: 365
Does anyone know whether I can use seam remoting to pass a pojo from a client to a session bean?
Our app successfully uses the approach of passing pojos from the server to the client. As long as the pojo is properly decorated with a name annotation. is serializable and there is a seam remoting definition on the page there’s no problem. We have been doing this for years.
But it appears that one can only pass certain object types back: Strings, Immutable values, Maps—nothing much more.
Has anyone had any success with this other approach?

What I’m trying to do:

My pojo defined in js (works fine for server to client—i.e. pojo returned on method calls to a session bean):

initialize : function() {
this.selectedEntry = new Seam.Remoting.createType("com.wwc.cps.pojo.ViewTemplateEntry");

},

Defined in my xhtml page:
<script type="text/javascript" src="seam/resource/remoting/interface.js?adminViewEditorAction&viewTemplateEntry"></script>

But when I try this in my session bean….

public void saveVTEntry (ViewTemplateEntry vtEntry) { //set as @webremote in interface
log.info("save to database - " + vtEntry);

and this in my client js:
action.saveVTEntry(this.selectedEntry, function() { //where action is an instance of the session bean
I get: ‘invalid type’ error – this is coming out the seam remoting code on the client


thanks!
Max
 
 
subject: seam remoting: can I pass a pojo FROM a client TO a session bean?