Re: request-map "<Response>"

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: request-map "<Response>"

Aditya Sharma
Moving discussion to user list.

Hello Ismail,

For your code reference:

<request-map uri="createPartySkill">

        <security https="true" auth="true"/>

        <event type="service" invoke="createPartySkill"/>

        <response name="success" type="view" value="FindPartySkills"/>

        <response name="error" type="view" value="NewPartySkill"/>
</request-map>

   - Whenever a service completes its execution it returns a Map which
   contains a key responseMessage.
   - The responseMessage key has a string value that can success, error or
   fail (although it can be any string value if developer wants).
   - The responseMessage value is evaluated with <response> name attribute
   and corresponding <response> is returned.
   - <response> can be of type viz view, request-redirect, request etc. In
   above code its view type it will find its value in view-map and returns
   resulting screen.

In case there is no service call default value for responseMessage is
success.

Thanks & Regards,
Aditya Sharma
Enterprise Software Engineer
Hotwax Systems
http://www.hotwaxsystems.com/

On Sun, Feb 12, 2017 at 2:52 PM, Jacques Le Roux <
[hidden email]> wrote:

> That's great thanks Deepak,
>
> Ismail, please understand that this ML (dev ML) is used by developers to
> discuss developing new stuff or improving stuff.
>
> As suggested by Deepak, for questions regarding the usage of OFBiz please
> ask them on the user ML
>
> Thanks
>
> Jacques
>
>
>
> Le 12/02/2017 à 09:09, Deepak Dixit a écrit :
>
>> Hi Ismail,
>>
>> If Service return success then it will render view mentioned in response
>> name success, and if service fails and return error it will render view
>> mentioned in response name error.
>> Please refer ServiceUtil and ModelService java file for more reference.
>>
>> Please use user mailing list for this kind of question.
>> https://ofbiz.apache.org/mailing-lists.html
>>
>>
>>
>>
>> Thanks & Regards
>> --
>> Deepak Dixit
>> www.hotwaxsystems.com
>>
>> On Sun, Feb 12, 2017 at 1:20 PM, Ismail Al Kouz <[hidden email]>
>> wrote:
>>
>> Hello Dears.
>>>
>>>
>>>
>>> There are anyone can help me to explain the <response> elements on code
>>> below and what the “success” & “error” .
>>>
>>>
>>>
>>> <request-map uri="createPartySkill">
>>>
>>>          <security https="true" auth="true"/>
>>>
>>>          <event type="service" invoke="createPartySkill"/>
>>>
>>>          <response name="success" type="view" value="FindPartySkills"/>
>>>
>>>          <response name="error" type="view" value="NewPartySkill"/>
>>>
>>>      </request-map>
>>>
>>>
>>>
>>> Thanks to all.
>>>
>>>
>>>
>>> *Best Regards,*
>>>
>>>
>>>
>>> *Ismail Alkouz*
>>>
>>> Java Developer
>>>
>>>
>>>
>>> [image: Description: Logo for Office-4]
>>>
>>>
>>>
>>> [image: Description: bi email-3-02]
>>>
>>>
>>>
>>> P.O.Box 3516 Amman, 11821
>>>
>>> The Hashemite Kingdom of Jordan
>>>
>>> *Tel.*                     +962 (6) 556 2620
>>>
>>> *Mob (Jordan).*   +962 79 282 2098
>>>
>>> [image: Description: bi email-3-04]
>>>
>>> [image: Description: bi email-3-05]
>>>
>>> /biict
>>>
>>> @biict
>>>
>>>
>>>
>>>
>>>
>>>
>>
>