Can someone please tell me the differnce between UtilMisc.tomap(nameX,valueX) and mapObj.put(nameX,valueX)
Ex from loginWorker.java---login() method: Map inMap = UtilMisc.toMap("login.username", username, "login.password", password, "locale", UtilHttp.getLocale(request)); inMap.put("userLoginId", username); inMap.put("currentPassword", password); inMap.put("newPassword", request.getParameter("newPassword")); inMap.put("newPasswordVerify", request.getParameter("newPasswordVerify")); Thakyou very much.. |
UtilMisc.toMap() takes key/value pairs and creates a Map from them
Map.put() adds a key/value pair to an existing Map Regards Scott 2008/10/28 adithi agarwal <[hidden email]>: > Can someone please tell me the differnce between UtilMisc.tomap(nameX,valueX) and mapObj.put(nameX,valueX) > > Ex from loginWorker.java---login() method: > > Map inMap = UtilMisc.toMap("login.username", username, "login.password", password, "locale", UtilHttp.getLocale(request)); > inMap.put("userLoginId", username); > inMap.put("currentPassword", password); > inMap.put("newPassword", request.getParameter("newPassword")); > inMap.put("newPasswordVerify", request.getParameter("newPasswordVerify")); > > Thakyou very much.. > > > > |
Hi Thanks for the reply
But in this example (in the previous mail) there will be two keys(login.username and userLoginId) for the same value"username" Thanks --- On Tue, 10/28/08, Scott Gray <[hidden email]> wrote: From: Scott Gray <[hidden email]> Subject: Re: differnce between.. To: [hidden email], [hidden email] Date: Tuesday, October 28, 2008, 3:07 AM UtilMisc.toMap() takes key/value pairs and creates a Map from them Map.put() adds a key/value pair to an existing Map Regards Scott 2008/10/28 adithi agarwal <[hidden email]>: > Can someone please tell me the differnce between UtilMisc.tomap(nameX,valueX) and mapObj.put(nameX,valueX) > > Ex from loginWorker.java---login() method: > > Map inMap = UtilMisc.toMap("login.username", username, "login.password", password, "locale", UtilHttp.getLocale(request)); > inMap.put("userLoginId", username); > inMap.put("currentPassword", password); > inMap.put("newPassword", request.getParameter("newPassword")); > inMap.put("newPasswordVerify", request.getParameter("newPasswordVerify")); > > Thakyou very much.. > > > > |
scotts reply as to the use of UtilMisc.toMap() which is what you ask, is
correct. the uses of the info, has more to do with the context of the information. best answer is there is different information required in both situations they are not similar. adithi agarwal sent the following on 10/28/2008 6:45 AM: > Hi Thanks for the reply > But in this example (in the previous mail) there will be two keys(login.username and userLoginId) for the same value"username" > > Thanks > > --- On Tue, 10/28/08, Scott Gray <[hidden email]> wrote: > From: Scott Gray <[hidden email]> > Subject: Re: differnce between.. > To: [hidden email], [hidden email] > Date: Tuesday, October 28, 2008, 3:07 AM > > UtilMisc.toMap() takes key/value pairs and creates a Map from them > Map.put() adds a key/value pair to an existing Map > > Regards > Scott > > 2008/10/28 adithi agarwal <[hidden email]>: >> Can someone please tell me the differnce between > UtilMisc.tomap(nameX,valueX) and mapObj.put(nameX,valueX) >> Ex from loginWorker.java---login() method: >> >> Map inMap = UtilMisc.toMap("login.username", username, > "login.password", password, "locale", > UtilHttp.getLocale(request)); >> inMap.put("userLoginId", username); >> inMap.put("currentPassword", password); >> inMap.put("newPassword", > request.getParameter("newPassword")); >> inMap.put("newPasswordVerify", > request.getParameter("newPasswordVerify")); >> Thakyou very much.. >> >> >> >> > > > > |
Free forum by Nabble | Edit this page |