Re: Validation Question with Indexed Properties

2004-03-22 Thread Craig Tataryn
friendly *bump*

On Sun, 21 Mar 2004 18:12:54 -0600 (CST), Craig Tataryn wrote:

 
 Hi, I have the following definition in my validation.xml file:
 
 formset
   form name=MarketAddressForm
   field
   property=provStateId
   indexedListProperty=address
   depends=required
   arg0 key=Listing.formError.streetProvState/
   /field
   /form
 /formset
 
 I then have a form that is built like so:
 % addressIndex = address( + region.getKey() + ); %
 html:select styleClass=Field property='%=addressIndex + .provStateId%'
 .
 .
 .
 /html:select
 
 This generates HTML that looks like:
 
 select name=address(355).provStateId class=Field
 .
 .
 .
 /select
 
 However, if I look at the javascript generated by html:javascript 
 formName=addressForm, I find:
 
  var bCancel = false; 
 
 function validateMarketAddressForm(form) {   
  
 
 
 if (bCancel) 
   return true; 
 else 
return validateRequired(form); 
} 
 
 function required () { 
 } 
 
 So does this mean that indexed properties for the validator do not work in 
 javascript?  Or am I
 doing something wrong?
 
 Thanks,
 
 Craig
 tataryn:craig/
 
 tataryn:craig/
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


tataryn:craig/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Validation Question with Indexed Properties

2004-03-21 Thread Craig Tataryn
Hi, I have the following definition in my validation.xml file:

formset
form name=MarketAddressForm
field
property=provStateId
indexedListProperty=address
depends=required
arg0 key=Listing.formError.streetProvState/
/field
/form
/formset

I then have a form that is built like so:
% addressIndex = address( + region.getKey() + ); %
html:select styleClass=Field property='%=addressIndex + .provStateId%'
.
.
.
/html:select

This generates HTML that looks like:

select name=address(355).provStateId class=Field
.
.
.
/select

However, if I look at the javascript generated by html:javascript 
formName=addressForm, I find:

 var bCancel = false; 

function validateMarketAddressForm(form) { 
 

if (bCancel) 
  return true; 
else 
   return validateRequired(form); 
   } 

function required () { 
} 

So does this mean that indexed properties for the validator do not work in javascript? 
 Or am I
doing something wrong?

Thanks,

Craig
tataryn:craig/


tataryn:craig/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: validwhen validation question

2004-03-19 Thread Mah R
Is it possisble to use validwhen for date fields like comparing dates?
 


Brendan Richards [EMAIL PROTECTED] wrote:
I'm looking at using validwhen for a complex validation. 

I've got a value that can either be ignored when another parameter is
set or is valid when it's a date.

A simple date validation would be something like this:



datePatterndd-MM-var


Can a validwhen call another validation? Giving you something like





test
((ignoreDate == yes) or ( #insert date
validation# ))



or should I just write my own validation rule / do it with javascript
before I submit?



Thanks,

Brendan

Do you Yahoo!?
Yahoo! Finance Tax Center - File online. File on time.

validwhen validation question

2004-03-18 Thread Brendan Richards
I'm looking at using validwhen for a complex validation. 
 
I've got a value that can either be ignored when another parameter is
set or is valid when it's a date.
 
A simple date validation would be something like this:
field property=date depends=required,date
arg0 key=myForm.date/
 
varvar-namedatePattern/var-namevar-valuedd-MM-/var-value/
var
/field
 
Can a validwhen call another validation? Giving you something like
 
 
field property=date depends=validwhen
  arg0 key=myform.date/
var
  var-nametest/var-name
  var-value((ignoreDate == yes) or ( #insert date
validation#  ))/var-value
/var
  /field
 
or should I just write my own validation rule / do it with javascript
before I submit?
 
 
 
Thanks,
 
Brendan


Client Side Validation Question

2004-02-20 Thread Juan Carlos Paramá
 Hi,

 I have a little problem with validation. I have a form with a field
 html:text that show the property de a bean in a session scope. If the
 field is empty at the load of the page the validation works right, but if
 the property have any value at the load the validation (required) fail. I
 think that cause is the render of the html:text to:

 input value=some value

and the value is not null. If the form field is cleared in the screen is
 empty but code fail to validate.

Are there a workaround for this?

Thanks in advance.

-- 
Juan Carlos Paramá





-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Struts check box validation question

2004-02-11 Thread Ben Anderson
right, so I'm assuming you're iterating over a list of all books somehow.  
This is how I did something similar.  In your submitting jsp:
   c:forEach items=${books} var=row
   .
   html:multibox property=bookList
   c:out value=${row.bookKey}/
   /html:multibox
 ..
   /c:forEach

in your struts-config:
   form-bean
   name=booktForm
   type=org.apache.struts.validator.DynaValidatorActionForm
   form-property name=bookList type=java.lang.String[]/
...
in your action:
   if( form instanceof DynaActionForm ){
   DynaActionForm dynaForm = ((DynaActionForm)form);
   String[] bookList = dynaForm.get(bookList);
..

From: Samyukta Akunuru [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Subject: RE: Struts check box validation question
Date: Tue, 10 Feb 2004 14:46:46 -0600
Ben,

I am using a checkbox.
What I am planning to do is allow the user to check/select items/checkboxes 
on the book display page and check/select the books he wants to delete from 
Book store.
On submitting the form, I want to capture the set/list of checked choices 
so that I can take it as a array and pass it to my deleteBooks() method in 
my Action class.
Please let me know if I was not clear and I could append my sample code 
snippets.
I appreciate your swift replies

Thanks,
~Samy
-Original Message-
From: Ben Anderson [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 10, 2004 2:37 PM
To: [EMAIL PROTECTED]
Subject: RE: Struts check box validation question
not too sure what you mean by your question, but I'd say no, you don't need
to pass in the array.  You're using a String[] as the form property, right?
Are you using multibox?
http://jakarta.apache.org/struts/userGuide/struts-html.html#multibox

From: Samyukta Akunuru [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Subject: RE: Struts check box validation question
Date: Tue, 10 Feb 2004 14:30:34 -0600

Thanks Ben, I am looking at the code closer now, but do we have to pass 
in
the array of selections to the ActionForm class from the jsp

Regards,
Samy.

-Original Message-
From: Ben Anderson [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 10, 2004 2:28 PM
To: [EMAIL PROTECTED]
Subject: RE: Struts check box validation question


Here's code I got from Kris Schneider.  It validates that at least one of
the check boxes was checked, but you should be able to change it fairly
easily to do whatever you want.  If you're wondering how this code fits 
in,
check out:
http://jakarta.apache.org/struts/userGuide/dev_validator.html
and look at validateTwoFields to see how to setup of custom validate
methods.

 public static boolean validateRequiredArray(Object bean,
 ValidatorAction va,
 Field field,
 ActionErrors errors,
 HttpServletRequest
request)
{
 boolean isValid = false;

 LOG.debug(bean:  + bean);

 Object[] array = null;
 if (isArray(bean)) {
 array = (Object[])bean;
 } else {
 Object fieldProperty = null;
 try {
 fieldProperty = PropertyUtils.getProperty(bean,
field.getProperty());
 } catch (Exception exc) {
 // TODO: throw runtime exception?
 LOG.error(exc.getMessage(), exc);
 }
 LOG.debug(fieldProperty:  + fieldProperty);
 if (isArray(fieldProperty)) {
 array = (Object[])fieldProperty;
 }
 }

 if (array != null) {
 for (int i = 0, n = array.length; i  n; i++) {
 Object obj = array[i];
 LOG.debug(array[ + i + ]: ' + obj + ');
 String value = ((obj == null) ? null : obj.toString());
 if (!GenericValidator.isBlankOrNull(value)) {
 isValid = true;
 break;
 }
 }
 }

 if (!isValid) {
 errors.add(field.getKey(), Resources.getActionError(request,
va,
field));
 }

 LOG.debug(isValid:  + isValid);

 return isValid;
 }

 public static boolean isArray(Object obj) {
 return ((obj == null) || obj.getClass().isArray());
 }
}

-Ben

 From: Samyukta Akunuru [EMAIL PROTECTED]
 Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: Struts check box validation question
 Date: Tue, 10 Feb 2004 12:57:23 -0600
 
 Had a quick question on power of struts form

Struts check box validation question

2004-02-10 Thread Samyukta A

Had a quick question on power of struts form validation.Sample code to validate 
checkboxes checked on the jsp, which will be sent as an array to the Struts Action 
Form. Tips appreciate.Thanks in advance!

 

Thanks!



-
Do you Yahoo!?
Yahoo! Finance: Get your refund fast by filing online

Struts check box validation question

2004-02-10 Thread Samyukta Akunuru
Had a quick question on power of struts form validation.Sample code to validate 
checkboxes checked on the jsp, which will be sent as an array to the Struts Action 
Form. Tips appreciate.Thanks in advance!

Best Regards,
Samy



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Struts check box validation question

2004-02-10 Thread Ben Anderson
Here's code I got from Kris Schneider.  It validates that at least one of 
the check boxes was checked, but you should be able to change it fairly 
easily to do whatever you want.  If you're wondering how this code fits in, 
check out:
http://jakarta.apache.org/struts/userGuide/dev_validator.html
and look at validateTwoFields to see how to setup of custom validate 
methods.

   public static boolean validateRequiredArray(Object bean,
   ValidatorAction va,
   Field field,
   ActionErrors errors,
   HttpServletRequest request) 
{
   boolean isValid = false;

   LOG.debug(bean:  + bean);

   Object[] array = null;
   if (isArray(bean)) {
   array = (Object[])bean;
   } else {
   Object fieldProperty = null;
   try {
   fieldProperty = PropertyUtils.getProperty(bean, 
field.getProperty());
   } catch (Exception exc) {
   // TODO: throw runtime exception?
   LOG.error(exc.getMessage(), exc);
   }
   LOG.debug(fieldProperty:  + fieldProperty);
   if (isArray(fieldProperty)) {
   array = (Object[])fieldProperty;
   }
   }

   if (array != null) {
   for (int i = 0, n = array.length; i  n; i++) {
   Object obj = array[i];
   LOG.debug(array[ + i + ]: ' + obj + ');
   String value = ((obj == null) ? null : obj.toString());
   if (!GenericValidator.isBlankOrNull(value)) {
   isValid = true;
   break;
   }
   }
   }
   if (!isValid) {
   errors.add(field.getKey(), Resources.getActionError(request, va, 
field));
   }

   LOG.debug(isValid:  + isValid);

   return isValid;
   }
   public static boolean isArray(Object obj) {
   return ((obj == null) || obj.getClass().isArray());
   }
}
-Ben

From: Samyukta Akunuru [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Struts check box validation question
Date: Tue, 10 Feb 2004 12:57:23 -0600
Had a quick question on power of struts form validation.Sample code to 
validate checkboxes checked on the jsp, which will be sent as an array to 
the Struts Action Form. Tips appreciate.Thanks in advance!

Best Regards,
Samy


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
_
Plan your next US getaway to one of the super destinations here. 
http://special.msn.com/local/hotdestinations.armx

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Struts check box validation question

2004-02-10 Thread Samyukta Akunuru
Thanks Ben, I am looking at the code closer now, but do we have to pass in the array 
of selections to the ActionForm class from the jsp

Regards,
Samy.

-Original Message-
From: Ben Anderson [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 10, 2004 2:28 PM
To: [EMAIL PROTECTED]
Subject: RE: Struts check box validation question


Here's code I got from Kris Schneider.  It validates that at least one of 
the check boxes was checked, but you should be able to change it fairly 
easily to do whatever you want.  If you're wondering how this code fits in, 
check out:
http://jakarta.apache.org/struts/userGuide/dev_validator.html
and look at validateTwoFields to see how to setup of custom validate 
methods.

public static boolean validateRequiredArray(Object bean,
ValidatorAction va,
Field field,
ActionErrors errors,
HttpServletRequest request) 
{
boolean isValid = false;

LOG.debug(bean:  + bean);

Object[] array = null;
if (isArray(bean)) {
array = (Object[])bean;
} else {
Object fieldProperty = null;
try {
fieldProperty = PropertyUtils.getProperty(bean, 
field.getProperty());
} catch (Exception exc) {
// TODO: throw runtime exception?
LOG.error(exc.getMessage(), exc);
}
LOG.debug(fieldProperty:  + fieldProperty);
if (isArray(fieldProperty)) {
array = (Object[])fieldProperty;
}
}

if (array != null) {
for (int i = 0, n = array.length; i  n; i++) {
Object obj = array[i];
LOG.debug(array[ + i + ]: ' + obj + ');
String value = ((obj == null) ? null : obj.toString());
if (!GenericValidator.isBlankOrNull(value)) {
isValid = true;
break;
}
}
}

if (!isValid) {
errors.add(field.getKey(), Resources.getActionError(request, va, 
field));
}

LOG.debug(isValid:  + isValid);

return isValid;
}

public static boolean isArray(Object obj) {
return ((obj == null) || obj.getClass().isArray());
}
}

-Ben

From: Samyukta Akunuru [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Struts check box validation question
Date: Tue, 10 Feb 2004 12:57:23 -0600

Had a quick question on power of struts form validation.Sample code to 
validate checkboxes checked on the jsp, which will be sent as an array to 
the Struts Action Form. Tips appreciate.Thanks in advance!

Best Regards,
Samy



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


_
Plan your next US getaway to one of the super destinations here. 
http://special.msn.com/local/hotdestinations.armx


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Struts check box validation question

2004-02-10 Thread Ben Anderson
not too sure what you mean by your question, but I'd say no, you don't need 
to pass in the array.  You're using a String[] as the form property, right?  
Are you using multibox?

http://jakarta.apache.org/struts/userGuide/struts-html.html#multibox

From: Samyukta Akunuru [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Subject: RE: Struts check box validation question
Date: Tue, 10 Feb 2004 14:30:34 -0600
Thanks Ben, I am looking at the code closer now, but do we have to pass in 
the array of selections to the ActionForm class from the jsp

Regards,
Samy.
-Original Message-
From: Ben Anderson [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 10, 2004 2:28 PM
To: [EMAIL PROTECTED]
Subject: RE: Struts check box validation question
Here's code I got from Kris Schneider.  It validates that at least one of
the check boxes was checked, but you should be able to change it fairly
easily to do whatever you want.  If you're wondering how this code fits in,
check out:
http://jakarta.apache.org/struts/userGuide/dev_validator.html
and look at validateTwoFields to see how to setup of custom validate
methods.
public static boolean validateRequiredArray(Object bean,
ValidatorAction va,
Field field,
ActionErrors errors,
HttpServletRequest 
request)
{
boolean isValid = false;

LOG.debug(bean:  + bean);

Object[] array = null;
if (isArray(bean)) {
array = (Object[])bean;
} else {
Object fieldProperty = null;
try {
fieldProperty = PropertyUtils.getProperty(bean,
field.getProperty());
} catch (Exception exc) {
// TODO: throw runtime exception?
LOG.error(exc.getMessage(), exc);
}
LOG.debug(fieldProperty:  + fieldProperty);
if (isArray(fieldProperty)) {
array = (Object[])fieldProperty;
}
}
if (array != null) {
for (int i = 0, n = array.length; i  n; i++) {
Object obj = array[i];
LOG.debug(array[ + i + ]: ' + obj + ');
String value = ((obj == null) ? null : obj.toString());
if (!GenericValidator.isBlankOrNull(value)) {
isValid = true;
break;
}
}
}
if (!isValid) {
errors.add(field.getKey(), Resources.getActionError(request, 
va,
field));
}

LOG.debug(isValid:  + isValid);

return isValid;
}
public static boolean isArray(Object obj) {
return ((obj == null) || obj.getClass().isArray());
}
}
-Ben

From: Samyukta Akunuru [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Subject: Struts check box validation question
Date: Tue, 10 Feb 2004 12:57:23 -0600

Had a quick question on power of struts form validation.Sample code to
validate checkboxes checked on the jsp, which will be sent as an array to
the Struts Action Form. Tips appreciate.Thanks in advance!

Best Regards,
Samy



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

_
Plan your next US getaway to one of the super destinations here.
http://special.msn.com/local/hotdestinations.armx
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
_
Check out the great features of the new MSN 9 Dial-up, with the MSN Dial-up 
Accelerator. http://click.atdmt.com/AVE/go/onm00200361ave/direct/01/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Struts check box validation question

2004-02-10 Thread Samyukta Akunuru
Ben,

I am using a checkbox.
What I am planning to do is allow the user to check/select items/checkboxes on the 
book display page and check/select the books he wants to delete from Book store.
On submitting the form, I want to capture the set/list of checked choices so that I 
can take it as a array and pass it to my deleteBooks() method in my Action class.
Please let me know if I was not clear and I could append my sample code snippets.
I appreciate your swift replies 

Thanks,
~Samy

-Original Message-
From: Ben Anderson [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 10, 2004 2:37 PM
To: [EMAIL PROTECTED]
Subject: RE: Struts check box validation question


not too sure what you mean by your question, but I'd say no, you don't need 
to pass in the array.  You're using a String[] as the form property, right?  
Are you using multibox?

http://jakarta.apache.org/struts/userGuide/struts-html.html#multibox

From: Samyukta Akunuru [EMAIL PROTECTED]
Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Subject: RE: Struts check box validation question
Date: Tue, 10 Feb 2004 14:30:34 -0600

Thanks Ben, I am looking at the code closer now, but do we have to pass in 
the array of selections to the ActionForm class from the jsp

Regards,
Samy.

-Original Message-
From: Ben Anderson [mailto:[EMAIL PROTECTED]
Sent: Tuesday, February 10, 2004 2:28 PM
To: [EMAIL PROTECTED]
Subject: RE: Struts check box validation question


Here's code I got from Kris Schneider.  It validates that at least one of
the check boxes was checked, but you should be able to change it fairly
easily to do whatever you want.  If you're wondering how this code fits in,
check out:
http://jakarta.apache.org/struts/userGuide/dev_validator.html
and look at validateTwoFields to see how to setup of custom validate
methods.

 public static boolean validateRequiredArray(Object bean,
 ValidatorAction va,
 Field field,
 ActionErrors errors,
 HttpServletRequest 
request)
{
 boolean isValid = false;

 LOG.debug(bean:  + bean);

 Object[] array = null;
 if (isArray(bean)) {
 array = (Object[])bean;
 } else {
 Object fieldProperty = null;
 try {
 fieldProperty = PropertyUtils.getProperty(bean,
field.getProperty());
 } catch (Exception exc) {
 // TODO: throw runtime exception?
 LOG.error(exc.getMessage(), exc);
 }
 LOG.debug(fieldProperty:  + fieldProperty);
 if (isArray(fieldProperty)) {
 array = (Object[])fieldProperty;
 }
 }

 if (array != null) {
 for (int i = 0, n = array.length; i  n; i++) {
 Object obj = array[i];
 LOG.debug(array[ + i + ]: ' + obj + ');
 String value = ((obj == null) ? null : obj.toString());
 if (!GenericValidator.isBlankOrNull(value)) {
 isValid = true;
 break;
 }
 }
 }

 if (!isValid) {
 errors.add(field.getKey(), Resources.getActionError(request, 
va,
field));
 }

 LOG.debug(isValid:  + isValid);

 return isValid;
 }

 public static boolean isArray(Object obj) {
 return ((obj == null) || obj.getClass().isArray());
 }
}

-Ben

 From: Samyukta Akunuru [EMAIL PROTECTED]
 Reply-To: Struts Users Mailing List [EMAIL PROTECTED]
 To: [EMAIL PROTECTED]
 Subject: Struts check box validation question
 Date: Tue, 10 Feb 2004 12:57:23 -0600
 
 Had a quick question on power of struts form validation.Sample code to
 validate checkboxes checked on the jsp, which will be sent as an array to
 the Struts Action Form. Tips appreciate.Thanks in advance!
 
 Best Regards,
 Samy
 
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 

_
Plan your next US getaway to one of the super destinations here.
http://special.msn.com/local/hotdestinations.armx


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


_
Check out the great features of the new MSN 9 Dial-up, with the MSN Dial-up 
Accelerator. http://click.atdmt.com/AVE/go/onm00200361ave/direct/01

RE: form validation question

2004-01-28 Thread Andy Kriger
It didn't make any difference if I used an action or the JSP for the input
attribute. 

-Original Message-
From: Geeta Ramani [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, January 27, 2004 6:55 PM
To: Struts Users Mailing List
Subject: Re: form validation question

Ok, maybe, I'd have to check into struts code to really be
certain(input
surely has some significance is what i'm thinking..) So just for the heck of
it though, what happens if you do say /web/forms/orderForm.jsp instead?

Andy Kriger wrote:

 OrderForm.do = /web/forms/orderForm.jsp That shouldn't make a 
 difference. I like to refer to actions rather than JSPs to minimize 
 the number of things I have to change if a JSP changes to a different 
 JSP or to another action.

 -Original Message-
 From: Geeta Ramani [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, January 27, 2004 3:27 PM
 To: Struts Users Mailing List
 Subject: Re: form validation question

 Andy:

 Any reason why you have the unusual input param..?

 action path=/SubmitOrder
   type=MyClass
   name=orderForm
   validate=true
   input=/OrderForm.do
   scope=request
  forward name=success path=/OrderThanks.do/ /action
 

 I woud have thought you'd use this instead:

 action path=/SubmitOrder
   type=MyClass
   name=orderForm
   validate=true
   input=/web/forms/orderForm.jsp
   scope=request
  forward name=success path=/OrderThanks.do/ /action
 

 Regards,
 Geeta

 
  Andy Kriger wrote:
 
   I am having a curious problem with form validation. I submit a 
   form, see in the logs that the form fails to validate, however, 
   the webapp does not return to the input page (I get a blank page 
   with no HTML in it), so I do not see the form with error messages 
   as expected. If I put text in the field, the form does submit 
   correctly and I see the JSP specified in the resulting action 
   chain. The log files have no error messages indicating something 
   is amiss. When validation fails, the subsequent action is 
   definitely not running (I do not see the
 logging in the execute method).
  
   Does anyone have any ideas what could be happening here?
   Or how I can track down the problem?
   Below is the relevant info...
  
   === STRUTS CONFIG ===
  
   action path=/OrderForm forward=/web/forms/orderForm.jsp /
  
   action path=/SubmitOrder
type=MyClass
name=orderForm
validate=true
input=/OrderForm.do
scope=request
   forward name=success path=/OrderThanks.do/ /action
  
   action path=/OrderThanks parameter=/web/orderThanks.jsp
   type=org.apache.struts.actions.ForwardAction/
  
   === orderForm.jsp ===
   logic:messagesPresent
   html:messages id=err
   %=err%br/
   /html:messages
   /logic:messagesPresent
  
   html:form action=SubmitOrder.do
   html:text property=firstName styleId=firstName
size=20/
   html:submit value=Press Me/ /html:form
  
   === VALIDATION CONFIG ===
   form name=orderForm
   field property=firstName depends=required
   arg0 key=orderForm.firstName.label name=required
/
   /field
   /form
  
   === LOG MESSAGES ===
   [org.apache.struts.action.RequestProcessor][RequestProcessor]
   Validating input form properties
   [org.apache.struts.action.RequestProcessor][RequestProcessor]
   Validation failed, returning to '/OrderForm.do'
  
   Andy Kriger | Software Mechanic | Greater Than One, Inc.
   28 West 27th Street | 7th Floor | New York, NY 10001
   P: 212.252.7197 | F: 212.252.7364 | E: [EMAIL PROTECTED]
 
  
  - To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: form validation question

2004-01-28 Thread Andy Kriger
Looks like there is a functional change or bug in the action input attribute
in Struts 1.1 - a forward name must be used instead of the location of a JSP
or Action. Not sure why this change happened between 1.1RC and 1.1rel -
maybe someone on the Struts dev team can answer?

-Original Message-
From: Andy Kriger [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, January 27, 2004 2:46 PM
To: Struts Users Mailing List
Subject: form validation question

I am having a curious problem with form validation. I submit a form, see in
the logs that the form fails to validate, however, the webapp does not
return to the input page (I get a blank page with no HTML in it), so I do
not see the form with error messages as expected. If I put text in the
field, the form does submit correctly and I see the JSP specified in the
resulting action chain. The log files have no error messages indicating
something is amiss. When validation fails, the subsequent action is
definitely not running (I do not see the logging in the execute method).

Does anyone have any ideas what could be happening here? 
Or how I can track down the problem?
Below is the relevant info...

=== STRUTS CONFIG ===

action path=/OrderForm forward=/web/forms/orderForm.jsp /

action path=/SubmitOrder 
 type=MyClass
 name=orderForm 
 validate=true 
 input=/OrderForm.do
 scope=request
forward name=success path=/OrderThanks.do/ /action

action path=/OrderThanks parameter=/web/orderThanks.jsp
type=org.apache.struts.actions.ForwardAction/

=== orderForm.jsp ===
logic:messagesPresent
html:messages id=err
%=err%br/
/html:messages
/logic:messagesPresent

html:form action=SubmitOrder.do
html:text property=firstName styleId=firstName size=20/
html:submit value=Press Me/
/html:form

=== VALIDATION CONFIG ===
form name=orderForm
field property=firstName depends=required
arg0 key=orderForm.firstName.label name=required /
/field
/form

=== LOG MESSAGES ===
[org.apache.struts.action.RequestProcessor][RequestProcessor]
Validating input form properties
[org.apache.struts.action.RequestProcessor][RequestProcessor]
Validation failed, returning to '/OrderForm.do'



Andy Kriger | Software Mechanic | Greater Than One, Inc.
28 West 27th Street | 7th Floor | New York, NY 10001
P: 212.252.7197 | F: 212.252.7364 | E: [EMAIL PROTECTED] 



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



form validation question

2004-01-27 Thread Andy Kriger
I am having a curious problem with form validation. I submit a form, see in
the logs that the form fails to validate, however, the webapp does not
return to the input page (I get a blank page with no HTML in it), so I do
not see the form with error messages as expected. If I put text in the
field, the form does submit correctly and I see the JSP specified in the
resulting action chain. The log files have no error messages indicating
something is amiss. When validation fails, the subsequent action is
definitely not running (I do not see the logging in the execute method).

Does anyone have any ideas what could be happening here? 
Or how I can track down the problem?
Below is the relevant info...

=== STRUTS CONFIG ===

action path=/OrderForm forward=/web/forms/orderForm.jsp /

action path=/SubmitOrder 
 type=MyClass
 name=orderForm 
 validate=true 
 input=/OrderForm.do
 scope=request
forward name=success path=/OrderThanks.do/
/action

action path=/OrderThanks parameter=/web/orderThanks.jsp
type=org.apache.struts.actions.ForwardAction/

=== orderForm.jsp ===
logic:messagesPresent
html:messages id=err
%=err%br/
/html:messages
/logic:messagesPresent

html:form action=SubmitOrder.do
html:text property=firstName styleId=firstName size=20/
html:submit value=Press Me/
/html:form

=== VALIDATION CONFIG ===
form name=orderForm
field property=firstName depends=required
arg0 key=orderForm.firstName.label name=required /
/field
/form

=== LOG MESSAGES ===
[org.apache.struts.action.RequestProcessor][RequestProcessor]
Validating input form properties
[org.apache.struts.action.RequestProcessor][RequestProcessor]
Validation failed, returning to '/OrderForm.do'



Andy Kriger | Software Mechanic | Greater Than One, Inc.
28 West 27th Street | 7th Floor | New York, NY 10001
P: 212.252.7197 | F: 212.252.7364 | E: [EMAIL PROTECTED] 



Re: form validation question

2004-01-27 Thread Geeta Ramani
Andy:

What do you see in the source of the html page..? Maybe it is just a question
of display not working right..?

Geeta

Andy Kriger wrote:

 I am having a curious problem with form validation. I submit a form, see in
 the logs that the form fails to validate, however, the webapp does not
 return to the input page (I get a blank page with no HTML in it), so I do
 not see the form with error messages as expected. If I put text in the
 field, the form does submit correctly and I see the JSP specified in the
 resulting action chain. The log files have no error messages indicating
 something is amiss. When validation fails, the subsequent action is
 definitely not running (I do not see the logging in the execute method).

 Does anyone have any ideas what could be happening here?
 Or how I can track down the problem?
 Below is the relevant info...

 === STRUTS CONFIG ===

 action path=/OrderForm forward=/web/forms/orderForm.jsp /

 action path=/SubmitOrder
  type=MyClass
  name=orderForm
  validate=true
  input=/OrderForm.do
  scope=request
 forward name=success path=/OrderThanks.do/
 /action

 action path=/OrderThanks parameter=/web/orderThanks.jsp
 type=org.apache.struts.actions.ForwardAction/

 === orderForm.jsp ===
 logic:messagesPresent
 html:messages id=err
 %=err%br/
 /html:messages
 /logic:messagesPresent

 html:form action=SubmitOrder.do
 html:text property=firstName styleId=firstName size=20/
 html:submit value=Press Me/
 /html:form

 === VALIDATION CONFIG ===
 form name=orderForm
 field property=firstName depends=required
 arg0 key=orderForm.firstName.label name=required /
 /field
 /form

 === LOG MESSAGES ===
 [org.apache.struts.action.RequestProcessor][RequestProcessor]
 Validating input form properties
 [org.apache.struts.action.RequestProcessor][RequestProcessor]
 Validation failed, returning to '/OrderForm.do'

 Andy Kriger | Software Mechanic | Greater Than One, Inc.
 28 West 27th Street | 7th Floor | New York, NY 10001
 P: 212.252.7197 | F: 212.252.7364 | E: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: form validation question

2004-01-27 Thread Andy Kriger
I see an empty page - no HTML, no nothing. It's as if the handoff to the
input path never happens, even though the logging informs me that validation
failed and the input path is being returned to. When you say 'a question of
display not working right', what do you have in mind? 

-Original Message-
From: Geeta Ramani [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, January 27, 2004 3:05 PM
To: Struts Users Mailing List
Subject: Re: form validation question

Andy:

What do you see in the source of the html page..? Maybe it is just a
question of display not working right..?

Geeta

Andy Kriger wrote:

 I am having a curious problem with form validation. I submit a form, 
 see in the logs that the form fails to validate, however, the webapp 
 does not return to the input page (I get a blank page with no HTML in 
 it), so I do not see the form with error messages as expected. If I 
 put text in the field, the form does submit correctly and I see the 
 JSP specified in the resulting action chain. The log files have no 
 error messages indicating something is amiss. When validation fails, 
 the subsequent action is definitely not running (I do not see the logging
in the execute method).

 Does anyone have any ideas what could be happening here?
 Or how I can track down the problem?
 Below is the relevant info...

 === STRUTS CONFIG ===

 action path=/OrderForm forward=/web/forms/orderForm.jsp /

 action path=/SubmitOrder
  type=MyClass
  name=orderForm
  validate=true
  input=/OrderForm.do
  scope=request
 forward name=success path=/OrderThanks.do/ /action

 action path=/OrderThanks parameter=/web/orderThanks.jsp
 type=org.apache.struts.actions.ForwardAction/

 === orderForm.jsp ===
 logic:messagesPresent
 html:messages id=err
 %=err%br/
 /html:messages
 /logic:messagesPresent

 html:form action=SubmitOrder.do
 html:text property=firstName styleId=firstName size=20/
 html:submit value=Press Me/ /html:form

 === VALIDATION CONFIG ===
 form name=orderForm
 field property=firstName depends=required
 arg0 key=orderForm.firstName.label name=required /
 /field
 /form

 === LOG MESSAGES ===
 [org.apache.struts.action.RequestProcessor][RequestProcessor]
 Validating input form properties
 [org.apache.struts.action.RequestProcessor][RequestProcessor]
 Validation failed, returning to '/OrderForm.do'

 Andy Kriger | Software Mechanic | Greater Than One, Inc.
 28 West 27th Street | 7th Floor | New York, NY 10001
 P: 212.252.7197 | F: 212.252.7364 | E: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: form validation question

2004-01-27 Thread Barnett, Brian W.
Your orderForm does extend ValidatorForm instead of ActionForm right? The
struts validator plug-in relies on your forms extending ValidatorForm in
order to do server-side validations.

Out of curiosity, you may want to see if client-side validation works first.

html:form action=SubmitOrder.do onsubmit=return
validateOrderForm(this)
...
/html:form
validator:javascript formName=orderForm/

When the submit button is pressed, if the required field is empty, you
should get a message window indicating the field is required.

Brian Barnett


-Original Message-
From: Andy Kriger [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, January 27, 2004 1:16 PM
To: 'Struts Users Mailing List'
Subject: RE: form validation question

I see an empty page - no HTML, no nothing. It's as if the handoff to the
input path never happens, even though the logging informs me that validation
failed and the input path is being returned to. When you say 'a question of
display not working right', what do you have in mind? 

-Original Message-
From: Geeta Ramani [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, January 27, 2004 3:05 PM
To: Struts Users Mailing List
Subject: Re: form validation question

Andy:

What do you see in the source of the html page..? Maybe it is just a
question of display not working right..?

Geeta

Andy Kriger wrote:

 I am having a curious problem with form validation. I submit a form, 
 see in the logs that the form fails to validate, however, the webapp 
 does not return to the input page (I get a blank page with no HTML in 
 it), so I do not see the form with error messages as expected. If I 
 put text in the field, the form does submit correctly and I see the 
 JSP specified in the resulting action chain. The log files have no 
 error messages indicating something is amiss. When validation fails, 
 the subsequent action is definitely not running (I do not see the logging
in the execute method).

 Does anyone have any ideas what could be happening here?
 Or how I can track down the problem?
 Below is the relevant info...

 === STRUTS CONFIG ===

 action path=/OrderForm forward=/web/forms/orderForm.jsp /

 action path=/SubmitOrder
  type=MyClass
  name=orderForm
  validate=true
  input=/OrderForm.do
  scope=request
 forward name=success path=/OrderThanks.do/ /action

 action path=/OrderThanks parameter=/web/orderThanks.jsp
 type=org.apache.struts.actions.ForwardAction/

 === orderForm.jsp ===
 logic:messagesPresent
 html:messages id=err
 %=err%br/
 /html:messages
 /logic:messagesPresent

 html:form action=SubmitOrder.do
 html:text property=firstName styleId=firstName size=20/
 html:submit value=Press Me/ /html:form

 === VALIDATION CONFIG ===
 form name=orderForm
 field property=firstName depends=required
 arg0 key=orderForm.firstName.label name=required /
 /field
 /form

 === LOG MESSAGES ===
 [org.apache.struts.action.RequestProcessor][RequestProcessor]
 Validating input form properties
 [org.apache.struts.action.RequestProcessor][RequestProcessor]
 Validation failed, returning to '/OrderForm.do'

 Andy Kriger | Software Mechanic | Greater Than One, Inc.
 28 West 27th Street | 7th Floor | New York, NY 10001
 P: 212.252.7197 | F: 212.252.7364 | E: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: form validation question

2004-01-27 Thread Geeta Ramani
Andy:

Any reason why you have the unusual input param..?

action path=/SubmitOrder
  type=MyClass
  name=orderForm
  validate=true
  input=/OrderForm.do
  scope=request
 forward name=success path=/OrderThanks.do/
 /action


I woud have thought you'd use this instead:

action path=/SubmitOrder
  type=MyClass
  name=orderForm
  validate=true
  input=/web/forms/orderForm.jsp
  scope=request
 forward name=success path=/OrderThanks.do/
 /action


Regards,
Geeta


 Andy Kriger wrote:

  I am having a curious problem with form validation. I submit a form, see in
  the logs that the form fails to validate, however, the webapp does not
  return to the input page (I get a blank page with no HTML in it), so I do
  not see the form with error messages as expected. If I put text in the
  field, the form does submit correctly and I see the JSP specified in the
  resulting action chain. The log files have no error messages indicating
  something is amiss. When validation fails, the subsequent action is
  definitely not running (I do not see the logging in the execute method).
 
  Does anyone have any ideas what could be happening here?
  Or how I can track down the problem?
  Below is the relevant info...
 
  === STRUTS CONFIG ===
 
  action path=/OrderForm forward=/web/forms/orderForm.jsp /
 
  action path=/SubmitOrder
   type=MyClass
   name=orderForm
   validate=true
   input=/OrderForm.do
   scope=request
  forward name=success path=/OrderThanks.do/
  /action
 
  action path=/OrderThanks parameter=/web/orderThanks.jsp
  type=org.apache.struts.actions.ForwardAction/
 
  === orderForm.jsp ===
  logic:messagesPresent
  html:messages id=err
  %=err%br/
  /html:messages
  /logic:messagesPresent
 
  html:form action=SubmitOrder.do
  html:text property=firstName styleId=firstName size=20/
  html:submit value=Press Me/
  /html:form
 
  === VALIDATION CONFIG ===
  form name=orderForm
  field property=firstName depends=required
  arg0 key=orderForm.firstName.label name=required /
  /field
  /form
 
  === LOG MESSAGES ===
  [org.apache.struts.action.RequestProcessor][RequestProcessor]
  Validating input form properties
  [org.apache.struts.action.RequestProcessor][RequestProcessor]
  Validation failed, returning to '/OrderForm.do'
 
  Andy Kriger | Software Mechanic | Greater Than One, Inc.
  28 West 27th Street | 7th Floor | New York, NY 10001
  P: 212.252.7197 | F: 212.252.7364 | E: [EMAIL PROTECTED]

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


RE: form validation question

2004-01-27 Thread Andy Kriger
OrderForm.do = /web/forms/orderForm.jsp
That shouldn't make a difference. I like to refer to actions rather than
JSPs to minimize the number of things I have to change if a JSP changes to a
different JSP or to another action.

-Original Message-
From: Geeta Ramani [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, January 27, 2004 3:27 PM
To: Struts Users Mailing List
Subject: Re: form validation question

Andy:

Any reason why you have the unusual input param..?

action path=/SubmitOrder
  type=MyClass
  name=orderForm
  validate=true
  input=/OrderForm.do
  scope=request
 forward name=success path=/OrderThanks.do/ /action


I woud have thought you'd use this instead:

action path=/SubmitOrder
  type=MyClass
  name=orderForm
  validate=true
  input=/web/forms/orderForm.jsp
  scope=request
 forward name=success path=/OrderThanks.do/ /action


Regards,
Geeta


 Andy Kriger wrote:

  I am having a curious problem with form validation. I submit a form, 
  see in the logs that the form fails to validate, however, the webapp 
  does not return to the input page (I get a blank page with no HTML 
  in it), so I do not see the form with error messages as expected. If 
  I put text in the field, the form does submit correctly and I see 
  the JSP specified in the resulting action chain. The log files have 
  no error messages indicating something is amiss. When validation 
  fails, the subsequent action is definitely not running (I do not see the
logging in the execute method).
 
  Does anyone have any ideas what could be happening here?
  Or how I can track down the problem?
  Below is the relevant info...
 
  === STRUTS CONFIG ===
 
  action path=/OrderForm forward=/web/forms/orderForm.jsp /
 
  action path=/SubmitOrder
   type=MyClass
   name=orderForm
   validate=true
   input=/OrderForm.do
   scope=request
  forward name=success path=/OrderThanks.do/ /action
 
  action path=/OrderThanks parameter=/web/orderThanks.jsp
  type=org.apache.struts.actions.ForwardAction/
 
  === orderForm.jsp ===
  logic:messagesPresent
  html:messages id=err
  %=err%br/
  /html:messages
  /logic:messagesPresent
 
  html:form action=SubmitOrder.do
  html:text property=firstName styleId=firstName size=20/
  html:submit value=Press Me/ /html:form
 
  === VALIDATION CONFIG ===
  form name=orderForm
  field property=firstName depends=required
  arg0 key=orderForm.firstName.label name=required /
  /field
  /form
 
  === LOG MESSAGES ===
  [org.apache.struts.action.RequestProcessor][RequestProcessor]
  Validating input form properties
  [org.apache.struts.action.RequestProcessor][RequestProcessor]
  Validation failed, returning to '/OrderForm.do'
 
  Andy Kriger | Software Mechanic | Greater Than One, Inc.
  28 West 27th Street | 7th Floor | New York, NY 10001
  P: 212.252.7197 | F: 212.252.7364 | E: [EMAIL PROTECTED]

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: form validation question

2004-01-27 Thread Andy Kriger
orderForm was extending DynaValidatorForm. I changed this to
DynaValidatorActionForm - now the form validates (though it shouldn't -
there's a required field missing). Looks like I'm one step closer to a
solution.

Thank you for the idea.

-Original Message-
From: Barnett, Brian W. [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, January 27, 2004 5:10 PM
To: 'Struts Users Mailing List'
Subject: RE: form validation question

Your orderForm does extend ValidatorForm instead of ActionForm right? The
struts validator plug-in relies on your forms extending ValidatorForm in
order to do server-side validations.

Out of curiosity, you may want to see if client-side validation works first.

html:form action=SubmitOrder.do onsubmit=return
validateOrderForm(this) ...
/html:form
validator:javascript formName=orderForm/

When the submit button is pressed, if the required field is empty, you
should get a message window indicating the field is required.

Brian Barnett


-Original Message-
From: Andy Kriger [mailto:[EMAIL PROTECTED]
Sent: Tuesday, January 27, 2004 1:16 PM
To: 'Struts Users Mailing List'
Subject: RE: form validation question

I see an empty page - no HTML, no nothing. It's as if the handoff to the
input path never happens, even though the logging informs me that validation
failed and the input path is being returned to. When you say 'a question of
display not working right', what do you have in mind? 

-Original Message-
From: Geeta Ramani [mailto:[EMAIL PROTECTED]
Sent: Tuesday, January 27, 2004 3:05 PM
To: Struts Users Mailing List
Subject: Re: form validation question

Andy:

What do you see in the source of the html page..? Maybe it is just a
question of display not working right..?

Geeta

Andy Kriger wrote:

 I am having a curious problem with form validation. I submit a form, 
 see in the logs that the form fails to validate, however, the webapp 
 does not return to the input page (I get a blank page with no HTML in 
 it), so I do not see the form with error messages as expected. If I 
 put text in the field, the form does submit correctly and I see the 
 JSP specified in the resulting action chain. The log files have no 
 error messages indicating something is amiss. When validation fails, 
 the subsequent action is definitely not running (I do not see the 
 logging
in the execute method).

 Does anyone have any ideas what could be happening here?
 Or how I can track down the problem?
 Below is the relevant info...

 === STRUTS CONFIG ===

 action path=/OrderForm forward=/web/forms/orderForm.jsp /

 action path=/SubmitOrder
  type=MyClass
  name=orderForm
  validate=true
  input=/OrderForm.do
  scope=request
 forward name=success path=/OrderThanks.do/ /action

 action path=/OrderThanks parameter=/web/orderThanks.jsp
 type=org.apache.struts.actions.ForwardAction/

 === orderForm.jsp ===
 logic:messagesPresent
 html:messages id=err
 %=err%br/
 /html:messages
 /logic:messagesPresent

 html:form action=SubmitOrder.do
 html:text property=firstName styleId=firstName size=20/
 html:submit value=Press Me/ /html:form

 === VALIDATION CONFIG ===
 form name=orderForm
 field property=firstName depends=required
 arg0 key=orderForm.firstName.label name=required /
 /field
 /form

 === LOG MESSAGES ===
 [org.apache.struts.action.RequestProcessor][RequestProcessor]
 Validating input form properties
 [org.apache.struts.action.RequestProcessor][RequestProcessor]
 Validation failed, returning to '/OrderForm.do'

 Andy Kriger | Software Mechanic | Greater Than One, Inc.
 28 West 27th Street | 7th Floor | New York, NY 10001
 P: 212.252.7197 | F: 212.252.7364 | E: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: form validation question

2004-01-27 Thread Geeta Ramani
Ok, maybe, I'd have to check into struts code to really be certain(input
surely has some significance is what i'm thinking..) So just for the heck of it
though, what happens if you do say /web/forms/orderForm.jsp instead?

Andy Kriger wrote:

 OrderForm.do = /web/forms/orderForm.jsp
 That shouldn't make a difference. I like to refer to actions rather than
 JSPs to minimize the number of things I have to change if a JSP changes to a
 different JSP or to another action.

 -Original Message-
 From: Geeta Ramani [mailto:[EMAIL PROTECTED]
 Sent: Tuesday, January 27, 2004 3:27 PM
 To: Struts Users Mailing List
 Subject: Re: form validation question

 Andy:

 Any reason why you have the unusual input param..?

 action path=/SubmitOrder
   type=MyClass
   name=orderForm
   validate=true
   input=/OrderForm.do
   scope=request
  forward name=success path=/OrderThanks.do/ /action
 

 I woud have thought you'd use this instead:

 action path=/SubmitOrder
   type=MyClass
   name=orderForm
   validate=true
   input=/web/forms/orderForm.jsp
   scope=request
  forward name=success path=/OrderThanks.do/ /action
 

 Regards,
 Geeta

 
  Andy Kriger wrote:
 
   I am having a curious problem with form validation. I submit a form,
   see in the logs that the form fails to validate, however, the webapp
   does not return to the input page (I get a blank page with no HTML
   in it), so I do not see the form with error messages as expected. If
   I put text in the field, the form does submit correctly and I see
   the JSP specified in the resulting action chain. The log files have
   no error messages indicating something is amiss. When validation
   fails, the subsequent action is definitely not running (I do not see the
 logging in the execute method).
  
   Does anyone have any ideas what could be happening here?
   Or how I can track down the problem?
   Below is the relevant info...
  
   === STRUTS CONFIG ===
  
   action path=/OrderForm forward=/web/forms/orderForm.jsp /
  
   action path=/SubmitOrder
type=MyClass
name=orderForm
validate=true
input=/OrderForm.do
scope=request
   forward name=success path=/OrderThanks.do/ /action
  
   action path=/OrderThanks parameter=/web/orderThanks.jsp
   type=org.apache.struts.actions.ForwardAction/
  
   === orderForm.jsp ===
   logic:messagesPresent
   html:messages id=err
   %=err%br/
   /html:messages
   /logic:messagesPresent
  
   html:form action=SubmitOrder.do
   html:text property=firstName styleId=firstName size=20/
   html:submit value=Press Me/ /html:form
  
   === VALIDATION CONFIG ===
   form name=orderForm
   field property=firstName depends=required
   arg0 key=orderForm.firstName.label name=required /
   /field
   /form
  
   === LOG MESSAGES ===
   [org.apache.struts.action.RequestProcessor][RequestProcessor]
   Validating input form properties
   [org.apache.struts.action.RequestProcessor][RequestProcessor]
   Validation failed, returning to '/OrderForm.do'
  
   Andy Kriger | Software Mechanic | Greater Than One, Inc.
   28 West 27th Street | 7th Floor | New York, NY 10001
   P: 212.252.7197 | F: 212.252.7364 | E: [EMAIL PROTECTED]
 
  -
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



validation question

2004-01-20 Thread Nandita Rajagopalan
Hi,

I have a form that is shared my multiple JSPs. My problem comes in validating the 
form. One text field which is required in a page is not in the other. How do I set up 
the validation.xml to be generic enough so that the above condition can be met.

Thanks for any help.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: validation question

2004-01-20 Thread Matthias Wessendorf
hi

use the DynaValidatorActionForm

in validate.xml
enter the path of submit instead of complete-formbeanName

name=/submit1

and so on

greetings



-Original Message-
From: Nandita Rajagopalan [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, January 20, 2004 5:24 PM
To: [EMAIL PROTECTED]
Subject: validation question


Hi,

I have a form that is shared my multiple JSPs. My problem comes in
validating the form. One text field which is required in a page is not
in the other. How do I set up the validation.xml to be generic enough so
that the above condition can be met.

Thanks for any help.



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



validation question

2003-09-15 Thread Stephane Grenier
Hello all.

Is there any way to decide if I want to validate the jsp within the action rather than 
in struts-config ?

Thank you,
Stephane

RE: validation question

2003-09-15 Thread Yuan, Saul (TOR-ML)
In your action mappings in struts-config, you can set validate=false,
and do your validation in the action class. Not sure if this is what you
want.

Saul



 -Original Message-
 From: Stephane Grenier [mailto:[EMAIL PROTECTED]
 Sent: Monday, September 15, 2003 5:12 PM
 To: Struts Users Mailing List
 Subject: validation question
 
 
 
 
 
 Hello all.
 
 Is there any way to decide if I want to validate the jsp within the
action
 rather than in struts-config ?
 
 Thank you,
 Stephane
 


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Validation question

2003-07-28 Thread Yansheng Lin
Try

errors.add(ActionErrors.GLOBAL_ERROR, new ActionError(errors.userNotFound,
userName);

-Original Message-
From: Bailey, Shane C. [mailto:[EMAIL PROTECTED] 
Sent: July 28, 2003 1:37 PM
To: [EMAIL PROTECTED]
Subject: Validation question


 

I have been using the validator plug-in so long now that I can't remember
how this simple thing works:

 

In an action I determine that the user (as described in a request parameter)
is not in the DB so I want to return an error message to the user

with the username they entered incorrectly.  Here is a code snipet:

 

Action code:

 

public ActionForward execute(ActionMapping mapping,

 ActionForm form,

 HttpServletRequest request,

 HttpServletResponse response)

throws Exception {

 

String nameOfUserToUpd =
request.getParameter(username);



DynaActionForm editUserForm = (DynaActionForm)form;

 

UpdateUserSession updSession = new
UpdateUserSession(nameOfUserToUpd);

User user = updSession.getUser();

 

if(user==null)

{

//Add error

errors.add(userName, new
ActionError(errors.userNotFound));

saveErrors(request, errors);



//Set the form variable because the
username came in from a GET not a POST.

editUserForm.set(userName,
nameOfUserToUpd);

 

return
(mapping.findForward(userNotFound));

} 

 

...

}

 

properties file:

errors.userNotFound='{0}' was not found.

 

On the page mapped to userNotFound it displays as:'{0}' was not found

 

I thought by having the first parameter to errors.add() with the same name
as an attribute on the form bean it would automatically fill in '{0}' 

This is way past validation and has nothing to do with what is in
validation.xml so I can't specify arg0 value.

 

How do I accomplish what I am trying to do?



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Validation question

2003-07-28 Thread Bailey, Shane C.


Thanks.

One minor change needed, the actual value needed to be passed and not the
name of the of a form bean:

errors.add(ActionErrors.GLOBAL_ERROR, new ActionError(errors.userNotFound,
nameOfUserToUpd);




-Original Message-
From: Yansheng Lin [mailto:[EMAIL PROTECTED] 
Sent: Monday, July 28, 2003 3:59 PM
To: 'Struts Users Mailing List'
Subject: RE: Validation question

Try

errors.add(ActionErrors.GLOBAL_ERROR, new ActionError(errors.userNotFound,
userName);

-Original Message-
From: Bailey, Shane C. [mailto:[EMAIL PROTECTED] 
Sent: July 28, 2003 1:37 PM
To: [EMAIL PROTECTED]
Subject: Validation question


 

I have been using the validator plug-in so long now that I can't remember
how this simple thing works:

 

In an action I determine that the user (as described in a request parameter)
is not in the DB so I want to return an error message to the user

with the username they entered incorrectly.  Here is a code snipet:

 

Action code:

 

public ActionForward execute(ActionMapping mapping,

 ActionForm form,

 HttpServletRequest request,

 HttpServletResponse response)

throws Exception {

 

String nameOfUserToUpd =
request.getParameter(username);



DynaActionForm editUserForm = (DynaActionForm)form;

 

UpdateUserSession updSession = new
UpdateUserSession(nameOfUserToUpd);

User user = updSession.getUser();

 

if(user==null)

{

//Add error

errors.add(userName, new
ActionError(errors.userNotFound));

saveErrors(request, errors);



//Set the form variable because the
username came in from a GET not a POST.

editUserForm.set(userName,
nameOfUserToUpd);

 

return
(mapping.findForward(userNotFound));

} 

 

...

}

 

properties file:

errors.userNotFound='{0}' was not found.

 

On the page mapped to userNotFound it displays as:'{0}' was not found

 

I thought by having the first parameter to errors.add() with the same name
as an attribute on the form bean it would automatically fill in '{0}' 

This is way past validation and has nothing to do with what is in
validation.xml so I can't specify arg0 value.

 

How do I accomplish what I am trying to do?



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Custom Validation question

2003-07-02 Thread Brian McSweeney
Seeing as I'm doing so well today, getting my problems solved,
I thought I'd give this one a go.

I am validating some fields automatically using a ValidatorForm.
 
However, some fields I validate myself by overwriting the validate
method
as follows:
 
public ActionErrors validate( ActionMapping mapping,
HttpServletRequest request ) {
// this should call the validate on the automatic stuff
ActionErrors errors = super.validate( mapping, request );
if (errors == null) {
errors = new ActionErrors(  );
}

.my custom validation.

return errors;
}
 
Now what I am trying to do is use custom validation to validate a credit
card.
For example,
 
if ( field1==specific_value  field2==other_value ){
validateCreditCard( field3 );
}
 
What I would like to know is, if there is a way to call the built in
server side 
validateCreditCard, or validateEmailAddress etc, methods directly from
my 
class?
 
Thanks again!
Brian
 
 
 
 


Validation question

2003-06-05 Thread Hurdle, Robert H, PERSCOM
I am trying to set up the Struts validator to have two required fields on my
input form; userid and acesloccd.  When the input form should display I get
an error msg:

 

Error Message: No getter method for property acesloccd of bean
org.apache.struts.taglib.html.BEAN

 

The input form never displays so it never gets submitted.  I would have
expected to get something like this on submitting the form.

 

I have a get method for acesloccd in the ActionForm associated with
submitting input.  Any guidance on what I'm doing wrong will be greatly
appreciated.

 

Robert Hurdle



Validation question

2003-06-05 Thread Hurdle, Robert H, PERSCOM
Never mind.  Next time I'll search the archive before asking the question.
The answer came from Craig McClanahan.

 

Struts uses the naming design patterns of the JavaBeans

specification.  Therefore, if you have a property named foo, it looks for
methods getFoo() and setFoo(), while a method fooBar would get translated
to getFooBar() and setFooBar().  You can also override these method names
by providing a BeanInfo class for your bean -- see the JavaBeans spec for
more information.

 



Struts Validation Question

2003-06-03 Thread Ranj Nadarajah
I've been trying to make validator work with our application.  However, I've 
not been
very successful.  Here is what I did.  Please let me know if I missed 
anything.

I've created a form with firstName and LastName fields.  The validator 
should
see if that the form is not empty.  Howver, when I don't fill in and submit, 
I get
to the next page.  I don't see the validator checking for errors and 
reporting.
I followed the guidelines in http://www.onjava.com/lpt/a/2912

1) Put the commons-validator.jar,jakarta-oro.jar and the struts.jar in the 
lib folder
2) Put the validator-rules.xml file in the web-inf directory.
3) created the validator.xml file in the web-inf directory and put the 
following in the
validation.xml file:

form-validation

   !-- == Default Language Form Definitions = 
--
   formset

 form  name=com.gdm.form.FBOrder

field  property=firstName
	   depends=required,minlength
	 arg0 key=orderForm.firstname.displayname/
arg1 name=minlength key=${var:minlength} 
resource=false/
var
  var-nameminLength/var-name
  var-value5/var-value
/var
/field

   /form

 /formset

/form-validation

4) Created the ActionForm class and extended it from validator.form

5) Called the ((FBOrder)form).validate(..) method from the action class

6) Created the following code in struts-config.xml

 plug-in className=org.apache.struts.validator.ValidatorPlugIn
   set-property
 property=pathnames vaue=/WEB-INF/validator-rules.xml, 
/WEB-INF/validation.xml /
 /plug-in

7) put the following code in the jsp page.

logic:messagesPresent
bean:message key=errors.header/
ul
   html:messages id=error
 libean:write name=error//li
/html:messages
/ulhr
/logic:messagesPresent
7) Put the following in the applicationresources.properties file.
button.cancel=Cancel
button.confirm=Confirm
button.reset=Reset
button.save=Save
# Errors
errors.footer=
errors.header=h3font color=redValidation Error/font/h3You must 
correct the following error(s) before proceeding:
errors.ioException=I/O exception rendering error messages: {0}
error.database.missing=liUser database is missing, cannot validate logon 
credentials/li
errors.required={0} is required.
errors.minlength={0} can not be less than {1} characters.
errors.maxlength={0} can not be greater than {1} characters.
errors.invalid={0} is invalid.

errors.byte={0} must be an byte.
errors.short={0} must be an short.
errors.integer={0} must be an integer.
errors.long={0} must be an long.
errors.float={0} must be an float.
errors.double={0} must be an double.
errors.date={0} is not a date.

errors.range={0} is not in the range {1} through {2}.

errors.creditcard={0} is not a valid credit card number.

errors.email={0} is an invalid e-mail address.

#Order Form
orderForm.firstname.displayname=First Name
orderForm.lastname.displayname=Last Name
_
Help STOP SPAM with the new MSN 8 and get 2 months FREE*  
http://join.msn.com/?page=features/junkmail

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Struts Validation Question

2003-06-03 Thread Bailey, Shane C.

What does your action mapping look like in the struts-config?  Also, I
believe, by the time you are in the action validation will already be
performed (once you have it working properly).  So you don't have a call to
validate() or anything to do with validation in the action.


-Original Message-
From: Ranj Nadarajah [mailto:[EMAIL PROTECTED] 
Sent: Monday, June 02, 2003 10:03 AM
To: [EMAIL PROTECTED]
Subject: Struts Validation Question

I've been trying to make validator work with our application.  However, I've

not been
very successful.  Here is what I did.  Please let me know if I missed 
anything.

I've created a form with firstName and LastName fields.  The validator 
should
see if that the form is not empty.  Howver, when I don't fill in and submit,

I get
to the next page.  I don't see the validator checking for errors and 
reporting.
I followed the guidelines in http://www.onjava.com/lpt/a/2912


1) Put the commons-validator.jar,jakarta-oro.jar and the struts.jar in the 
lib folder
2) Put the validator-rules.xml file in the web-inf directory.
3) created the validator.xml file in the web-inf directory and put the 
following in the
validation.xml file:

form-validation

!-- == Default Language Form Definitions = 
--
formset

  form  name=com.gdm.form.FBOrder

 field  property=firstName
   depends=required,minlength
 arg0 key=orderForm.firstname.displayname/
 arg1 name=minlength key=${var:minlength} 
resource=false/
 var
   var-nameminLength/var-name
   var-value5/var-value
 /var
 /field

/form

  /formset


/form-validation


4) Created the ActionForm class and extended it from validator.form

5) Called the ((FBOrder)form).validate(..) method from the action class

6) Created the following code in struts-config.xml

  plug-in className=org.apache.struts.validator.ValidatorPlugIn
set-property
  property=pathnames vaue=/WEB-INF/validator-rules.xml, 
/WEB-INF/validation.xml /
  /plug-in


7) put the following code in the jsp page.

logic:messagesPresent
bean:message key=errors.header/
ul
html:messages id=error
  libean:write name=error//li
/html:messages
/ulhr
/logic:messagesPresent

7) Put the following in the applicationresources.properties file.
button.cancel=Cancel
button.confirm=Confirm
button.reset=Reset
button.save=Save

# Errors
errors.footer=
errors.header=h3font color=redValidation Error/font/h3You must 
correct the following error(s) before proceeding:
errors.ioException=I/O exception rendering error messages: {0}
error.database.missing=liUser database is missing, cannot validate logon 
credentials/li
errors.required={0} is required.
errors.minlength={0} can not be less than {1} characters.
errors.maxlength={0} can not be greater than {1} characters.
errors.invalid={0} is invalid.

errors.byte={0} must be an byte.
errors.short={0} must be an short.
errors.integer={0} must be an integer.
errors.long={0} must be an long.
errors.float={0} must be an float.
errors.double={0} must be an double.

errors.date={0} is not a date.

errors.range={0} is not in the range {1} through {2}.

errors.creditcard={0} is not a valid credit card number.

errors.email={0} is an invalid e-mail address.

#Order Form
orderForm.firstname.displayname=First Name
orderForm.lastname.displayname=Last Name

_
Help STOP SPAM with the new MSN 8 and get 2 months FREE*  
http://join.msn.com/?page=features/junkmail


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Struts Validation Question

2003-06-03 Thread Shashank Dixit
Test msg .. pls ignore
Shashank S. Dixit Senior Software Engineer Datamatics Ltd. Contact: 28291253
ext 133 Mobile: 9820930075
- Original Message -
From: Bailey, Shane C. [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Sent: Monday, June 02, 2003 7:32 PM
Subject: RE: Struts Validation Question



 What does your action mapping look like in the struts-config?  Also, I
 believe, by the time you are in the action validation will already be
 performed (once you have it working properly).  So you don't have a call
to
 validate() or anything to do with validation in the action.


 -Original Message-
 From: Ranj Nadarajah [mailto:[EMAIL PROTECTED]
 Sent: Monday, June 02, 2003 10:03 AM
 To: [EMAIL PROTECTED]
 Subject: Struts Validation Question

 I've been trying to make validator work with our application.  However,
I've

 not been
 very successful.  Here is what I did.  Please let me know if I missed
 anything.

 I've created a form with firstName and LastName fields.  The validator
 should
 see if that the form is not empty.  Howver, when I don't fill in and
submit,

 I get
 to the next page.  I don't see the validator checking for errors and
 reporting.
 I followed the guidelines in http://www.onjava.com/lpt/a/2912


 1) Put the commons-validator.jar,jakarta-oro.jar and the struts.jar in the
 lib folder
 2) Put the validator-rules.xml file in the web-inf directory.
 3) created the validator.xml file in the web-inf directory and put the
 following in the
 validation.xml file:

 form-validation

 !-- == Default Language Form Definitions
=
 --
 formset

   form  name=com.gdm.form.FBOrder

  field  property=firstName
 depends=required,minlength
   arg0 key=orderForm.firstname.displayname/
  arg1 name=minlength key=${var:minlength}
 resource=false/
  var
var-nameminLength/var-name
var-value5/var-value
  /var
  /field

 /form

   /formset


 /form-validation


 4) Created the ActionForm class and extended it from validator.form

 5) Called the ((FBOrder)form).validate(..) method from the action class

 6) Created the following code in struts-config.xml

   plug-in className=org.apache.struts.validator.ValidatorPlugIn
 set-property
   property=pathnames vaue=/WEB-INF/validator-rules.xml,
 /WEB-INF/validation.xml /
   /plug-in


 7) put the following code in the jsp page.

 logic:messagesPresent
 bean:message key=errors.header/
 ul
 html:messages id=error
   libean:write name=error//li
 /html:messages
 /ulhr
 /logic:messagesPresent

 7) Put the following in the applicationresources.properties file.
 button.cancel=Cancel
 button.confirm=Confirm
 button.reset=Reset
 button.save=Save

 # Errors
 errors.footer=
 errors.header=h3font color=redValidation Error/font/h3You must
 correct the following error(s) before proceeding:
 errors.ioException=I/O exception rendering error messages: {0}
 error.database.missing=liUser database is missing, cannot validate logon
 credentials/li
 errors.required={0} is required.
 errors.minlength={0} can not be less than {1} characters.
 errors.maxlength={0} can not be greater than {1} characters.
 errors.invalid={0} is invalid.

 errors.byte={0} must be an byte.
 errors.short={0} must be an short.
 errors.integer={0} must be an integer.
 errors.long={0} must be an long.
 errors.float={0} must be an float.
 errors.double={0} must be an double.

 errors.date={0} is not a date.

 errors.range={0} is not in the range {1} through {2}.

 errors.creditcard={0} is not a valid credit card number.

 errors.email={0} is an invalid e-mail address.

 #Order Form
 orderForm.firstname.displayname=First Name
 orderForm.lastname.displayname=Last Name

 _
 Help STOP SPAM with the new MSN 8 and get 2 months FREE*
 http://join.msn.com/?page=features/junkmail


 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]

 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Iteration and Validation question

2003-06-01 Thread Ashok Madhavan
hi all, 
I have a case where i iterate a list and create text
box for each iteration. I use the logic:iterate tag to
do this.

How can i use the standard validation xml to do
validation in this case.

Is it possible to use the standdard validation or will
i have to write my own validate method.

Regards
Ashok Madhavan

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: form validation question

2003-03-21 Thread Marco Tedone
The values specified in the arg0...arg3 are used by the validator as a
replacement for the generic pattern {0}. If you give a closer look to the
properties you should import(unless you won't specify yours) when using the
validator, one of these will be:

{0} is required

What the arg0..arg3 causes is actually the value in the {0} to be replaced
by what you specify. So in your case you should see something similar to the
following:

phone(value from bundle) phone.ext(value from bundle) required

or 

phone.ext(value from bundle) required

Marco

 -Original Message-
 From: Andy Kriger [mailto:[EMAIL PROTECTED] 
 Sent: Thursday, March 20, 2003 11:06 PM
 To: Struts Users Mailing List
 Subject: form validation question
 
 
 I have a validation rule that looks like this...
 
 field property=phoneExt
   depends=mask
   arg0 key=phone/
   arg1 key=phone.ext/
   var
   var-namemask/var-name
   var-value^\s*\d*\s*$/var-value
   /var
 /field
 
 However, it considers the phoneExt field required. Can anyone 
 tell me why? I want the phoneExt field to be optional, and if 
 filled out, to use the given mask.
 
 thx
 andy
 
 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



form validation question

2003-03-20 Thread Andy Kriger
I have a validation rule that looks like this...

field property=phoneExt
depends=mask
arg0 key=phone/
arg1 key=phone.ext/
var
var-namemask/var-name
var-value^\s*\d*\s*$/var-value
/var
/field

However, it considers the phoneExt field required. Can anyone tell me why?
I want the phoneExt field to be optional, and if filled out, to use the
given mask.

thx
andy


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: form validation question

2003-03-20 Thread Dan Allen

Andy Kriger ([EMAIL PROTECTED]) wrote:

 I have a validation rule that looks like this...
 
 field property=phoneExt
   depends=mask
   arg0 key=phone/
   arg1 key=phone.ext/
   var
   var-namemask/var-name
   var-value^\s*\d*\s*$/var-value
   /var
 /field
 
 However, it considers the phoneExt field required. Can anyone tell me why?
 I want the phoneExt field to be optional, and if filled out, to use the
 given mask.
I believe this has been answered several times and that you just
need the newest validation-rules.xml file which makes mask optional
if not filled in, and leave the required up to the
depends=required,mask

Dan

-- 
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
Daniel Allen, [EMAIL PROTECTED]
http://www.mojavelinux.com/
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
The package said 'Windows 95 or better', so I installed Linux
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



struts validation question

2003-03-04 Thread Ashish Kulkarni
Hi,
I have 3 questiona about handling validation in struts
1.1b3, using dyna form and using validation.xml

Q1, Suppose i have to validate date for 3 different
format depending upon a value set in sessio, so if the
value of fomrat is '1' date format is  dd/MM/yy, if
'2' date format is MM/dd/yy and  '3' date format is
yy/MM/dd
Also how to use mask for field entry

Q2, Validating numeric field, for '.' and ',' for
decimal values, like in US . is used for decimal
while  in france , is used for decimal value is
double. so how do i validate depending upon local, or
using a value set in session, like if the valus is '1'
then the valid decimal is . and if the vaus is 2
the valid decimal is ,

Q3, Is there a way to validate number of digits before
decimal and after decimal, 
like valid value is 123.23 but not 12.323

Any code or defination in validation.xml will really
help, 
Do i have to write custom validtor for above
requirements or is there a way to do it in struts

Ashish







__
Do you Yahoo!?
Yahoo! Tax Center - forms, calculators, tips, more
http://taxes.yahoo.com/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Validation question

2003-02-20 Thread Thomas . Gaudin
Hi folks,

Is it possible to use the validator to check that at least one field in the
complete ActionForm is set ?
If yes, could someone give me some hints about how to do that ?
many thanks,

Thomas



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Validation question

2003-02-20 Thread Sangeetha Nagarjunan

you could check at the Form bean level by setting the flag to true for any
set .
if false after all sets are invoked then u know no value is set
Sangeetha Nagarjunan
IT Solutions India Pvt. Ltd.
Bangalore
080 - 6655122 X 2119



   
  
Thomas.Gaudin@ce   
  
llzome.com To: [EMAIL PROTECTED]  
  
   cc: 
  
02/20/2003 06:06   Subject: Validation question
  
AM 
  
Please respond 
  
to Struts Users   
  
Mailing List  
  
   
  
   
  




Hi folks,

Is it possible to use the validator to check that at least one field in the
complete ActionForm is set ?
If yes, could someone give me some hints about how to do that ?
many thanks,

Thomas



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Validation question

2003-02-20 Thread Thomas . Gaudin

 you could check at the Form bean level by setting the flag to true for
any
 set .
 if false after all sets are invoked then u know no value is set
 Sangeetha Nagarjunan
 IT Solutions India Pvt. Ltd.
 Bangalore
 080 - 6655122 X 2119

OK...
Is there any way to do so for a DynaActionForm ?
or do I have to turn my form into a standard Action ?
Cheers,

Thomas



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Re: Validation question

2003-02-20 Thread Steve Stair
You could create your own Validator

It could keep a count of the number of fields that were validated,
as well as whether any of the fields were non-empty.
Then while the last field was being validated, if could add an error
if the all the fields had been empty.



--
Steve Stair
[EMAIL PROTECTED]
(512) 463-7991

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




Validation Question

2002-11-13 Thread Andreas Langmann
Hello,

i had updated to validator-1.0 (from the struts-1.1-b2 version) and my
validation just prints out the following code...

//  End --
/SCRIPT

I miss the opening tag and my validation rules...

the tag code is:

html:javascript formName=%= formName % method=subValidate
dynamicJavascript=true staticJavascript=false/

formName is correct, and all works perfectly with the pre-release
validator version. Must i update Struts (to nightly build :-( ) ??

Tia

Andreas

-- 
Dipl. Ing. (BA) Andreas Langmann
Software Developer

ISB AG 
Karlstr. 52-54   
76133 Karlsruhe

Telefon: +49 (0)721/82800-0
Telefax: +49 (0)721/82800-82

Email: [EMAIL PROTECTED]
Internet: http://www.isb-ag.de

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




Validation Question

2002-10-22 Thread Bhamani, Nizar A TL56E
I have layed out my application to use tiles in which, it has the usual
tiles like
header, footer, bodyContent etc, inwhich the bodyContent is dynamic. For
each page
I have a form that redirects it to the tiles/template and appropriately
setting the
dynamic bodyContent page.

The sequence goes like :

1) MainPage
2) UserInfoPage
3) AdditionalUserInfoPage
and so on.

I had set up the struts application to call the Validation info on
the UserInfoPage to set certain required fields. It worked fine.
Recently I inserted a new page 'LoginPage' between the 'MainPage'
and 'UserInfoPage', which also had its own validation for userId 
and password. 

Since I have added this page, whenever the validation fails on
either the LoginPage or the UserInfoPage, it redirects to
the MainPage  

Am I missing anything ?

Nizar.

CONFIDENTIALITY
This e-mail and any attachments are confidential and also may be privileged.
If you are not the named recipient, or have otherwise received this 
communication in error, please delete it from your inbox, notify the sender
immediately, and do not disclose its contents to any other person, 
use them for any purpose, or store or copy them in any medium. 
Thank you for your cooperation. 



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




Validation question

2002-10-16 Thread Dan Tran

First I'd like if this is already answer on this list ( I did try
to search on the archive thou)

My form been has a float properties with get/set method
use float.

The user on my web page enters a invalid float value string

The question here is why my ActionForm bean does not
throw exception rather then setting the property to 0.0?

I do understand I should using String for all my form properties, but it is intrigued 
to understand this.

Any suggestion?




Form Validation Question

2002-04-05 Thread David . A . Ventimiglia

Hello,

 

I'm using a single Action Mapping for both adding and editing an entity.
The mapping looks like this:

 

action path=/editAuthorityLevel

type=com.wellsfargo.pcsweb.controller.EditAuthorityLevelAction

name=authorityLevelForm

input=/editAuthorityLevel.jsp

scope=request

  forward name=success path=/editAuthorityLevel.jsp/

/action

 

The idea is, if we come into ../editAuthorityLevel from a link that says
Add Authority Level, then there'll be no form parameters, the
authorityLevelId consequently will be null, and the EditAuthorityLevelAction
class can do nothing in this case.  If, on the other hand, we come into
../editAuthorityLevel from a form that says Edit Authority Level, then the
form fields (especially authorityLevelId) will not be null.  In this case,
if looks up the appropriate bean and populates the form with the
corresponding values.  

 

This works great until I introduce form validation.  If I implement the
form's validate() method so that it returns a non-empty ActionErrors if
required fields are not filled in, then this happens when coming in from the
Add Authority Level link.  When this happens, Struts skips the
EditAuthorityLevelAction class and tries to go directly to
../editAuthorityLevel.jsp.  This is bad because EditAuthorityLevelAction
populates several page beans that the JSP needs.

 

The central problem is this:  I'm using the ActionForm to shuttle data from
the Model side to the View side.  In one case, it's used to swizzle data out
of the model and show it in the JSP's edit form.  In the other case, it's
used to collect data from the form and send it (through the Action) back to
the model.  Only in the latter case do I care about form validation.  Yet
Struts imposes validation in both directions.  How do I get around this?

 

Cheers,

David A. Ventimiglia

Wells Fargo Private Client Services

(415) 396-0414 (work)

 




RE: Form Validation Question

2002-04-05 Thread Zeltser, Mark

How about creating 2 mappings where second mapping will have validation
turned off?

Mark.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Friday, April 05, 2002 3:36 PM
To: [EMAIL PROTECTED]
Subject: Form Validation Question


Hello,



I'm using a single Action Mapping for both adding and editing an entity.
The mapping looks like this:



action path=/editAuthorityLevel

type=com.wellsfargo.pcsweb.controller.EditAuthorityLevelAction

name=authorityLevelForm

input=/editAuthorityLevel.jsp

scope=request

  forward name=success path=/editAuthorityLevel.jsp/

/action



The idea is, if we come into ../editAuthorityLevel from a link that says
Add Authority Level, then there'll be no form parameters, the
authorityLevelId consequently will be null, and the EditAuthorityLevelAction
class can do nothing in this case.  If, on the other hand, we come into
../editAuthorityLevel from a form that says Edit Authority Level, then the
form fields (especially authorityLevelId) will not be null.  In this case,
if looks up the appropriate bean and populates the form with the
corresponding values.



This works great until I introduce form validation.  If I implement the
form's validate() method so that it returns a non-empty ActionErrors if
required fields are not filled in, then this happens when coming in from the
Add Authority Level link.  When this happens, Struts skips the
EditAuthorityLevelAction class and tries to go directly to
../editAuthorityLevel.jsp.  This is bad because EditAuthorityLevelAction
populates several page beans that the JSP needs.



The central problem is this:  I'm using the ActionForm to shuttle data from
the Model side to the View side.  In one case, it's used to swizzle data out
of the model and show it in the JSP's edit form.  In the other case, it's
used to collect data from the form and send it (through the Action) back to
the model.  Only in the latter case do I care about form validation.  Yet
Struts imposes validation in both directions.  How do I get around this?



Cheers,

David A. Ventimiglia

Wells Fargo Private Client Services

(415) 396-0414 (work)





--
This message is intended only for the personal and confidential use of the designated 
recipient(s) named above.  If you are not the intended recipient of this message you 
are hereby notified that any review, dissemination, distribution or copying of this 
message is strictly prohibited.  This communication is for information purposes only 
and should not be regarded as an offer to sell or as a solicitation of an offer to buy 
any financial product, an official confirmation of any transaction, or as an official 
statement of Lehman Brothers.  Email transmission cannot be guaranteed to be secure or 
error-free.  Therefore, we do not represent that this information is complete or 
accurate and it should not be relied upon as such.  All information is subject to 
change without notice.



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: Form Validation Question

2002-04-05 Thread Ady Das-O'Toole

You can also set validate=false in your mapping, but call the form's validate method 
in your Action, that way you get to decide when to turn validation on. Of course 
there's the additional hit of going to the action every time, in this case.

Ady

-Original Message-
From: Zeltser, Mark [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 05, 2002 3:45 PM
To: 'Struts Users Mailing List'
Subject: RE: Form Validation Question


How about creating 2 mappings where second mapping will have validation
turned off?

Mark.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Friday, April 05, 2002 3:36 PM
To: [EMAIL PROTECTED]
Subject: Form Validation Question


Hello,



I'm using a single Action Mapping for both adding and editing an entity.
The mapping looks like this:



action path=/editAuthorityLevel

type=com.wellsfargo.pcsweb.controller.EditAuthorityLevelAction

name=authorityLevelForm

input=/editAuthorityLevel.jsp

scope=request

  forward name=success path=/editAuthorityLevel.jsp/

/action



The idea is, if we come into ../editAuthorityLevel from a link that says
Add Authority Level, then there'll be no form parameters, the
authorityLevelId consequently will be null, and the EditAuthorityLevelAction
class can do nothing in this case.  If, on the other hand, we come into
../editAuthorityLevel from a form that says Edit Authority Level, then the
form fields (especially authorityLevelId) will not be null.  In this case,
if looks up the appropriate bean and populates the form with the
corresponding values.



This works great until I introduce form validation.  If I implement the
form's validate() method so that it returns a non-empty ActionErrors if
required fields are not filled in, then this happens when coming in from the
Add Authority Level link.  When this happens, Struts skips the
EditAuthorityLevelAction class and tries to go directly to
../editAuthorityLevel.jsp.  This is bad because EditAuthorityLevelAction
populates several page beans that the JSP needs.



The central problem is this:  I'm using the ActionForm to shuttle data from
the Model side to the View side.  In one case, it's used to swizzle data out
of the model and show it in the JSP's edit form.  In the other case, it's
used to collect data from the form and send it (through the Action) back to
the model.  Only in the latter case do I care about form validation.  Yet
Struts imposes validation in both directions.  How do I get around this?



Cheers,

David A. Ventimiglia

Wells Fargo Private Client Services

(415) 396-0414 (work)





--
This message is intended only for the personal and confidential use of the designated 
recipient(s) named above.  If you are not the intended recipient of this message you 
are hereby notified that any review, dissemination, distribution or copying of this 
message is strictly prohibited.  This communication is for information purposes only 
and should not be regarded as an offer to sell or as a solicitation of an offer to buy 
any financial product, an official confirmation of any transaction, or as an official 
statement of Lehman Brothers.  Email transmission cannot be guaranteed to be secure or 
error-free.  Therefore, we do not represent that this information is complete or 
accurate and it should not be relied upon as such.  All information is subject to 
change without notice.



--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]


--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: Form Validation Question

2002-04-05 Thread David . A . Ventimiglia

I would, except I don't know how to turn validation off in the Action
Mapping in struts-config.xml.  As long as I use the same ActionForm for both
show me a blank form so I can add and show me a populated form so I can
edit, and that ActionForm implements validate(), then there's validation.
Is there a way to turn this off?

The alternative, which may not be so bad, is for the validate() method to
inspect the form fields and to decide to actually check for empty fields if
we're in show me a populated form so I can edit mode.  Actually, that's
not bad at all because it fits with the overall semantics.

In other words, I was originally thinking the validation rule is:

The Authentication Level's 'Name' field may not be empty.

But upon further reflection, it's clear the validation rule is really:

The Authentication Level's 'Name' field may not be empty, UNLESS this is
the special case of the 'Insert Row'.

Where 'Insert Row' is defined to be a bean whose primary key (eg.,
authenticationLevelId) is null.

Cheers,
David

-Original Message-
From: Zeltser, Mark [mailto:[EMAIL PROTECTED]] 
Sent: Friday, April 05, 2002 12:45 PM
To: 'Struts Users Mailing List'
Subject: RE: Form Validation Question

How about creating 2 mappings where second mapping will have validation
turned off?

Mark.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Friday, April 05, 2002 3:36 PM
To: [EMAIL PROTECTED]
Subject: Form Validation Question


Hello,



I'm using a single Action Mapping for both adding and editing an entity.
The mapping looks like this:



action path=/editAuthorityLevel

type=com.wellsfargo.pcsweb.controller.EditAuthorityLevelAction

name=authorityLevelForm

input=/editAuthorityLevel.jsp

scope=request

  forward name=success path=/editAuthorityLevel.jsp/

/action



The idea is, if we come into ../editAuthorityLevel from a link that says
Add Authority Level, then there'll be no form parameters, the
authorityLevelId consequently will be null, and the EditAuthorityLevelAction
class can do nothing in this case.  If, on the other hand, we come into
../editAuthorityLevel from a form that says Edit Authority Level, then the
form fields (especially authorityLevelId) will not be null.  In this case,
if looks up the appropriate bean and populates the form with the
corresponding values.



This works great until I introduce form validation.  If I implement the
form's validate() method so that it returns a non-empty ActionErrors if
required fields are not filled in, then this happens when coming in from the
Add Authority Level link.  When this happens, Struts skips the
EditAuthorityLevelAction class and tries to go directly to
../editAuthorityLevel.jsp.  This is bad because EditAuthorityLevelAction
populates several page beans that the JSP needs.



The central problem is this:  I'm using the ActionForm to shuttle data from
the Model side to the View side.  In one case, it's used to swizzle data out
of the model and show it in the JSP's edit form.  In the other case, it's
used to collect data from the form and send it (through the Action) back to
the model.  Only in the latter case do I care about form validation.  Yet
Struts imposes validation in both directions.  How do I get around this?



Cheers,

David A. Ventimiglia

Wells Fargo Private Client Services

(415) 396-0414 (work)






--
This message is intended only for the personal and confidential use of the
designated recipient(s) named above.  If you are not the intended recipient
of this message you are hereby notified that any review, dissemination,
distribution or copying of this message is strictly prohibited.  This
communication is for information purposes only and should not be regarded as
an offer to sell or as a solicitation of an offer to buy any financial
product, an official confirmation of any transaction, or as an official
statement of Lehman Brothers.  Email transmission cannot be guaranteed to be
secure or error-free.  Therefore, we do not represent that this information
is complete or accurate and it should not be relied upon as such.  All
information is subject to change without notice.



--
To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
For additional commands, e-mail:
mailto:[EMAIL PROTECTED]

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




RE: Form Validation Question

2002-04-05 Thread Zeltser, Mark

You can turn off validation by specifying validate=false in your action: 

!-- invoke action with validation --
actionpath=/path1
   type=com...
  scope=...
   name=...
  validate=true
  input=
 forward name=success  path=/processingPath/
   /action

!-- invoke the same action but no validation --
actionpath=/path1NV
   type=com...
  scope=...
   name=...
  validate=false
  input=
 forward name=success  path=/processingPath/
   /action

Mark


-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Friday, April 05, 2002 3:57 PM
To: [EMAIL PROTECTED]
Subject: RE: Form Validation Question


I would, except I don't know how to turn validation off in the Action
Mapping in struts-config.xml.  As long as I use the same ActionForm for both
show me a blank form so I can add and show me a populated form so I can
edit, and that ActionForm implements validate(), then there's validation.
Is there a way to turn this off?

The alternative, which may not be so bad, is for the validate() method to
inspect the form fields and to decide to actually check for empty fields if
we're in show me a populated form so I can edit mode.  Actually, that's
not bad at all because it fits with the overall semantics.

In other words, I was originally thinking the validation rule is:

The Authentication Level's 'Name' field may not be empty.

But upon further reflection, it's clear the validation rule is really:

The Authentication Level's 'Name' field may not be empty, UNLESS this is
the special case of the 'Insert Row'.

Where 'Insert Row' is defined to be a bean whose primary key (eg.,
authenticationLevelId) is null.

Cheers,
David

-Original Message-
From: Zeltser, Mark [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 05, 2002 12:45 PM
To: 'Struts Users Mailing List'
Subject: RE: Form Validation Question

How about creating 2 mappings where second mapping will have validation
turned off?

Mark.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Friday, April 05, 2002 3:36 PM
To: [EMAIL PROTECTED]
Subject: Form Validation Question


Hello,



I'm using a single Action Mapping for both adding and editing an entity.
The mapping looks like this:



action path=/editAuthorityLevel

type=com.wellsfargo.pcsweb.controller.EditAuthorityLevelAction

name=authorityLevelForm

input=/editAuthorityLevel.jsp

scope=request

  forward name=success path=/editAuthorityLevel.jsp/

/action



The idea is, if we come into ../editAuthorityLevel from a link that says
Add Authority Level, then there'll be no form parameters, the
authorityLevelId consequently will be null, and the EditAuthorityLevelAction
class can do nothing in this case.  If, on the other hand, we come into
../editAuthorityLevel from a form that says Edit Authority Level, then the
form fields (especially authorityLevelId) will not be null.  In this case,
if looks up the appropriate bean and populates the form with the
corresponding values.



This works great until I introduce form validation.  If I implement the
form's validate() method so that it returns a non-empty ActionErrors if
required fields are not filled in, then this happens when coming in from the
Add Authority Level link.  When this happens, Struts skips the
EditAuthorityLevelAction class and tries to go directly to
../editAuthorityLevel.jsp.  This is bad because EditAuthorityLevelAction
populates several page beans that the JSP needs.



The central problem is this:  I'm using the ActionForm to shuttle data from
the Model side to the View side.  In one case, it's used to swizzle data out
of the model and show it in the JSP's edit form.  In the other case, it's
used to collect data from the form and send it (through the Action) back to
the model.  Only in the latter case do I care about form validation.  Yet
Struts imposes validation in both directions.  How do I get around this?



Cheers,

David A. Ventimiglia

Wells Fargo Private Client Services

(415) 396-0414 (work)






--
This message is intended only for the personal and confidential use of the
designated recipient(s) named above.  If you are not the intended recipient
of this message you are hereby notified that any review, dissemination,
distribution or copying of this message is strictly prohibited.  This
communication is for information purposes only and should not be regarded as
an offer to sell or as a solicitation of an offer to buy any financial
product, an official confirmation of any transaction, or as an official
statement of Lehman Brothers.  Email transmission cannot be guaranteed to be
secure or error-free.  Therefore, we do not represent that this information
is complete

RE: Form Validation Question

2002-04-05 Thread David . A . Ventimiglia

Thanks!

-Original Message-
From: Ady Das-O'Toole [mailto:[EMAIL PROTECTED]] 
Sent: Friday, April 05, 2002 12:51 PM
To: Struts Users Mailing List
Subject: RE: Form Validation Question

You can also set validate=false in your mapping, but call the form's
validate method in your Action, that way you get to decide when to turn
validation on. Of course there's the additional hit of going to the action
every time, in this case.

Ady

-Original Message-
From: Zeltser, Mark [mailto:[EMAIL PROTECTED]]
Sent: Friday, April 05, 2002 3:45 PM
To: 'Struts Users Mailing List'
Subject: RE: Form Validation Question


How about creating 2 mappings where second mapping will have validation
turned off?

Mark.

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Friday, April 05, 2002 3:36 PM
To: [EMAIL PROTECTED]
Subject: Form Validation Question


Hello,



I'm using a single Action Mapping for both adding and editing an entity.
The mapping looks like this:



action path=/editAuthorityLevel

type=com.wellsfargo.pcsweb.controller.EditAuthorityLevelAction

name=authorityLevelForm

input=/editAuthorityLevel.jsp

scope=request

  forward name=success path=/editAuthorityLevel.jsp/

/action



The idea is, if we come into ../editAuthorityLevel from a link that says
Add Authority Level, then there'll be no form parameters, the
authorityLevelId consequently will be null, and the EditAuthorityLevelAction
class can do nothing in this case.  If, on the other hand, we come into
../editAuthorityLevel from a form that says Edit Authority Level, then the
form fields (especially authorityLevelId) will not be null.  In this case,
if looks up the appropriate bean and populates the form with the
corresponding values.



This works great until I introduce form validation.  If I implement the
form's validate() method so that it returns a non-empty ActionErrors if
required fields are not filled in, then this happens when coming in from the
Add Authority Level link.  When this happens, Struts skips the
EditAuthorityLevelAction class and tries to go directly to
../editAuthorityLevel.jsp.  This is bad because EditAuthorityLevelAction
populates several page beans that the JSP needs.



The central problem is this:  I'm using the ActionForm to shuttle data from
the Model side to the View side.  In one case, it's used to swizzle data out
of the model and show it in the JSP's edit form.  In the other case, it's
used to collect data from the form and send it (through the Action) back to
the model.  Only in the latter case do I care about form validation.  Yet
Struts imposes validation in both directions.  How do I get around this?



Cheers,

David A. Ventimiglia

Wells Fargo Private Client Services

(415) 396-0414 (work)






--
This message is intended only for the personal and confidential use of the
designated recipient(s) named above.  If you are not the intended recipient
of this message you are hereby notified that any review, dissemination,
distribution or copying of this message is strictly prohibited.  This
communication is for information purposes only and should not be regarded as
an offer to sell or as a solicitation of an offer to buy any financial
product, an official confirmation of any transaction, or as an official
statement of Lehman Brothers.  Email transmission cannot be guaranteed to be
secure or error-free.  Therefore, we do not represent that this information
is complete or accurate and it should not be relied upon as such.  All
information is subject to change without notice.



--
To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
For additional commands, e-mail:
mailto:[EMAIL PROTECTED]


--
To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
For additional commands, e-mail:
mailto:[EMAIL PROTECTED]

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: Validation Question?

2002-01-20 Thread David Winterfeldt

The issue is associating error messages, error message
arguments, and validation information like masks,
dates, etc. for different locales.  Also it would
start getting messy having regexp expression and other
things all directly associtaed with the custom jsp
tags.  Also, to store this information in the jsp page
would start cluttering your view with business logic.

There are a few other validation frameworks that
people have written.  They are posted here if you want
to look at them.

http://jakarta.apache.org/struts/userGuide/resources.html

David

--- Matt Koidin [EMAIL PROTECTED] wrote:
 I'm looking for a straightforward way to handle
 basic form validation. I
 downloaded the Struts Validator from Dave
 Winterfeldt and I really like
 the capabilities, but I'm wondering if anyone has a
 solution that is
 more generic? My big problem with the Validator
 design is the need for
 another xml file that I need to fill out for every
 form I want to
 validate. 
 
 Maybe I am missing something, but is there a way a)
 either using this
 tool, or b) with another validator - that I can
 validate a field at the
 tag level.
 
 For example, I'd like to write:
 
 html:text property=firstName size=30
 maxlength=30
 validate=required/
 
 -or-
 
 html:text property=email size=30 maxlength=30
 validate=required,
 email/
 
 and not have to deal with a FORM-SPECIFIC xml file.
 Obviously, I'd have
 to detail what it meant to be required and what a
 valid email is.
 That seems to be done with the validator-rules.xml
 file. Why can't I
 access that directly?
 
 I might just go build this myself, but I was curious
 if it has already
 been done, or if I am missing something with the
 Struts Validator.
 
 Thanks,
 Matt
 
 --
 To unsubscribe, e-mail:  
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]
 


__
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Struts Validation question

2001-10-31 Thread Sandeep Takhar

when using the struts validator, what happens if you
define a validation for a field and the field does not
exist?  Does it skip the field (this is what I would
like).

- Sandeep

__
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Re: Struts Validation question

2001-10-31 Thread David Winterfeldt

It doesn't skip it just like if you define an
html:text on your JSP and the field doesn't exist it
causes an exception.  I don't think it stops
validating though since all exceptions are caught.

David

--- Sandeep Takhar [EMAIL PROTECTED] wrote:
 when using the struts validator, what happens if you
 define a validation for a field and the field does
 not
 exist?  Does it skip the field (this is what I would
 like).
 
 - Sandeep
 
 __
 Do You Yahoo!?
 Make a great connection at Yahoo! Personals.
 http://personals.yahoo.com
 
 --
 To unsubscribe, e-mail:  
 mailto:[EMAIL PROTECTED]
 For additional commands, e-mail:
 mailto:[EMAIL PROTECTED]
 


__
Do You Yahoo!?
Make a great connection at Yahoo! Personals.
http://personals.yahoo.com

--
To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
For additional commands, e-mail: mailto:[EMAIL PROTECTED]




Form Validation Question

2001-10-01 Thread DEHAMER,BRIAN (HP-MountainView,ex1)

If I want to use form validation with my ActionForm bean, what should I
specify for the input attribute of my action defition?  Should it
reference the JSP page that renders the form (e.g. /login.jsp) or should
it reference the action responsible for presenting the form (e.g.
/login.do)?

All of the examples that I've seen show the input attribute pointing to
the JSP page; however, when I do this I notice that my page doesn't render
properly because it is dependent on some information that is set in the
associated action class.  If I put an action path in the input attribute I
think I can solve my problem, but I'm not sure if this is an appropriate use
of the architecture.  

Thanks for the help.

Brian DeHamer
Hewlett-Packard Co.
[EMAIL PROTECTED]



Re: Form Validation Question

2001-10-01 Thread David Winterfeldt

You can put in any url in the input attribute.  So
there isn't a problem having input go through an
action.

David

--- DEHAMER,BRIAN (HP-MountainView,ex1)
[EMAIL PROTECTED] wrote:
 If I want to use form validation with my ActionForm
 bean, what should I
 specify for the input attribute of my action
 defition?  Should it
 reference the JSP page that renders the form (e.g.
 /login.jsp) or should
 it reference the action responsible for presenting
 the form (e.g.
 /login.do)?
 
 All of the examples that I've seen show the input
 attribute pointing to
 the JSP page; however, when I do this I notice that
 my page doesn't render
 properly because it is dependent on some information
 that is set in the
 associated action class.  If I put an action path in
 the input attribute I
 think I can solve my problem, but I'm not sure if
 this is an appropriate use
 of the architecture.  
 
 Thanks for the help.
 
 Brian DeHamer
 Hewlett-Packard Co.
 [EMAIL PROTECTED]


__
Do You Yahoo!?
Listen to your Yahoo! Mail messages from any phone.
http://phone.yahoo.com