Get your CodeRanch badge!*
The moose likes JBoss/WildFly and the fly likes Calling JBoss Seam action methods from Servlet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "Calling JBoss Seam action methods from Servlet" Watch "Calling JBoss Seam action methods from Servlet" New topic
Author

Calling JBoss Seam action methods from Servlet

Pradeep Chandrasekharan Nair
Ranch Hand

Joined: Apr 01, 2004
Posts: 48
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

Joined: Nov 29, 2007
Posts: 2
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 agree. Here's the link: http://aspose.com/file-tools
 
subject: Calling JBoss Seam action methods from Servlet
 
Similar Threads
simple example using seam
JBoss seam example apps
JBoss Seam Failing With "Could not instantiate Seam component: entityManagerFactory"
JBoss and Seam
Stateful session bean calling @remove method from client