• 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

Calling JBoss Seam action methods from Servlet

 
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

My requirement is that I want to call a JBoss Seam method from a Servlet. I am using JSF/Seam/hibernate.

Or is there way to invoke a Seam method using javascript?

Thanks in Advance.

Regards,
Pradeep
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes , you can call seam components from JavaScript , check out Chapter 21 from the Seam referece guide - you got it with your Seam download , but a quick recap of what needs to be done . .. ..


include the following on your page
<script type="text/javascript" src="seam/resource/remoting/resource/remote.js"></script>
and
<script type="text/javascript"
src="seam/resource/remoting/interface.js?customerAction"></script>

customerAction is your seam component , wich should also be a EJB , so you need a interface with @Local , and all the methods that needs to be exposed to the JavaScript needs to be annotated with @WebMethod
CustomerAction needs to be annoted with a normal EJB anotatoion (like @Statefull) - that is besides the normal @Name seam annotation.

and finnally - the call from javascript :
Seam.Component.getInstance("customerAction").doSomething(someValue);


and thats it - but check out the doc - there is more stuff that you can do..

Cheers
 
I love a good mentalist. And so does this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic