[Logo] Mentawai Recipes
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Members]  Member Listing   [Groups] Back to home page 
[Moderation Log] Moderation Log   [Register] Register / 
[Login] Login 
Turning any method from any POJO into an action (POJO Actions)  XML
Forum Index » Official Recipes
Author Message
saoj



Joined: 10/01/2008 08:20:15
Messages: 39
Offline

With Mentawai you can use any java class (POJO) as an action. You can also call any method without any restriction. Check the examples below:

In the application manager you just register the POJO action as you would register any other action:

Tthe action input parameters will be sorted in alphabetical order. However, if you want to explicit determine what values will be used as the method parameters, you can setup a MethodParamFilter. For example, let's say you have the following request:

http://www.mysite.com/HelloPojo.mtw?a=23&a=3&b=5&x=9&y=4

If you want to make sure the method addTwoNumbers take the action input values x and y, and not a and b, which is the default because a and b come first in alphabetical order, then all you have to do inside your application manager is:

 
Forum Index » Official Recipes
Go to:   
Powered by JForum 2.1.8 © JForum Team