ofbiz-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Prabhakar Pandey <nginx.p...@gmail.com>
Subject Re: Errors with JAava code in OFBiz
Date Thu, 19 Jul 2012 07:34:42 GMT
Hello,
have you added the corresponding folder into src ?


On Wed, Jul 18, 2012 at 9:08 PM, G.Ben <g.benabdellah@gmail.com> wrote:

> Hi All,
>
> i've been following a tutoriel and once entered this Java Code
> public static String processMultiForm (HttpServletRequest request,
> HttpServletResponse response){
> Collection parsed = UtilHttp.parseMultiFormData
> (UtilHttp.getParameterMap(request));
> List combined = new ArrayList();
> Iterator parsedItr = parsed.iterator();
> while (parsedItr.hasNext()) {
> Map record = (Map)parsedItr.next();
> combined.add(record.get("firstName") + " " +
> record.get("lastName"));
> }
> request.setAttribute("combined", combined);
> request.setAttribute("allParams",
> UtilHttp.getParameterMap(request));
> request.setAttribute("submit", "Submitted");
> return "success";
> }
>
> with Eclipse IDE, it helped to recognise errors (about cast), I correct
> them,
> public static String processMultiForm (HttpServletRequest request,
>                         HttpServletResponse response){
>                         Collection parsed = (Collection)
> UtilHttp.parseMultiFormData
>                         (UtilHttp.getParameterMap(request));
>                         List combined = (List) new ArrayList();
>                         Iterator parsedItr = (Iterator)
> ((java.util.Collection<Map&lt;String,Object>>) parsed).iterator();
>                         while (((java.util.Iterator<Map&lt;String,
> Object>>)
> parsedItr).hasNext()) {
>                         Map record =
> (Map)((java.util.Iterator<Map&lt;String, Object>>)
> parsedItr).next();
>                         combined.add(record.get("firstName") + " " +
>                         record.get("lastName"));
>                         }
>                         request.setAttribute("combined", combined);
>                         request.setAttribute("allParams",
>                         UtilHttp.getParameterMap(request));
>                         request.setAttribute("submit", "Submitted");
>                         return "success";
>                         }
>  however errors still remain.
> Please can anyone give me the correct code that I should put
>
> Thank you so much for your help.
>
> Regards.
>
> --
> View this message in context:
> http://ofbiz.135035.n4.nabble.com/Errors-with-JAava-code-in-OFBiz-tp4635012.html
> Sent from the OFBiz - User mailing list archive at Nabble.com.
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message