File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Calling JBoss Seam action methods from Servlet

 
Pradeep Chandrasekharan Nair
Ranch Hand
Posts: 48
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
Pans Pansegrouw
Greenhorn
Posts: 2
  • 0
  • Mark post as helpful
  • send pies
  • 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
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic