You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by "Gundersen, Richard" <Ri...@london-scottish.com> on 2008/10/07 12:08:44 UTC

RegexFieldValidator

Sorry, basic question but my RegexFieldValidator isn't working quite as
I thought it would. 

I just want to be able to specify a decimal point, so I escape the dot,
but the compiler complains. Could someone tell me how to specify
12345.67 as a regex for this?

^[0-9]{1,5}\.[0-9]{2}$		(doesn't compile in Eclipse)
\b[0-9]{1,5}\.[0-9]{2}\b	(doesn't compile in Eclipse)
[0-9]{1,5}.[0-9]{2}		(compiles, but is not correct)

I'm using it like this btw:
@RegexFieldValidator(key="validate.amount", fieldName="amount",
message="", expression="[0-9]{1,5}\.[0-9]{2}")

Thanks (sorry, I have googled etc, but I am also lame at regex...!)

Richard Gundersen
Java Developer
 
Email: richard.gundersen@london-scottish.com
Phone: 01618302398
Fax: 01618342536
London Scottish Bank plc
24 Mount Street
Manchester
M2 3LS

-----Original Message-----
From: Mead Lai [mailto:laiqinyi@gmail.com] 
Sent: Tuesday, October 07, 2008 7:50 AM
To: Struts Users Mailing List
Subject: Re: how to pass parameter in next action

It's same like the parameter from jsp page.

AddComboValue?parm1=${value}
in your Action declare a

public String parm1;
getParm1()
setParm1()

now just use parm1 the get the value.
good luck.

On Tue, Oct 7, 2008 at 2:38 PM, Hardik Shah <ha...@yahoo.com>
wrote:

>
> Thanks for reply
>
> and how i can get this parameter in my addattribute action java file
>
> using actioncontext or what?
>
>
>
>
> Mead Lai wrote:
> >
> >  <action name="AddAttribute"
> > class="com.docmgmt.struts.actions.attribute.SaveAttribute">
> >                <result type="redirect-action">attriblist</result>
> >                <result name="ComboForm"
> > type="redirect-action">AddComboValue?parm1=${value}</result>
> >        </action>
> >
> > append the actionName "AddComboValue?parm1=${value}", but no
".action".
> > It's OK!
> >
> >
> > On Tue, Oct 7, 2008 at 1:22 PM, Hardik Shah <ha...@yahoo.com>
> wrote:
> >
> >>
> >> can anybody say how to pass or push parameter in valuestack and get
it
> >> from
> >> another action in struts 2
> >>
> >> really confused with all valuestack stuff
> >>
> >> suppose
> >>
> >> i have
> >>
> >> ----------------------------------------------------
> >> <action name="AddComboValue"
> >> class="com.docmgmt.struts.actions.attribute.SaveAttribute"
> >> method="AddComboValue">
> >>        <result>/attribute/AttribComboValue.jsp</result>
> >>
> >>        </action>
> >>
> >>        <action name="AddAttribute"
> >> class="com.docmgmt.struts.actions.attribute.SaveAttribute">
> >>                <result type="redirect-action">attriblist</result>
> >>                <result name="ComboForm"
> >> type="redirect-action">AddComboValue</result>
> >>        </action>
> >>
> >> -------------------------------------------------------
> >>
> >> i want to put my one parameter attrid  in request scope when
executing
> >> AddAttribute action if result type ComboForm and want to get from
> >> AddComboValue action java file in struts 2.0.11.2
> >>
> >> can anybody gives me a way?
> >> thanks in advance
> >>
> >>
> >>
> >> --
> >> View this message in context:
> >>
>
http://www.nabble.com/how-to-pass-parameter-in-next-action-tp19851255p19
851255.html
> >> Sent from the Struts - User mailing list archive at Nabble.com.
> >>
> >>
> >>
---------------------------------------------------------------------
> >> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> >> For additional commands, e-mail: user-help@struts.apache.org
> >>
> >>
> >
> >
> > --
> > BestRegards,
> > Mead
> > http://yayisoft.com
> >
> > Dick Cavett  - "If your parents never had children, chances are you
won't
> > either."
> >
> >
>
> --
> View this message in context:
>
http://www.nabble.com/how-to-pass-parameter-in-next-action-tp19851255p19
851925.html
> Sent from the Struts - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>


-- 
BestRegards,
Mead
http://yayisoft.com

Everett Dirksen  - "A billion here and a billion there, and soon you're
talking about real money."


______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email 
______________________________________________________________________

As a responsible corporate citizen, London Scottish Bank plc asks you to consider the environment before printing this email.

*** Disclaimer *** 

This electronic communication is confidential and for the exclusive use of the addressee. It may contain private and confidential information. The information, attachments and opinions contained in this E-mail are those of its author only and do not necessarily represent those of London Scottish Bank PLC or any other members of the London Scottish Group. 

If you are not the intended addressee, you are prohibited from any disclosure, distribution or further copying or use of this communication or the information in it or taking any action in reliance on it. If you have received this communication in error please notify the Information Security Manager at ISM@London-Scottish.com as soon as possible and delete the message from all places in your computer where it is stored. 

We utilise virus scanning software but we cannot guarantee the security of electronic communications and you are advised to check any attachments for viruses. We do not accept liability for any loss resulting from any corruption or alteration of data or importation of any virus as a result of receiving this electronic communication. 

Replies to this E-mail may be monitored for operational or business reasons. London Scottish Bank PLC is authorised and regulated by the Financial Services Authority.


London Scottish Bank plc, Registered Office: 201 Deansgate, Manchester M3 3NW Registered Number 973008 England.

Subsidiary Companies:-

London Scottish Finance Limited, Registered Office: 201 Deansgate, Manchester M3 3NW Registered Number 233259 England.

London Scottish Broking Limited, Registered Office: 201 Deansgate, Manchester M3 3NW Registered Number 230110 England.

Robinson Way & Company Limited, Registered Office: 201 Deansgate, Manchester M3 3NW Registered Number 885896 England.

______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org