You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Struts2 Fan <st...@gmail.com> on 2007/01/30 12:48:25 UTC
Getting the ip address in the Action
Hi community,
How can I get the client's ip address on the action's execute method?
Thanks...
Re: Getting the ip address in the Action
Posted by Nuwan Chandrasoma <my...@gmail.com>.
http://struts.apache.org/2.x/docs/how-can-we-access-the-httpservletrequest.html
----- Original Message -----
From: "Struts2 Fan" <st...@gmail.com>
To: "Struts Users Mailing List" <us...@struts.apache.org>
Sent: Tuesday, January 30, 2007 12:03 PM
Subject: Re: Getting the ip address in the Action
>I want to get it in Struts 2 and How can I get the request?
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Re: Getting the ip address in the Action
Posted by Struts2 Fan <st...@gmail.com>.
I want to get it in Struts 2 and How can I get the request?
Re: Getting the ip address in the Action
Posted by Gareth Evans <ga...@msoft.co.uk>.
request.getRemoteAddr();
Gareth
Struts2 Fan wrote:
> Hi community,
>
> How can I get the client's ip address on the action's execute method?
>
> Thanks...
>
--
Gareth Evans
Senior Developer
MSoft eSolutions Limited
Technology Centre
Inward Way
Rossmore Business Park
Ellesmere Port
Cheshire
CH65 3EN
--
Tel: +44 (0)870 0100 704
Fax: +44 (0)870 9010 705
E-Mail: gareth@msoft.co.uk
Web: www.msoft.co.uk
----------------------------------------------
Terms:
Please note that any prices quoted within this e-mail are subject to VAT.
All program details and code described in this e-mail are subject to
copyright © of MSoft eSolutions Limited and remain the intellectual
property of MSoft eSolutions Limited.
Any proposal or pricing information contained within this e-mail are
subject to MSoft eSolutions' Terms and Conditions
----------------------------------------------
Disclaimer:
This message is intended only for use of the addressee. If this message
was sent to you in error, please notify the sender and delete this
message. MSoft eSolutions Limited cannot accept responsibility for viruses,
so please scan attachments. Views expressed in this message do not
necessarily reflect those of MSoft eSolutions Limited who will not
necessarily be bound by its contents.
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org
Problem with formatting money amounts with bean:write formatKey=
Posted by Adam Lipscombe <ad...@expensys.com>.
Folks
I am using "<bean:write name="myBean" property="beanProperty" formatKey="global.moneyFormat"/>
global.moneyFormat is defined in the vanilla ApplicationResources.properties file as "#,##0.00"
To support users in France and Germany there are also ApplicationResources_fr and
ApplicationResources_de property files. These define the moneyFormat as "# ##0,00" and "#.##0,00".
This all works fine.
But, when a user accesses the system from a client whose locale uses a non-USA/UK style currency
format string and the locale is NOT France or Germany (e.g. "#.##0,00" - Portugal or Brazil) the
system fails with "javax.servlet.ServletException: Wrong format string: '#,##0.00'"
I think what is happening is that the system is using the default global.moneyFormat property String
from vanilla ApplicationResources file which is what I would expect.
But when this default pattern is applied it does not match the one expected by the client-side
locale and so the pattern application fails.
What I thought was supposed to happen was that if an appropriate ApplicationResources_XX.properties
file could not be found the "global.moneyFormat" property from the vanilla properties file would be
used and simply applied?
Does anyone know what is supposed to happen?
Is it necessary to have a separate ApplicationResources_XX props file for every locale that might
access the system? Surely not?
TIA - Adam
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org