• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 365
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
 
reply
    Bookmark Topic Watch Topic
  • New Topic