• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Knute Snortum
  • Paul Clapham
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Frits Walraven
Bartenders:
  • Ganesh Patekar
  • Tim Holloway
  • salvin francis

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

 
Ranch Hand
Posts: 365
  • Mark post as helpful
  • send pies
  • 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
 
Well don't expect me to do the dishes! This ad has been cleaned for your convenience:
how do I do my own kindle-like thing - without amazon
https://coderanch.com/t/711421/engineering/kindle-amazon
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!