Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

Max Tomlinson
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"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

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!