Validator

2006-08-11 Thread Jean-Marie Pitre

Hi,

I would like to change the key name of errors.header, errors.footer,
errors.suffix ... but I don't see where they are called.

Have you got any idea ?

Thanks,

Jean-Marie.

---
Email Disclaimer
http://www.cofidis.be/emaildisclaimer.php


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



To validate password confirmpassword fields

2006-08-11 Thread Rauf Khan

Hi,

  I trying to validate the fields using Validator Framework at client side,
Iam not able to validate the password  confirmpassword fields inorder to
show an alert msg if password  confirmpassword fields are not same. Can i
know how to handle this case.

html:password property=password/
html:password property=confirmpassword/

Thanks in advance.

Regards
Khan


Re: To validate password confirmpassword fields

2006-08-11 Thread Li

seems you are using your own authentication module, one thing you can
do it using javascript, or you can use form authentication, and define
login page and login error page, so if your userid or password is not
valid, login error page will showed up.

Wish it helps

Regards

On 8/11/06, Rauf Khan [EMAIL PROTECTED] wrote:

Hi,

   I trying to validate the fields using Validator Framework at client side,
Iam not able to validate the password  confirmpassword fields inorder to
show an alert msg if password  confirmpassword fields are not same. Can i
know how to handle this case.

html:password property=password/
html:password property=confirmpassword/

Thanks in advance.

Regards
Khan





--
When we invent time, we invent death.

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



Re: To validate password confirmpassword fields

2006-08-11 Thread Bart Busschots
This is a very common thing to do and should be done with the validWhen 
validation as described on the Validotor page of the Struts User Guide 
(http://struts.apache.org/1.x/userGuide/building_view.html#validator).


Below is the validation I use on a change password form as an example:

form name=changePasswordForm
  field property=passwordCurrent depends=required
   arg0 key=login.changePassword.currentPassword.label/
  /field
  field property=passwordNew depends=required, minlength
   arg0 key=login.changePassword.newPassword.label/
   arg1 name=minlength key=${var:minlength} resource=false/
   varvar-nameminlength/var-namevar-value6/var-value/var
  /field
  field property=passwordNewVerify depends=validwhen
   arg0 key=login.changePassword.newPwsNotEqual/
   var
var-nametest/var-name
var-value(*this* == passwordNew)/var-value
   /var
  /field
 /form

HTH,

Bart.

Rauf Khan wrote:

Hi,

  I trying to validate the fields using Validator Framework at client 
side,

Iam not able to validate the password  confirmpassword fields inorder to
show an alert msg if password  confirmpassword fields are not same. 
Can i

know how to handle this case.

html:password property=password/
html:password property=confirmpassword/

Thanks in advance.

Regards
Khan




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



RE: Validator

2006-08-11 Thread Kalra, Ashwani

They are hard coded in html:errors tag... , you cannot change them. If
these keys are not present in resource bundle, it will be simply
ignored.

/Ashwani

-Original Message-
From: Jean-Marie Pitre [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 11, 2006 2:58 PM
To: Struts Users Mailing List
Subject: Validator


Hi,

I would like to change the key name of errors.header, errors.footer,
errors.suffix ... but I don't see where they are called.

Have you got any idea ?

Thanks,

Jean-Marie.

---
Email Disclaimer
http://www.cofidis.be/emaildisclaimer.php


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


This message contains information that may be privileged or confidential and is 
the property of the Capgemini Group. It is intended only for the person to whom 
it is addressed. If you are not the intended recipient,  you are not authorized 
to read, print, retain, copy, disseminate,  distribute, or use this message or 
any part thereof. If you receive this  message in error, please notify the 
sender immediately and delete all  copies of this message.


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



Re: To validate password confirmpassword fields

2006-08-11 Thread Rauf Khan

Hi,

   Iam doing validation for registration page where password 
confirmpassword fields should have the same password if not an alert msg
through javascript(validator framework) should be shown. I have validated
rest of the fields through validator framework only.

Khan


On 8/11/06, Li [EMAIL PROTECTED] wrote:


seems you are using your own authentication module, one thing you can
do it using javascript, or you can use form authentication, and define
login page and login error page, so if your userid or password is not
valid, login error page will showed up.

Wish it helps

Regards

On 8/11/06, Rauf Khan [EMAIL PROTECTED] wrote:
 Hi,

I trying to validate the fields using Validator Framework at client
side,
 Iam not able to validate the password  confirmpassword fields inorder
to
 show an alert msg if password  confirmpassword fields are not same. Can
i
 know how to handle this case.

 html:password property=password/
 html:password property=confirmpassword/

 Thanks in advance.

 Regards
 Khan




--
When we invent time, we invent death.

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




RE: To validate password confirmpassword fields

2006-08-11 Thread Kalra, Ashwani

In struts 1.2 you can easily use validwhen..   as mentioned in other
post.

/Ashwani

-Original Message-
From: Rauf Khan [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 11, 2006 3:17 PM
To: Struts Users Mailing List
Subject: Re: To validate password  confirmpassword fields

Hi,

Iam doing validation for registration page where password 
confirmpassword fields should have the same password if not an alert msg
through javascript(validator framework) should be shown. I have
validated rest of the fields through validator framework only.

Khan


On 8/11/06, Li [EMAIL PROTECTED] wrote:

 seems you are using your own authentication module, one thing you can 
 do it using javascript, or you can use form authentication, and define

 login page and login error page, so if your userid or password is not 
 valid, login error page will showed up.

 Wish it helps

 Regards

 On 8/11/06, Rauf Khan [EMAIL PROTECTED] wrote:
  Hi,
 
 I trying to validate the fields using Validator Framework at 
  client
 side,
  Iam not able to validate the password  confirmpassword fields 
  inorder
 to
  show an alert msg if password  confirmpassword fields are not same.

  Can
 i
  know how to handle this case.
 
  html:password property=password/ html:password 
  property=confirmpassword/
 
  Thanks in advance.
 
  Regards
  Khan
 
 


 --
 When we invent time, we invent death.

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



This message contains information that may be privileged or confidential and is 
the property of the Capgemini Group. It is intended only for the person to whom 
it is addressed. If you are not the intended recipient,  you are not authorized 
to read, print, retain, copy, disseminate,  distribute, or use this message or 
any part thereof. If you receive this  message in error, please notify the 
sender immediately and delete all  copies of this message.


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



Re: To validate password confirmpassword fields

2006-08-11 Thread Li

sorry, my mistakes,

er you can create validate method and compare them there. then in your
struts-config.xml, make sure the action that control the form
submission has input page. in order to avoid validation check at first
time. you can define an action that only forward to your password
input page. the the action that handles the form submission will be
different from this actiona which is bundle with your action form.

:P

On 8/11/06, Rauf Khan [EMAIL PROTECTED] wrote:

Hi,

Iam doing validation for registration page where password 
confirmpassword fields should have the same password if not an alert msg
through javascript(validator framework) should be shown. I have validated
rest of the fields through validator framework only.

Khan


On 8/11/06, Li [EMAIL PROTECTED] wrote:

 seems you are using your own authentication module, one thing you can
 do it using javascript, or you can use form authentication, and define
 login page and login error page, so if your userid or password is not
 valid, login error page will showed up.

 Wish it helps

 Regards

 On 8/11/06, Rauf Khan [EMAIL PROTECTED] wrote:
  Hi,
 
 I trying to validate the fields using Validator Framework at client
 side,
  Iam not able to validate the password  confirmpassword fields inorder
 to
  show an alert msg if password  confirmpassword fields are not same. Can
 i
  know how to handle this case.
 
  html:password property=password/
  html:password property=confirmpassword/
 
  Thanks in advance.
 
  Regards
  Khan
 
 


 --
 When we invent time, we invent death.

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







--
When we invent time, we invent death.

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



RE: To validate password confirmpassword fields

2006-08-11 Thread Kalra, Ashwani

He wants to use javascript validation generated from struts
 

-Original Message-
From: Li [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 11, 2006 3:23 PM
To: Struts Users Mailing List
Subject: Re: To validate password  confirmpassword fields

sorry, my mistakes,

er you can create validate method and compare them there. then in your
struts-config.xml, make sure the action that control the form submission
has input page. in order to avoid validation check at first time. you
can define an action that only forward to your password input page. the
the action that handles the form submission will be different from this
actiona which is bundle with your action form.

:P

On 8/11/06, Rauf Khan [EMAIL PROTECTED] wrote:
 Hi,

 Iam doing validation for registration page where password  
 confirmpassword fields should have the same password if not an alert 
 msg through javascript(validator framework) should be shown. I have 
 validated rest of the fields through validator framework only.

 Khan


 On 8/11/06, Li [EMAIL PROTECTED] wrote:
 
  seems you are using your own authentication module, one thing you 
  can do it using javascript, or you can use form authentication, and 
  define login page and login error page, so if your userid or 
  password is not valid, login error page will showed up.
 
  Wish it helps
 
  Regards
 
  On 8/11/06, Rauf Khan [EMAIL PROTECTED] wrote:
   Hi,
  
  I trying to validate the fields using Validator Framework at 
   client
  side,
   Iam not able to validate the password  confirmpassword fields 
   inorder
  to
   show an alert msg if password  confirmpassword fields are not 
   same. Can
  i
   know how to handle this case.
  
   html:password property=password/ html:password 
   property=confirmpassword/
  
   Thanks in advance.
  
   Regards
   Khan
  
  
 
 
  --
  When we invent time, we invent death.
 
  
  - To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
 
 




--
When we invent time, we invent death.

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


This message contains information that may be privileged or confidential and is 
the property of the Capgemini Group. It is intended only for the person to whom 
it is addressed. If you are not the intended recipient,  you are not authorized 
to read, print, retain, copy, disseminate,  distribute, or use this message or 
any part thereof. If you receive this  message in error, please notify the 
sender immediately and delete all  copies of this message.


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



bean-el:write use case

2006-08-11 Thread karel . vervaeke
The documentation says you don't need bean-el:write because of c:out,
but I think I have a valid use case for bean-el:write (Assuming
you want to avoid using % %).

Example:
I have a list of objects named results
each result contains a hashmap called 'translations'.

(1) render the results in a particular language (e.g. german)

c:forEach items=results var=result
c:out value=${result.translations.de}/
/c:forEach

(2) render the results in ${language} (= language in the pageContext)?

c:out value=${result.translations(${language})}/ is of course invalid, but
I think we could do it with bean-el:write

(...)
bean-el:write name=result property=translations(${language})/

What do you think?  Is there a way to do this without (the non-existant) 
bean-el:write that I overlooked?

Karel

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



problem of the character in validation xml

2006-08-11 Thread Romu

hey

I  list all the characaters accepted in a html:text  balise .

the current list which works is :

constant
   constant-nameenseigneCommerciale/constant-name
   constant-value^[A-Z0-9,/';%?!.()\-\s]*$/constant-value
/constant

the problem is when i want to add the  character .

it says the entity name should be followed by the enity reference .

think it's xml rules .
anyone has tried it yet , i mean to define entity in the validation.xmlfile ?

thanks .


Re: problem of the character in validation xml

2006-08-11 Thread Srinivas_Biragoni




Use amp instead of  in validation.xml file.




   
 Romu  
 [EMAIL PROTECTED] 
   To 
   Struts Users Mailing List 
 08/11/2006 03:53  user@struts.apache.org
 PM cc 
   
   Subject 
 Please respond to problem of the  character in 
   Struts Users   validation xml  
   Mailing List   
 [EMAIL PROTECTED] 
  he.org  
   
   
   




hey

I  list all the characaters accepted in a html:text  balise .

the current list which works is :

constant
constant-nameenseigneCommerciale/constant-name
constant-value^[A-Z0-9,/';%?!.()\-\s]*$/constant-value
/constant

the problem is when i want to add the  character .

it says the entity name should be followed by the enity reference .

 think it's xml rules .
 anyone has tried it yet , i mean to define entity in the
 validation.xmlfile ?

thanks .



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



about javascript

2006-08-11 Thread Gomathi
hai
i am working in struts1.1
i have threee fields in html:text
how to check these empty fields when submitting the submit button using java 
script
its very uergent
with kindly regards
gomes

RE: about javascript

2006-08-11 Thread Krishna, Hari
r u going to check for mandatory fields.

-Original Message-
From: Gomathi [mailto:[EMAIL PROTECTED]
Sent: Friday, August 11, 2006 4:45 PM
To: Struts Users Mailing List
Subject: about javascript


hai
i am working in struts1.1
i have threee fields in html:text
how to check these empty fields when submitting the submit button using java 
script
its very uergent
with kindly regards
gomes
Notice:  All email and instant messages (including attachments) sent to
or from Franklin Templeton Investments (FTI) personnel may be retained,
monitored and/or reviewed by FTI and its agents, or authorized
law enforcement personnel, without further notice or consent.

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



Re: about javascript

2006-08-11 Thread Gary Feidt
Add an onclick=validateForm(); return false; 

Then create a javascript function:

script language=JavaScript
function validateForm() {
var errorString = The following field(s) may not be left
blank:\r\n\r\n;
var strField = ;
if (document.frmTest.txtFirstName.value.length == 0) {
strField +=  - First Name\n;
}
if (document.frmTest.txtLastName.value.length == 0) {
strField +=  - Last Name\n;
}
if (document.frmTest.txtPhone.value.length == 0) {
strField +=  - Phone Number\n;
}
if (strField.length  0) {
alert(errorString + strField);
}
} else {
document.frmTest.submit();
}
/script

Gary

 [EMAIL PROTECTED] 8/11/2006 6:15:19 AM 
hai
i am working in struts1.1
i have threee fields in html:text
how to check these empty fields when submitting the submit button using
java script
its very uergent
with kindly regards
gomes
___

Confidentiality Statement:
This email/fax, including attachments, may include confidential
and/or proprietary information and may be used only by the
person or entity to which it is addressed. If the reader of 
this email/fax is not the intended recipient or his or her 
agent, the reader is hereby notified that any dissemination, 
distribution or copying of this email/fax is prohibited. If you 
have received this email/fax in error, please notify the sender 
by replying to this message and deleting this email or 
destroying this facsimile immediately.


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



Re: Struts 2 snapshot build work on JDK 1.4.2?

2006-08-11 Thread James Mitchell

On Aug 10, 2006, at 8:42 PM, Ted Husted wrote:




Do we use these from
the command line or with a Maven plugin or should use antrun maven
plugin to do it?


I just filtered the JARs from the command line. I suppose the Maven
plugin would work too. I think it might be best to keep this a
separate JAR distribution and make the cannonical target Java 5.




Ok, sounds good.




In any case, what is the targeted output for all of this?


I uploaded the test distribution from August 2 to my home directory.

* http://people.apache.org/~husted/struts2-core-j4-2.0.0- 
SNAPSHOT-20060801.zip




What about the apps?  Are those artifacts?  Or are they just intended  
to be run in place?

Seems like, at one point, the nightly build used to create sample apps.

Here's what I run for the nightlies:
 $mvn -Pextras install

Has the profile name changed?






http://people.apache.org/builds/struts/nightlies/
/2.0.x/struts2-j14-api-2.0.0-SNAPSHOT-20060804.jar
/2.0.x/struts2-j15-api-2.0.0-SNAPSHOT-20060804.jar


I'd keep the J4 as a special distribution and leave J5 as the
default. So I'd say keep what we got as it is, and just add the ZIP
with a translated J4 JARs.



Ok, I'll figure something out.  Probably add a 1.4-compatible/  
directory inside of the 2.0.x directory and drop nightlies of XWork- 
j4 and s2-j4 in there.  Same schedule.


Thanks

--
James Mitchell
678.910.8017




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



Re: about javascript

2006-08-11 Thread Gomathi

no,
i have three text fields in my one jsp
i want to check these  fields if it is empty using java script
client side validation
html:text property=title /

html:file property=theFile /

html:text property=url /

html:submit value=Upload Logo onclick=button2()/html:submit

in button2()

{

how to check this empty fields



}




- Original Message - 
From: Krishna, Hari [EMAIL PROTECTED]

To: Struts Users Mailing List user@struts.apache.org
Sent: Friday, August 11, 2006 5:10 PM
Subject: RE: about javascript



r u going to check for mandatory fields.

-Original Message-
From: Gomathi [mailto:[EMAIL PROTECTED]
Sent: Friday, August 11, 2006 4:45 PM
To: Struts Users Mailing List
Subject: about javascript


hai
i am working in struts1.1
i have threee fields in html:text
how to check these empty fields when submitting the submit button using 
java script

its very uergent
with kindly regards
gomes
Notice:  All email and instant messages (including attachments) sent to
or from Franklin Templeton Investments (FTI) personnel may be retained,
monitored and/or reviewed by FTI and its agents, or authorized
law enforcement personnel, without further notice or consent.

-
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]



struts workflow ext. Memory problems

2006-08-11 Thread Matthew Shaw

Hi,

I am wondering if anyone has come across with memory leak problems with the 
workflow extension?

I am running a weblogic8.1 app server on a HP-UX machine.

I am finding that virtual memory is running out and the JVM is crashing. I only 
have one app running in my weblogic instance.

I am fairly certain that it is not the application.

After running some correlations between extra memory requests from the JVM to 
the operating system and particular pages that are being hit, they are the ones 
which invoke the start of a workflow and hence the workflow extension. I am 
wondering if perhaps the struts workflow extension is using some third party 
libraries that are perhaps incompatible with the jdk or something?

I am at a loss so any help would be greatly appreciated.

Cheers,
Matt.

Matt Shaw
Snr Applications Developer
Service Performance  Management Unit
Phone: 3247 8666. ext. 94666



This correspondence is for the named persons only.
It may contain confidential or privileged information or both.
No confidentiality or privilege is waived or lost by any mis transmission.
If you receive this correspondence in error please delete it from your system 
immediately and notify the sender.
You must not disclose, copy or relay on any part of this correspondence, if you 
are not the intended recipient.
Any opinions expressed in this message are those of the individual sender 
except where the sender expressly,
and with the authority, states them to be the opinions of the Department of 
Emergency Services, Queensland.

Re: bean-el:write use case

2006-08-11 Thread vijay venkataraman

See response inline.

[EMAIL PROTECTED] wrote:


The documentation says you don't need bean-el:write because of c:out,
but I think I have a valid use case for bean-el:write (Assuming
you want to avoid using % %).

Example:
I have a list of objects named results
each result contains a hashmap called 'translations'.

(1) render the results in a particular language (e.g. german)

c:forEach items=results var=result
   c:out value=${result.translations.de}/
/c:forEach

(2) render the results in ${language} (= language in the pageContext)?

c:out value=${result.translations(${language})}/ is of course invalid, but
I think we could do it with bean-el:write

(...)
bean-el:write name=result property=translations(${language})/
 


pageContext - Is implicit variable in jsp.

c:out value=${result.translations[pageContext.language]}/



What do you think?  Is there a way to do this without (the non-existant) 
bean-el:write that I overlooked?

Karel

 


Thanks,
Vijay Venkataraman

--DISCLAIMER--
This message is for the named person's use only. It may contain 
confidential, proprietary or legally privileged information. No
confidentiality or privilege is waived or lost by any mistransmission. 

If you receive this message in error, please immediately delete it and 
all copies of it from your system, destroy any hard copies of it and 
notify the sender. You must not, directly or indirectly, use, disclose, 
distribute, print, or copy any part of this message if you are not the 
intended recipient. 

Lisle Technology Partners Pvt. Ltd. and any of its subsidiaries each 
reserve the right to monitor all e-mail communications through its 
networks. 

Any views expressed in this message are those of the 
individual sender, except where the message states otherwise and the 
sender is authorized to state them to be the views of any such entity.


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



RE: about javascript

2006-08-11 Thread Krishna, Hari
use html:javascript which is a gift from html tld and u will get javascript 
on the fly
Googleup for samples

-Original Message-
From: Gomathi [mailto:[EMAIL PROTECTED]
Sent: Friday, August 11, 2006 5:37 PM
To: Struts Users Mailing List
Subject: Re: about javascript


no,
i have three text fields in my one jsp
i want to check these  fields if it is empty using java script
client side validation
html:text property=title /

html:file property=theFile /

html:text property=url /

html:submit value=Upload Logo onclick=button2()/html:submit

in button2()

{

how to check this empty fields



}




- Original Message - 
From: Krishna, Hari [EMAIL PROTECTED]
To: Struts Users Mailing List user@struts.apache.org
Sent: Friday, August 11, 2006 5:10 PM
Subject: RE: about javascript


r u going to check for mandatory fields.

 -Original Message-
 From: Gomathi [mailto:[EMAIL PROTECTED]
 Sent: Friday, August 11, 2006 4:45 PM
 To: Struts Users Mailing List
 Subject: about javascript


 hai
 i am working in struts1.1
 i have threee fields in html:text
 how to check these empty fields when submitting the submit button using 
 java script
 its very uergent
 with kindly regards
 gomes
 Notice:  All email and instant messages (including attachments) sent to
 or from Franklin Templeton Investments (FTI) personnel may be retained,
 monitored and/or reviewed by FTI and its agents, or authorized
 law enforcement personnel, without further notice or consent.

 -
 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]
Notice:  All email and instant messages (including attachments) sent to
or from Franklin Templeton Investments (FTI) personnel may be retained,
monitored and/or reviewed by FTI and its agents, or authorized
law enforcement personnel, without further notice or consent.

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



RE: about javascript

2006-08-11 Thread kumar.vinodh

 html:file property=theFile /

html:text property=url /

html:submit value=Upload Logo onclick= return
button2();/html:submit

function button2()

{

  var theFile = document.forms[0].elements['theFile'].value;
if( theFile ==   theFile.length = 0)
  {
alert(Please enter the value for the field theFile);
document.forms[0].elements['theFile'].focus();
return false;
  }





Similarly u can write for other two filds

return true;
}

-Original Message-
From: Gomathi [mailto:[EMAIL PROTECTED]
Sent: Friday, August 11, 2006 5:37 PM
To: Struts Users Mailing List
Subject: Re: about javascript

no,
i have three text fields in my one jsp
i want to check these  fields if it is empty using java script client
side validation html:text property=title /

html:file property=theFile /

html:text property=url /

html:submit value=Upload Logo onclick=button2()/html:submit

in button2()

{

how to check this empty fields



}




- Original Message -
From: Krishna, Hari [EMAIL PROTECTED]
To: Struts Users Mailing List user@struts.apache.org
Sent: Friday, August 11, 2006 5:10 PM
Subject: RE: about javascript


r u going to check for mandatory fields.

 -Original Message-
 From: Gomathi [mailto:[EMAIL PROTECTED]
 Sent: Friday, August 11, 2006 4:45 PM
 To: Struts Users Mailing List
 Subject: about javascript


 hai
 i am working in struts1.1
 i have threee fields in html:text
 how to check these empty fields when submitting the submit button
using
 java script
 its very uergent
 with kindly regards
 gomes
 Notice:  All email and instant messages (including attachments) sent
to
 or from Franklin Templeton Investments (FTI) personnel may be
retained,
 monitored and/or reviewed by FTI and its agents, or authorized
 law enforcement personnel, without further notice or consent.

 -
 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]



The information contained in this electronic message and any attachments to 
this message are intended for the exclusive use of the addressee(s) and may 
contain proprietary, confidential or privileged information. If you are not the 
intended recipient, you should not disseminate, distribute or copy this e-mail. 
Please notify the sender immediately and destroy all copies of this message and 
any attachments.

WARNING: Computer viruses can be transmitted via email. The recipient should 
check this email and any attachments for the presence of viruses. The company 
accepts no liability for any damage caused by any virus transmitted by this 
email.

www.wipro.com

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



Re: EventActionDispatcher, specifying event from ActionClass not JSP?

2006-08-11 Thread kalpesh modi
I havent used EventActionDispatcher. I have used EventDispatchAction, and I 
just do a forward as ...

return new ActionForward(/secondAction.do?anyEventName);

I just pass the methodName as the key. I do not use key=value. 

Also I use the button  link parameters as addCustomer, deleteCustomer etc.

Thanks,
-Kalpesh
 
Mississippi John Hurt [EMAIL PROTECTED] wrote: I tried this and it works...

return new ActionForward(/secondAction.do?anyEventName=OneOfParams);

the anyEventName can be anything, while OneOfParams has to be one of the
values in the parameter list in the struts config.
One possible problem is that it seems the dispatcher will simply try to
match each param from first to last with any form parameter so you have to
be careful that no form param values might resemble on of the parameters in
your struts config.

For example what is someone had an input field where they typed in 'delete'
and you had 1 of the parameters ie methods as 'delete', then the dispatcher
could very well match the delete methodparam with the delete value of the
form input field and trigger the delete() method.

Isn't this an issue anybody?

On 8/10/06, Mississippi John Hurt  wrote:

 It doesn't seem to pick up the eventName. It forwards to the 2nd action
 class alright, but somehow the EventActionDispatcher is told which event, is
 it via a form parameter or request attribute?  Which one?


 On 8/10/06, kalpesh modi  wrote:
 
  You can do something like
 
  return new ActionForward(/secondAction.do?eventName);
 
  Thanks,
  -Kalpesh
 
  -
  Yahoo! Messenger with Voice. Make PC-to-Phone Calls to the US (and 30+
  countries) for 2¢/min or less.
 





-
How low will we go? Check out Yahoo! MessengerÂ’s low  PC-to-Phone call rates.

Re: Struts 2 snapshot build work on JDK 1.4.2?

2006-08-11 Thread Ted Husted

On 8/11/06, James Mitchell [EMAIL PROTECTED] wrote:

What about the apps?  Are those artifacts?  Or are they just intended
to be run in place?
Seems like, at one point, the nightly build used to create sample apps.

Here's what I run for the nightlies:
  $mvn -Pextras install

Has the profile name changed?


If we are getting off the topic of the Java4 support, we should open a
thread on [EMAIL PROTECTED]





 http://people.apache.org/builds/struts/nightlies/
 /2.0.x/struts2-j14-api-2.0.0-SNAPSHOT-20060804.jar
 /2.0.x/struts2-j15-api-2.0.0-SNAPSHOT-20060804.jar

 I'd keep the J4 as a special distribution and leave J5 as the
 default. So I'd say keep what we got as it is, and just add the ZIP
 with a translated J4 JARs.


Ok, I'll figure something out.  Probably add a 1.4-compatible/
directory inside of the 2.0.x directory and drop nightlies of XWork-
j4 and s2-j4 in there.  Same schedule.


Hmmm, the bare JARs might not be sufficient.To be useful, the
translated JARs require the Translator JARs too, which means we need
to bundle a license. Ditto for XWork.

If possible, I think the best solution might be to create a ZIP like
the prototype, with the requisite JARS and licenses, and drop it in
with the other nightlies.

If that can't be automated on a nightly basis, then maybe we should
leave it as something we roll with the milestones.

-Ted.

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



Re: problem of the character in validation xml

2006-08-11 Thread Romu

thanks  it worked .

i have low skills in xml :) though it s look like html .



2006/8/11, [EMAIL PROTECTED] [EMAIL PROTECTED]:






Use amp instead of  in validation.xml file.





 Romu
 [EMAIL PROTECTED]
   To
   Struts Users Mailing List
 08/11/2006 03:53  user@struts.apache.org
 PM cc

   Subject
 Please respond to problem of the  character in
   Struts Users   validation xml
   Mailing List
 [EMAIL PROTECTED]
  he.org







hey

I  list all the characaters accepted in a html:text  balise .

the current list which works is :

constant
constant-nameenseigneCommerciale/constant-name
constant-value^[A-Z0-9,/';%?!.()\-\s]*$/constant-value
/constant

the problem is when i want to add the  character .

it says the entity name should be followed by the enity reference .

think it's xml rules .
anyone has tried it yet , i mean to define entity in the
validation.xmlfile ?

thanks .



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




Re: about javascript

2006-08-11 Thread Romu

did u tried to initialise the form , in constructor ?

class myform extends ... {


private String field1 = ;
private String field2 = ;
private String field3 = ;

}


2006/8/11, [EMAIL PROTECTED] [EMAIL PROTECTED]:



html:file property=theFile /

html:text property=url /

html:submit value=Upload Logo onclick= return
button2();/html:submit

function button2()

{

  var theFile = document.forms[0].elements['theFile'].value;
if( theFile ==   theFile.length = 0)
  {
alert(Please enter the value for the field theFile);
document.forms[0].elements['theFile'].focus();
return false;
  }





Similarly u can write for other two filds

return true;
}

-Original Message-
From: Gomathi [mailto:[EMAIL PROTECTED]
Sent: Friday, August 11, 2006 5:37 PM
To: Struts Users Mailing List
Subject: Re: about javascript

no,
i have three text fields in my one jsp
i want to check these  fields if it is empty using java script client
side validation html:text property=title /

html:file property=theFile /

html:text property=url /

html:submit value=Upload Logo onclick=button2()/html:submit

in button2()

{

how to check this empty fields



}




- Original Message -
From: Krishna, Hari [EMAIL PROTECTED]
To: Struts Users Mailing List user@struts.apache.org
Sent: Friday, August 11, 2006 5:10 PM
Subject: RE: about javascript


r u going to check for mandatory fields.

 -Original Message-
 From: Gomathi [mailto:[EMAIL PROTECTED]
 Sent: Friday, August 11, 2006 4:45 PM
 To: Struts Users Mailing List
 Subject: about javascript


 hai
 i am working in struts1.1
 i have threee fields in html:text
 how to check these empty fields when submitting the submit button
using
 java script
 its very uergent
 with kindly regards
 gomes
 Notice:  All email and instant messages (including attachments) sent
to
 or from Franklin Templeton Investments (FTI) personnel may be
retained,
 monitored and/or reviewed by FTI and its agents, or authorized
 law enforcement personnel, without further notice or consent.

 -
 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]



The information contained in this electronic message and any attachments
to this message are intended for the exclusive use of the addressee(s) and
may contain proprietary, confidential or privileged information. If you are
not the intended recipient, you should not disseminate, distribute or copy
this e-mail. Please notify the sender immediately and destroy all copies of
this message and any attachments.

WARNING: Computer viruses can be transmitted via email. The recipient
should check this email and any attachments for the presence of viruses. The
company accepts no liability for any damage caused by any virus transmitted
by this email.

www.wipro.com

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




[using #(anchor) in xxx.do]

2006-08-11 Thread Deva Pitchai

hi all

Is there a possibilty of using a anchor tag like below from the struts action

http://localhost/dir1/dir2/file.jsp#bottom


somthing like ...

http://localhost/dir1/dir2/viewfile.do#bottom

so that i can view the bootom of the page once the action is executed.

I know wht to do in the html side.. but dont dont know how to itegrate
it in the struts.
any help appreciated.

somethign like this... http://www.computerhope.com/issues/ch49.htm#top

thnx
Deva

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



Re: [using #(anchor) in xxx.do]

2006-08-11 Thread Wendy Smoak

On 8/11/06, Deva Pitchai [EMAIL PROTECTED] wrote:


Is there a possibilty of using a anchor tag like below from the struts action

...

I know wht to do in the html side.. but dont dont know how to itegrate
it in the struts.


This might help:
  http://wiki.apache.org/struts/StrutsJumpToAnchor

--
Wendy

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



Re: click first table rows, the rows of second table change ??

2006-08-11 Thread Monkeyden

If I understand you correctly, here is how it might look:

YourActionForm
   Collection table1Data (retrieved from persistence on the first request
of the Action)
   Collection table2Data (empty on first request)

YourAction
   Loads table1 data
   Expects a table1RowNum parameter (from clicking on one of the rows in
table1) but can run without it for the initial request
   If param exists, load table2 data and forward to your.jsp

your.jsp
c:if test=${myActionForm.table2Data != null} (or whatever test you want)
   [print table 2 data]
/c:if

This also looks like a prime candidate for AJAX.



On 8/11/06, A. Lotfi [EMAIL PROTECTED] wrote:


I am trying to have in my jsp page two tables :

First table : Select the package  :
row1
row2
row3
...
row10

each time the user select a row, the rows in the second table change :
for example if the user click in row2 the second table will be like this :

Second Table : Select the page to print :
row2Page1
row2Page2
...
row2Page6


Could you please give me an idea on how to do it, thanks your help is
appreciated.



-
Do you Yahoo!?
Get on board. You're invited to try the new Yahoo! Mail Beta.



Re: click first table rows, the rows of second table change ??

2006-08-11 Thread A. Lotfi
Thank you Monkeyden,
   
  1) That exactly what I want, but I did not understand :
   
   Expects a table1RowNum parameter (from clicking on one of the rows 
 in table1
   
  I have never used AJAX, is there any example on how to do it with ajax ?
  thank you,
   
  

Monkeyden [EMAIL PROTECTED] wrote:
  If I understand you correctly, here is how it might look:

YourActionForm
Collection table1Data (retrieved from persistence on the first request
of the Action)
Collection table2Data (empty on first request)

YourAction
Loads table1 data
Expects a table1RowNum parameter (from clicking on one of the rows in
table1) but can run without it for the initial request
If param exists, load table2 data and forward to your.jsp

your.jsp
(or whatever test you want)
[print table 2 data]


This also looks like a prime candidate for AJAX.



On 8/11/06, A. Lotfi wrote:

 I am trying to have in my jsp page two tables :

 First table : Select the package :
 row1
 row2
 row3
 ...
 row10

 each time the user select a row, the rows in the second table change :
 for example if the user click in row2 the second table will be like this :

 Second Table : Select the page to print :
 row2Page1
 row2Page2
 ...
 row2Page6


 Could you please give me an idea on how to do it, thanks your help is
 appreciated.



 -
 Do you Yahoo!?
 Get on board. You're invited to try the new Yahoo! Mail Beta.




-
Do you Yahoo!?
 Next-gen email? Have it all with the  all-new Yahoo! Mail Beta.

Re: click first table rows, the rows of second table change ??

2006-08-11 Thread Monkeyden

There are a few AJAX people on this list who are far more qualified than I,
and I probably shouldn't even have mentioned it.  I would suggest, that you
nail down the Struts concepts and only then look at possible integrations
with other technologies.


On 8/11/06, A. Lotfi [EMAIL PROTECTED] wrote:


Thank you Monkeyden,

1) That exactly what I want, but I did not understand :

 Expects a table1RowNum parameter (from clicking on one of the rows
 in table1

I have never used AJAX, is there any example on how to do it with ajax ?
thank you,



Monkeyden [EMAIL PROTECTED] wrote:
If I understand you correctly, here is how it might look:

YourActionForm
Collection table1Data (retrieved from persistence on the first request
of the Action)
Collection table2Data (empty on first request)

YourAction
Loads table1 data
Expects a table1RowNum parameter (from clicking on one of the rows in
table1) but can run without it for the initial request
If param exists, load table2 data and forward to your.jsp

your.jsp
(or whatever test you want)
[print table 2 data]


This also looks like a prime candidate for AJAX.



On 8/11/06, A. Lotfi wrote:

 I am trying to have in my jsp page two tables :

 First table : Select the package :
 row1
 row2
 row3
 ...
 row10

 each time the user select a row, the rows in the second table change :
 for example if the user click in row2 the second table will be like this
:

 Second Table : Select the page to print :
 row2Page1
 row2Page2
 ...
 row2Page6


 Could you please give me an idea on how to do it, thanks your help is
 appreciated.



 -
 Do you Yahoo!?
 Get on board. You're invited to try the new Yahoo! Mail Beta.




-
Do you Yahoo!?
Next-gen email? Have it all with the  all-new Yahoo! Mail Beta.



JavaScript validation errors

2006-08-11 Thread O'Shea, Sean
Hi all,

I'm using struts 1.2.7 with commons-validator-1.1.4 and I'm running into
a few generated JavaScript errors. Here's what my JSP looks like:

html:javascript formName=loginForm /
html:form action=/login method=POST
  table border=0 cellspacing=5
tr
  th align=right
bean:message key=login.ssn/:
  /th
  td align=left
html:text property=SSN/bean:message
key=login.correctssn/
  /td
/tr
tr
  th align=right
bean:message key=login.password/:
  /th
  td align=left
html:password property=password/bean:message
key=login.correctpw/
  /td
/tr
tr
  td align=right
input type=submit value=bean:message
key=login.button//
  /td
  td align=left
input type=reset/
  /td
/tr
  /table
/html:form

Here's what my action mapping looks like:

action path=/login name=loginForm
type=LoginAction
scope=request validate=true
input=login
.
/action

This is what my form bean looks like:

form-bean name=loginForm
type=org.apache.struts.validator.DynaValidatorForm
form-property name=SSN
type=java.lang.String /
form-property name=password
type=java.lang.String /
/form-bean

My form validations look like this:

form name=loginForm
field property=SSN depends=required
arg key=login.ssn position=0/
/field
field property=password depends=required
arg key=login.password position=0/
/field
/form

When I try to submit my loginForm. my server die validations work fine,
but the JavaScript does not get executed. From looking at the generated
source I see this:

script type=text/javascript language=Javascript1.1 

!-- Begin 

 var bCancel = false; 

function validateLoginForm(form) {

if (bCancel) 
  return true; 
else 
 var formValidationResult;
   formValidationResult = validateRequired(form); 
 return (formValidationResult == 1);
   } 

function loginForm_required () { 
 this.a0 = new Array(SSN, SSN is required., new Function
(varName,  return this[varName];));
 this.a1 = new Array(password, Password is required., new
Function (varName,  return this[varName];));
} 

Either the JavaScript is not getting called, or the generated JavaScript
does not match up. Could it be something to do with the html:javasctipt
tag? Looking at the source I have for the JavascriptValidatorTag class I
see this version:

 * $Id: JavascriptValidatorTag.java 165208 2005-04-28 21:41:45Z mrdon $ 

All help would be greatly appreciated.

Thanks

Sean 

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



Getting maxFileSize from Controller in a JSP

2006-08-11 Thread Adam Gordon
Is there a way to reference the controller for a module from within a 
JSP?  Specifically, I'd like to ask the controller what the max file 
size is set to.  There's a method on the ControllerConfig class to get 
the max file size and the Javadocs say it's a JavaBean so I suspect it 
might available from within a JSP, I just don't know the name 
(controller?) of the bean to reference in the JSP.


Anyone know?

thanks,

-- adam

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



Re: JavaScript validation errors

2006-08-11 Thread Adam Gordon

Sean-

You need to add an onsubmit attribute to your html:form element that 
calls the validation function.  Specifically, IIRC, it needs to say:

onsubmit=return validateForm(this);

happy coding,

-adam

O'Shea, Sean wrote:

Hi all,

I'm using struts 1.2.7 with commons-validator-1.1.4 and I'm running into
a few generated JavaScript errors. Here's what my JSP looks like:

html:javascript formName=loginForm /
html:form action=/login method=POST
  table border=0 cellspacing=5
tr
  th align=right
bean:message key=login.ssn/:
  /th
  td align=left
html:text property=SSN/bean:message
key=login.correctssn/
  /td
/tr
tr
  th align=right
bean:message key=login.password/:
  /th
  td align=left
html:password property=password/bean:message
key=login.correctpw/
  /td
/tr
tr
  td align=right
input type=submit value=bean:message
key=login.button//
  /td
  td align=left
input type=reset/
  /td
/tr
  /table
/html:form

Here's what my action mapping looks like:

action path=/login name=loginForm
type=LoginAction
scope=request validate=true
input=login
.
/action

This is what my form bean looks like:

form-bean name=loginForm
type=org.apache.struts.validator.DynaValidatorForm
form-property name=SSN
type=java.lang.String /
form-property name=password
type=java.lang.String /
/form-bean

My form validations look like this:

form name=loginForm
field property=SSN depends=required
arg key=login.ssn position=0/
/field
field property=password depends=required
arg key=login.password position=0/
/field
/form

When I try to submit my loginForm. my server die validations work fine,
but the JavaScript does not get executed. From looking at the generated
source I see this:

script type=text/javascript language=Javascript1.1 

!-- Begin 

 var bCancel = false; 


function validateLoginForm(form) {

if (bCancel) 
  return true; 
else 
 var formValidationResult;
   formValidationResult = validateRequired(form); 
 return (formValidationResult == 1);
   } 

function loginForm_required () { 
 this.a0 = new Array(SSN, SSN is required., new Function

(varName,  return this[varName];));
 this.a1 = new Array(password, Password is required., new
Function (varName,  return this[varName];));
} 


Either the JavaScript is not getting called, or the generated JavaScript
does not match up. Could it be something to do with the html:javasctipt
tag? Looking at the source I have for the JavascriptValidatorTag class I
see this version:

 * $Id: JavascriptValidatorTag.java 165208 2005-04-28 21:41:45Z mrdon $ 


All help would be greatly appreciated.

Thanks

Sean 


-
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: Validator

2006-08-11 Thread Monkeyden

Who cares where they're called or what their values are?  Just add them to
the application resources file.

On 8/11/06, Jean-Marie Pitre [EMAIL PROTECTED] wrote:



Hi,

I would like to change the key name of errors.header, errors.footer,
errors.suffix ... but I don't see where they are called.

Have you got any idea ?

Thanks,

Jean-Marie.

---
Email Disclaimer
http://www.cofidis.be/emaildisclaimer.php


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




RE: JavaScript validation errors

2006-08-11 Thread O'Shea, Sean
Hi Adam,

I changed my login form to look like this:

 html:form action=/login method=POST onsubmit=return
validateLoginForm(this);
  table border=0 cellspacing=5
tr
  th align=right
bean:message key=login.ssn/:
  /th
  td align=left
html:text property=SSN/bean:message
key=login.correctssn/
  /td
/tr
tr
  th align=right
bean:message key=login.password/:
  /th
  td align=left
html:password property=password/bean:message
key=login.correctpw/
  /td
/tr
tr
  td align=right
input type=submit value=bean:message
key=login.button//
  /td
  td align=left
input type=reset/
  /td
/tr
  /table
/html:form

But still no luck. My server side validation still works fine, but the
client side validation does not seem to execute.
Even when I look at the source for my JSP I can see the call to the
JavaScript function:

form name=loginForm method=POST action=/MySampleApp/sample/login
onsubmit=return validateLoginForm(this);

Its as if the variables are not getting loaded into the JavaScript
function, or the function is not getting called at all.

Anyone have any ideas on this?

Thanks again

Sean



-Original Message-
From: Adam Gordon [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 11, 2006 11:56 AM
To: Struts Users Mailing List
Subject: Re: JavaScript validation errors

Sean-

You need to add an onsubmit attribute to your html:form element that 
calls the validation function.  Specifically, IIRC, it needs to say:
onsubmit=return validateForm(this);

happy coding,

-adam

O'Shea, Sean wrote:
 Hi all,

 I'm using struts 1.2.7 with commons-validator-1.1.4 and I'm running
into
 a few generated JavaScript errors. Here's what my JSP looks like:

 html:javascript formName=loginForm /
 html:form action=/login method=POST
   table border=0 cellspacing=5
 tr
   th align=right
   bean:message key=login.ssn/:
   /th
   td align=left
   html:text property=SSN/bean:message
 key=login.correctssn/
   /td
 /tr
 tr
   th align=right
   bean:message key=login.password/:
   /th
   td align=left
   html:password property=password/bean:message
 key=login.correctpw/
   /td
 /tr
 tr
   td align=right
   input type=submit value=bean:message
 key=login.button//
   /td
   td align=left
   input type=reset/
   /td
 /tr
   /table
 /html:form

 Here's what my action mapping looks like:

   action path=/login name=loginForm
 type=LoginAction
   scope=request validate=true
 input=login
 .
   /action

 This is what my form bean looks like:

   form-bean name=loginForm
 type=org.apache.struts.validator.DynaValidatorForm
   form-property name=SSN
 type=java.lang.String /
   form-property name=password
 type=java.lang.String /
   /form-bean

 My form validations look like this:

   form name=loginForm
   field property=SSN depends=required
   arg key=login.ssn position=0/
   /field
   field property=password depends=required
   arg key=login.password position=0/
   /field
   /form

 When I try to submit my loginForm. my server die validations work
fine,
 but the JavaScript does not get executed. From looking at the
generated
 source I see this:

 script type=text/javascript language=Javascript1.1 

 !-- Begin 

  var bCancel = false; 

 function validateLoginForm(form) {

 if (bCancel) 
   return true; 
 else 
  var formValidationResult;
formValidationResult = validateRequired(form); 
  return (formValidationResult == 1);
} 

 function loginForm_required () { 
  this.a0 = new Array(SSN, SSN is required., new Function
 (varName,  return this[varName];));
  this.a1 = new Array(password, Password is required., new
 Function (varName,  return this[varName];));
 } 

 Either the JavaScript is not getting called, or the generated
JavaScript
 does not match up. Could it be something to do with the
html:javasctipt
 tag? Looking at the source I have for the JavascriptValidatorTag class
I
 see this version:

  * $Id: JavascriptValidatorTag.java 165208 2005-04-28 21:41:45Z mrdon
$ 

 All help would be greatly appreciated.

 Thanks

 Sean 

 -
 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 

Re: JavaScript validation errors

2006-08-11 Thread Monkeyden

Are you returning false when there is an error in the validation?

if(userName.trim().length() == 0){
   alert(Pathetic, technologically inept users must enter a user name.);
   return false;
}


On 8/11/06, O'Shea, Sean Sean.O'[EMAIL PROTECTED] wrote:


Hi Adam,

I changed my login form to look like this:

html:form action=/login method=POST onsubmit=return
validateLoginForm(this);
table border=0 cellspacing=5
   tr
 th align=right
   bean:message key=login.ssn/:
 /th
 td align=left
   html:text property=SSN/bean:message
key=login.correctssn/
 /td
   /tr
   tr
 th align=right
   bean:message key=login.password/:
 /th
 td align=left
   html:password property=password/bean:message
key=login.correctpw/
 /td
   /tr
   tr
 td align=right
   input type=submit value=bean:message
key=login.button//
 /td
 td align=left
   input type=reset/
 /td
   /tr
/table
/html:form

But still no luck. My server side validation still works fine, but the
client side validation does not seem to execute.
Even when I look at the source for my JSP I can see the call to the
JavaScript function:

form name=loginForm method=POST action=/MySampleApp/sample/login
onsubmit=return validateLoginForm(this);

Its as if the variables are not getting loaded into the JavaScript
function, or the function is not getting called at all.

Anyone have any ideas on this?

Thanks again

Sean



-Original Message-
From: Adam Gordon [mailto:[EMAIL PROTECTED]
Sent: Friday, August 11, 2006 11:56 AM
To: Struts Users Mailing List
Subject: Re: JavaScript validation errors

Sean-

You need to add an onsubmit attribute to your html:form element that
calls the validation function.  Specifically, IIRC, it needs to say:
onsubmit=return validateForm(this);

happy coding,

-adam

O'Shea, Sean wrote:
 Hi all,

 I'm using struts 1.2.7 with commons-validator-1.1.4 and I'm running
into
 a few generated JavaScript errors. Here's what my JSP looks like:

 html:javascript formName=loginForm /
 html:form action=/login method=POST
   table border=0 cellspacing=5
 tr
   th align=right
   bean:message key=login.ssn/:
   /th
   td align=left
   html:text property=SSN/bean:message
 key=login.correctssn/
   /td
 /tr
 tr
   th align=right
   bean:message key=login.password/:
   /th
   td align=left
   html:password property=password/bean:message
 key=login.correctpw/
   /td
 /tr
 tr
   td align=right
   input type=submit value=bean:message
 key=login.button//
   /td
   td align=left
   input type=reset/
   /td
 /tr
   /table
 /html:form

 Here's what my action mapping looks like:

   action path=/login name=loginForm
 type=LoginAction
   scope=request validate=true
 input=login
 .
   /action

 This is what my form bean looks like:

   form-bean name=loginForm
 type=org.apache.struts.validator.DynaValidatorForm
   form-property name=SSN
 type=java.lang.String /
   form-property name=password
 type=java.lang.String /
   /form-bean

 My form validations look like this:

   form name=loginForm
   field property=SSN depends=required
   arg key=login.ssn position=0/
   /field
   field property=password depends=required
   arg key=login.password position=0/
   /field
   /form

 When I try to submit my loginForm. my server die validations work
fine,
 but the JavaScript does not get executed. From looking at the
generated
 source I see this:

 script type=text/javascript language=Javascript1.1

 !-- Begin

  var bCancel = false;

 function validateLoginForm(form) {

 if (bCancel)
   return true;
 else
  var formValidationResult;
formValidationResult = validateRequired(form);
  return (formValidationResult == 1);
}

 function loginForm_required () {
  this.a0 = new Array(SSN, SSN is required., new Function
 (varName,  return this[varName];));
  this.a1 = new Array(password, Password is required., new
 Function (varName,  return this[varName];));
 }

 Either the JavaScript is not getting called, or the generated
JavaScript
 does not match up. Could it be something to do with the
html:javasctipt
 tag? Looking at the source I have for the JavascriptValidatorTag class
I
 see this version:

  * $Id: JavascriptValidatorTag.java 165208 2005-04-28 21:41:45Z mrdon
$

 All help would be greatly appreciated.

 Thanks

 Sean

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



RE: JavaScript validation errors

2006-08-11 Thread O'Shea, Sean
Hi,

I'm not writing the JavaScript code myself, so I cannot include a check
like you suggested. The JavaScript is being automatically generated
using the html:javascript tag. The generated validateRequired method
is taken directly from the commons-validator.jar:

function validateRequired(form) {
var isValid = true;
var focusField = null;
var i = 0;
var fields = new Array();
var formName = form.getAttributeNode(name);

oRequired = eval('new ' + formName.value + '_required()');

for (x in oRequired) {
var field = form[oRequired[x][0]];

if ((field.type == 'hidden' ||
field.type == 'text' ||
field.type == 'textarea' ||
field.type == 'file' ||
field.type == 'checkbox' ||
field.type == 'select-one' ||
field.type == 'password') 
field.disabled == false) {

var value = '';
// get field's value
if (field.type == select-one) {
var si = field.selectedIndex;
if (si = 0) {
value = field.options[si].value;
}
} else if (field.type == 'checkbox') {
if (field.checked) {
value = field.value;
}
} else {
value = field.value;
}

if (trim(value).length == 0) {

if (i == 0) {
focusField = field;
}
fields[i++] = oRequired[x][1];
isValid = false;
}
} else if (field.type == select-multiple) { 
var numOptions = field.options.length;
lastSelected=-1;
for(loop=numOptions-1;loop=0;loop--) {
if(field.options[loop].selected) {
lastSelected = loop;
value = field.options[loop].value;
break;
}
}
if(lastSelected  0 || trim(value).length == 0) {
if(i == 0) {
focusField = field;
}
fields[i++] = oRequired[x][1];
isValid=false;
}
} else if ((field.length  0)  (field[0].type == 'radio'
|| field[0].type == 'checkbox')) {
isChecked=-1;
for (loop=0;loop  field.length;loop++) {
if (field[loop].checked) {
isChecked=loop;
break; // only one needs to be checked
}
}
if (isChecked  0) {
if (i == 0) {
focusField = field[0];
}
fields[i++] = oRequired[x][1];
isValid=false;
}
}
}
if (fields.length  0) {
   focusField.focus();
   alert(fields.join('\n'));
}
return isValid;
}

// Trim whitespace from left and right sides of s.
function trim(s) {
return s.replace( /^\s*/,  ).replace( /\s*$/,  );
}

Sean

-Original Message-
From: Monkeyden [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 11, 2006 1:57 PM
To: Struts Users Mailing List
Subject: Re: JavaScript validation errors

Are you returning false when there is an error in the validation?

if(userName.trim().length() == 0){
alert(Pathetic, technologically inept users must enter a user
name.);
return false;
}


On 8/11/06, O'Shea, Sean Sean.O'[EMAIL PROTECTED] wrote:

 Hi Adam,

 I changed my login form to look like this:

 html:form action=/login method=POST onsubmit=return
 validateLoginForm(this);
 table border=0 cellspacing=5
tr
  th align=right
bean:message key=login.ssn/:
  /th
  td align=left
html:text property=SSN/bean:message
 key=login.correctssn/
  /td
/tr
tr
  th align=right
bean:message key=login.password/:
  /th
  td align=left
html:password property=password/bean:message
 key=login.correctpw/
  /td
/tr
tr
  td align=right
input type=submit value=bean:message
 key=login.button//
  /td
  td align=left
input type=reset/
  /td
/tr
 /table
 /html:form

 But still no luck. My server side validation still works fine, but the
 client side validation does not seem to execute.
 Even when I look at the source for my JSP I can see the call to the
 JavaScript function:

 form name=loginForm method=POST
action=/MySampleApp/sample/login
 onsubmit=return validateLoginForm(this);

 Its as if the variables are not getting loaded into the JavaScript
 function, or the function is not getting called at all.

 

html:link and post instead of get

2006-08-11 Thread David Durham
Is there a common way to change an html:link / or c:url / from a get 
to a post http request?  Looks like it would have to replace an a 
href=/a with a form.  RoR does this easily enough.  One idea would 
be to add a method=post|get option to html:link or something similar 
to that.



-Dave

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



Re: Getting maxFileSize from Controller in a JSP

2006-08-11 Thread David Durham

Adam Gordon wrote:
Is there a way to reference the controller for a module from within a 
JSP?  Specifically, I'd like to ask the controller what the max file 
size is set to.  There's a method on the ControllerConfig class to get 
the max file size and the Javadocs say it's a JavaBean so I suspect it 
might available from within a JSP, I just don't know the name 
(controller?) of the bean to reference in the JSP.


There's a module config that's stored as a request attribute.  THe key 
is in the Globals class, I think it's MODULE_KEY.  It has a reference to 
a controller config.  Little utility method to find what's in request 
attributes:


public static void debugRequestAttributes(HttpServletRequest request) {
EnumerationString attributeNames = request.getAttributeNames();
while (attributeNames.hasMoreElements()) {
String a = attributeNames.nextElement();
log.debug(a + :  + request.getAttribute(a));
}
}


-Dave

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



Re: Splitting validation.xml

2006-08-11 Thread Laurie Harper

Kevin Maeer wrote:

I want to split the validation.xml file into multiple files so some pages can be
more easily reused. If I save the new file under /WEB-INF/ and add it to the
ValidatorPlugIn pathnames in struts-config.xml everything works fine.

If I move the new file out into the class hierarchy and change the
ValidatorPlugIn entry to point to the new location, it all turns to custard and
I get the following in the logs:
 
Loading validation rules file from

'/nz/ac/otago/corpserv/paper/web/struts/forms/validation/paper-search-validation
..xml' 
Skipping validation rules file from

'/nz/ac/otago/corpserv/paper/web/struts/forms/validation/paper-search-validation
..xml'.  No stream could be opened.
javax.servlet.ServletException: Skipping validation rules file from
'/nz/ac/otago/corpserv/paper/web/struts/forms/validation/paper-search-validation
..xml'.  No stream could be opened.
at
org.apache.struts.validator.ValidatorPlugIn.initResources(ValidatorPlugIn.java:2
26)
at
org.apache.struts.validator.ValidatorPlugIn.init(ValidatorPlugIn.java:162)

Is it possible to specify a location that isn't under web-inf for the validation
file and if so how is it specified? All the examples I've googled, that have the
file not under web-inf, use the old style pathname property to specify the
location.


The 'pathnames' property expects paths relative to the web application 
root, so you aren't required to store your validation files under 
WEB-INF. However, in this case it looks like you're trying to place them 
in WEB-INF/classes/nz/ac/... so you still need the path to start with 
'/WEB-INF/classes/nz/ac...'


It may also be possible to place the validation files inside a jar in 
WEB-INF/lib, though in that case I'm not sure what syntax would be 
required for Struts to find them. I believe the 1.3.x series is loading 
at least some of the validator config from the struts.jar by default, so 
there may be a way to get it to do the same for your validation rules 
files too, but you'll have to dig in the code a bit to find out, unless 
someone else can offer suggestions.


L.


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



Re: about javascript

2006-08-11 Thread Puneet Lakhina

On 8/11/06, Gary Feidt [EMAIL PROTECTED] wrote:


Add an onclick=validateForm(); return false;

Then create a javascript function:

script language=JavaScript
function validateForm() {
var errorString = The following field(s) may not be left
blank:\r\n\r\n;
var strField = ;
if (document.frmTest.txtFirstName.value.length == 0) {
strField +=  - First Name\n;
}
if (document.frmTest.txtLastName.value.length == 0) {
strField +=  - Last Name\n;
}
if (document.frmTest.txtPhone.value.length == 0) {
strField +=  - Phone Number\n;
}
if (strField.length  0) {
alert(errorString + strField);
}
} else {
document.frmTest.submit();
}
/script

Gary

 [EMAIL PROTECTED] 8/11/2006 6:15:19 AM 
hai
i am working in struts1.1
i have threee fields in html:text
how to check these empty fields when submitting the submit button using
java script
its very uergent
with kindly regards
gomes
__



as far as i know, this should answer your question. Check if you have
included  the return false in your onclick.

ANd as for initialisation. doing
private String field1=;
is not necessary.

--
Puneet