[Lift] Re: How can i get the user IP address in the lift ?
OK, Got it. Thank guys! Thanks for these useful information! Cheers, Neil On Dec 20, 5:38 pm, Timothy Perrett wrote: > Personally, i'd drop the lambda, and do: > > S.containerRequest.map(_.remoteAddress).openOr("localhost") > > the map returns a Box[String], so we can get access and provide a > handy default if need be. If you dont want that, just do a pattern > match or whatever you want. > > Cheers, Tim > > On Dec 20, 2:38 am, Jarod Liu wrote: > > > S.containerRequest.map(r=>println(r.remoteAddress)) > > > On Dec 20, 4:18 am, "Neil.Lv" wrote: > > > > Hi all, > > > > I want to get the IP address of the users. > > > > How can i get the remote IP address in the lift? > > > > Thanks for any suggestion! > > > > Cheers, > > > Neil -- You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
[Lift] Re: How can i get the user IP address in the lift ?
Personally, i'd drop the lambda, and do: S.containerRequest.map(_.remoteAddress).openOr("localhost") the map returns a Box[String], so we can get access and provide a handy default if need be. If you dont want that, just do a pattern match or whatever you want. Cheers, Tim On Dec 20, 2:38 am, Jarod Liu wrote: > S.containerRequest.map(r=>println(r.remoteAddress)) > > On Dec 20, 4:18 am, "Neil.Lv" wrote: > > > > > Hi all, > > > I want to get the IP address of the users. > > > How can i get the remote IP address in the lift? > > > Thanks for any suggestion! > > > Cheers, > > Neil -- You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.
[Lift] Re: How can i get the user IP address in the lift ?
S.containerRequest.map(r=>println(r.remoteAddress)) On Dec 20, 4:18 am, "Neil.Lv" wrote: > Hi all, > > I want to get the IP address of the users. > > How can i get the remote IP address in the lift? > > Thanks for any suggestion! > > Cheers, > Neil -- You received this message because you are subscribed to the Google Groups "Lift" group. To post to this group, send email to lift...@googlegroups.com. To unsubscribe from this group, send email to liftweb+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/liftweb?hl=en.