I use in groovy event

***
    Map requestAttrs = UtilHttp.getAttributeMap(request)
    Map parameters = UtilHttp.getParameterMap(request)
***

It's same with java
Nicolas

On 29/04/2022 04:34, Avijit Bose wrote:
> Hello Nicolas,
>
> Could you pls give me an example or some piece of code of how to use
> “raw method to resolve parameters from the request”?
>
> I am sending you this reply again because I had sent it in html format
> which the server refused.
>
> regards
> Avijit Bose
>
> On Thu, Apr 28, 2022 at 7:29 PM Avijit Bose <bose.avi...@gmail.com> wrote:
>> Hello Sir,
>>
>>
>>
>> Could you pls show me an example of how to use “raw method to resolve 
>> parameters from the request”?
>>
>>
>>
>> regards
>>
>>
>>
>> Sent from Mail for Windows
>>
>>
>>
>> From: Nicolas Malin
>> Sent: 28 April 2022 12:19 PM
>> To: user@ofbiz.apache.org
>> Subject: Re: Help required in Ofbiz development - Unable to retrieve 
>> parameter using HTTPRequest
>>
>>
>>
>> Hello,
>>
>>
>>
>> You use a raw method to resolve parameters from the request.
>>
>>
>>
>> I suggest that the problem came from the form html definition. When you
>>
>> submit do you analyzed the request send by your browser ? (F12 ->
>>
>> Network on firefox)
>>
>>
>>
>> Nicolas
>>
>>
>>
>> On 28/04/2022 05:48, Avijit Bose wrote:
>>
>>> My code is as follows:
>>> “finalizeLC.ftl”
>>>  --------------------
>>> <div class="screenlet-body">
>>>   <form method="post" action="<@ofbizUrl>finalizeLCUpdate</@ofbizUrl>"
>>>  name="finalizeLCUpdate" id="finalizeLCUpdate">
>>>            <input type="hidden" name="LcReceiveDate" value="">
>>>            <input type="hidden" name="countDownDays" value="">
>>>            <input type="hidden" name="remarks" value="">
>>>              <table width="100%" cellspacing="2">
>>>             <tbody>
>>>               <tr>
>>>                 <td align="right">
>>>                 </td>
>>>                 <td align="right">
>>>                            <label
>>> for="LcReceiveDate">${uiLabelMap.LcReceiveDate}&nbsp;</label>
>>>                 </td>
>>>                 <td colspan="4">
>>>            <input type="date" id="LcReceiveDate" name="LcReceiveDate"
>>> style="background-color:#D6F2FF" value="${LcReceiveDate!}" required>
>>>                                             </td>
>>>                 <td></td>
>>>               </tr>
>>>               <tr>
>>>                 <td align="right">
>>>                 </td>
>>>                 <td align="right">
>>>                            <label
>>> for="countDownDays">${uiLabelMap.countDownDays}&nbsp;</label>
>>>                 </td>
>>>                 <td colspan="4">
>>>                            <input type="number" id="countDownDays"
>>> name="countDownDays" style="background-color:#D6F2FF"
>>> value="${countDownDays!}" required>
>>>                                             </td>
>>>                 <td></td>
>>>               </tr>
>>>                                             <tr>
>>>                 <td align="right">
>>>                 </td>
>>>                 <td align="right">
>>>                            <label
>>> for="remarks">${uiLabelMap.remarks}&nbsp;</label>
>>>                 </td>
>>>                 <td colspan="4">
>>>                      <input type="text" id="remarks"
>>> value="${remarks!}" name="remarks" size="100"
>>> style="background-color:#D6F2FF" required>
>>>                                             </td>
>>>                 <td></td>
>>>               </tr>
>>>             </tbody>
>>>           </table>
>>>              <table width="100%" cellspacing="2">
>>>             <tbody>
>>>               <tr>
>>>                 <td align="right">
>>>                 </td>
>>>                 <td align="right">
>>>                 </td>
>>>                 <td>
>>>                      <button type="submit" form="finalizeLCUpdate"
>>> value="Submit">${uiLabelMap.finalizeLC}</button>
>>>            </td>
>>>                 <td></td>
>>>               </tr>
>>>             </tbody>
>>>           </table>
>>> </form>
>>> </div>
>>> “UpdateLCServices.java and method finalizeLCUpdate”
>>> ------------------------------------------------------------------------------------
>>>            public static String finalizeLCUpdate(HttpServletRequest
>>> request, HttpServletResponse response) {
>>>                       Delegator delegator = (Delegator)
>>> request.getAttribute("delegator");
>>>                       String LcReceiveDate =
>>> request.getParameter("LcReceiveDate").trim();
>>>                      String countDownDays =
>>> request.getParameter("countDownDays").trim();
>>>                       String remarks = 
>>> request.getParameter("remarks").trim();
>>>                      Debug.logInfo("=======LcReceiveDate=========",
>>> LcReceiveDate);
>>>                      Debug.logInfo("=======countDownDays=========",
>>> countDownDays);
>>>                      Debug.logInfo("=======remarks=========", remarks);
>>>                }
>>> “Controller”
>>> ----------------
>>> <request-map uri="finalizeLCUpdate">
>>>         <security https="true" auth="true"/>
>>>         <event type="java" path="com.akm.exim.events.UpdateLCServices"
>>> invoke="finalizeLCUpdate"/>
>>>         <response name="success" type="view" value="exportHome"/>
>>>     </request-map>
>>> I am passing hidden values from the “finalizeLC.ftl” file and unable
>>> to retrieve data in the java class “UpdateLCServices.java and method
>>> finalizeLCUpdate”. Debug.loginfo showing null values.
>>> Pls help in how to pass form parameter values to ftl java class in Ofbiz.
>>> Regards
>>> Avijit Bose
>>
>>
>>

Reply via email to