Re: Validation framework wont apply when we use table in jsp ?

2009-03-10 Thread Dave Newton

As far as I can tell you've posted three questions asking the same thing.

The "simple" theme doesn't render error information.

Dave

sajidbigler wrote:

Hi plz help me to resolve this when we use table with in jsp validation
framework wont be applied and as well actionerror,actionmessages wont b
shown how to resolve this?


Login.jsp

<%@ page contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sx" uri="/struts-dojo-tags" %>




MMS Application





  
Skip to:  #nav site menu  |  #leftside section menu  | 
#content main content 



MMS Application
Subscriptions Management System 






 Login Page »






Welcome to "MMS Application "...
Enter Login Details  

























New User 
SignUP





© 2009 Teleparadigm | Powered by 
http://teleparadigm.com/contactus.html Teleparadigm 







LoginAction-validation.xml


  		"-//OpenSymphony Group//XWork Validator 1.0.2//EN" 
  		"http://www.opensymphony.com/xwork/xwork-validator-1.0.2.dtd";>





true
Login name is 
required




true
Password is required





LoginAction.java

package com.teleparadigm.mms.application.login;
import java.util.Map;
import java.util.logging.LogManager;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.apache.struts2.interceptor.ServletRequestAware;

import com.opensymphony.xwork2.ActionContext;
import com.opensymphony.xwork2.ActionSupport;
import com.opensymphony.xwork2.util.logging.Logger;
import com.teleparadigm.mms.application.common.Owner;



/**
 *  Validate a user login. 
 */
public  class LoginAction  extends ActionSupport  implements
ServletRequestAware
{


private HttpServletRequest request;

public void setServletRequest(HttpServletRequest request){
this.request = request;
}

public HttpServletRequest getServletRequest(){
return request;
}

LoginDAO ldao=new LoginDAO();
private String username = null;
private String password = null;
public String execute() throws Exception {

Owner ownerobj=ldao.getUserObject(getUsername().trim());
String PasswordFromDB=ownerobj.getPassword();
System.out.println("getUsername()-->"+getUsername());
System.out.println("PasswordFromDB-->"+PasswordFromDB);
System.out.println("getPassword()-->"+getPassword());
if( PasswordFromDB==null ||
!(getPassword().equalsIgnoreCase(PasswordFromDB))){
addActionError("Invalid user name or password! Please try 
again!");
return ERROR;
}else{
HttpSession session=request.getSession(true);
session.setAttribute("ownerobj", ownerobj);
return SUCCESS;
}
}

public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}





}




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



Re: Validation framework... weird...

2007-07-25 Thread Laurie Harper

Balazs Michnay wrote:

Dear Struts Users,

I have a form with 13 form controls on it. I'd like to use the Struts 
Validation Framework to validate it, but it's acting weird.
What I'd like to do is to have AT LEAST ONE of the controls filled, but the test of 
"validWhen" only allows simple boolean expressions.
I used a simple approach of checking each control for their value being null 
but the test cannot containmore than one boolean operator.
For instance, the following works just fine:


test
 ((*this* != null) or (suly != null)) 



But if I insert another control test, I get an error message saying "ValidWhen Error 
for field ' magassag' - line 1:37: expecting RPAREN, found 'or'", so no more than 
two conditions are allowed in a test.

Is that true? Is there any way to create complex tests? Or is there a way to 
validate the form for having at least one field filled?


The grammar for validwhen expressions is rather limited; you can only 
have one operator per group. The solution is to add additional parentheses:


  (((*this* != null) or (suly != null)) or ...)/var-value>

L.


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



Re: Validation Framework

2007-03-13 Thread Balazs Michnay
Thanks guys, now it perfectly works. As a conclusion, most of the online 
articles on how to use the validation framework work just fine, but they all 
missed the validate="true" attribute.
Besides this, I had a wrong value of my action's input attribute.
Thanks again, you are very helpful.

Regards,

  Balazs


- Original Message 
From: Dave Newton <[EMAIL PROTECTED]>
To: Struts Users Mailing List 
Sent: Tuesday, March 13, 2007 6:21:52 PM
Subject: Re: Validation Framework


--- Christopher Schultz wrote:
> I didn't say that you need another URL that doesn't
> perform validation. 

Oh. I guess I don't know another way to show a form
via an Action without running validation except by
defining an Action.

d.





Bored stiff? Loosen up... 
Download and play hundreds of games for free on Yahoo! Games.
http://games.yahoo.com/games/front

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


 

Be a PS3 game guru.
Get your game face on with the latest PS3 news and previews at Yahoo! Games.
http://videogames.yahoo.com/platform?platform=120121

Re: Validation Framework

2007-03-13 Thread Dave Newton
--- Christopher Schultz wrote:
> I didn't say that you need another URL that doesn't
> perform validation. 

Oh. I guess I don't know another way to show a form
via an Action without running validation except by
defining an Action.

d.



 

Bored stiff? Loosen up... 
Download and play hundreds of games for free on Yahoo! Games.
http://games.yahoo.com/games/front

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



Re: Validation framework question

2007-03-13 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Dave,

Dave Newton wrote:
> --- Christopher Schultz wrote:
>> I wrote:
>>> Try breaking up the JSP into dynamic includes
>> This might not help, depending in which type of
>> include you use. Static includes, for example, [...]
> 
> ...

Heh. Missed "dynamic". Sorry 'bout that.

- -chris

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFF9t3M9CaO5/Lv0PARAsrHAKCoeSdUyv4cH4wjTH7nmX16NPjXogCdEQ76
fc9Lms259ldMHMRCUPSpeWk=
=ZHid
-END PGP SIGNATURE-

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



Re: Validation Framework

2007-03-13 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Dave,

Dave Newton wrote:
> --- Christopher Schultz wrote:
>> Right. Under most circumstances, you should set
>> validate="true" in your  definition, and 
>> /not/ call form.validate() in your own action.
>> You /are/ free to call validation by hand, but it's
>> generally more convenient to allow Struts to handle 
>> the validate/fail/redirect logic for you -- if only 
>> to simplify the code in your own actions.
> 
> Bah. That still doesn't make any sense to me; my base
> class handles all of the work and I don't have to
> define another action with a different URL just to
> display a form without running validation.

I didn't say that you need another URL that doesn't perform validation.
I'm just suggesting that calling form.validate( ) by hand doesn't buy
you much (unless you are doing something complex). Since the OT is just
starting out, I'm guessing his validations are relatively simple.

- -chris

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFF9t0V9CaO5/Lv0PARAnDKAJ97njyUOTxekxwoEJAi7+OY7qLcnwCgno4C
GYNRNQMEWRpZk4RLss0W7S0=
=IlSV
-END PGP SIGNATURE-

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



Re: Validation framework question

2007-03-13 Thread Dave Newton
--- Christopher Schultz wrote:
> I wrote:
>> Try breaking up the JSP into dynamic includes
> This might not help, depending in which type of
> include you use. Static includes, for example, [...]

...

d.



 

Looking for earth-friendly autos? 
Browse Top Cars by "Green Rating" at Yahoo! Autos' Green Center.
http://autos.yahoo.com/green_center/

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



Re: Validation framework question

2007-03-13 Thread Mike Baroukh


for Websphere, in a subdirectory of AppServer/temp/ you should find 
_*java or, at least _*class if it doesn't keep generated files.
There is a checkbox to check on the console to keep generated files but 
I never remember where ...

(I hate WebSphere !).


If you use the integrated instance of WebSphere in WSAD, I think there 
is a subfolder in eclipse/.plugins that is used for this ...

try again to search for "_*class" 

google with websphere keepgenerated returns a lot of results
(or WSAD keepgenerated ...)

Mike

Chaudhary, Harsh a écrit :

I tried to do that but I could not find where my IDE stores those files. I am 
using WSAD 5.1.1 with WebSphere. Any suggestions would be appreciated.

Harsh.

-Original Message-
From: Mike Baroukh [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 13, 2007 11:56 AM

To: Struts Users Mailing List
Subject: Re: Validation framework question



then, you may try to look at the compiled jsp ?


Chaudhary, Harsh a écrit :
  

I know that the exception "Maximum try/catch size reached" has something to do 
with the compiler but what I would likt to know is that whether or not any validation 
code is added to the compiled JSP file itself.

Harsh.

-Original Message-
From: Mike Baroukh [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 13, 2007 11:51 AM

To: Struts Users Mailing List
Subject: Re: Validation framework question



Hi.

This is only a problem with javac and depending on wich java version you 
use.

jdk5 should not have the problem.
You may also try to use jikes for compiler.

There may be or may be no code added for the validation.
But this is not the problem ...

Mike

Chaudhary, Harsh a écrit :
  


I am having an arguement with a co-worker here and here is how it goes.

We have a JSP which has about 100 input fields. These fields have custom
validators on them. When we try to run the JSP, it throws an exception
something to the tune of "Maximum try/catch size reached" or something
like that. He says that this is because of the validations and when we
remove the validations, everything is fine.

I say that the validation framework has absolutely nothing to do with
the JSP's. It deals with the struts forms exclusively. So, the exception
could not have been because of the validators. He says that when the JSP
is compiled to a servlet, all the validation code is added to the
compiled version of the JSP, something I do not agree with.

Any inputs?

Thanks,
Harsh.

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

  

  
  




  



--

Mike Baroukh

---
Cardiweb  - 31 Rue de Mogador Paris IXeme
06 63 57 27 22 - 01 53 21 82 63 - Jabber: [EMAIL PROTECTED]
http://www.cardiweb.com
---


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

Re: Validation framework question

2007-03-13 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Dave,

Dave Newton wrote:
> --- Mike Baroukh <[EMAIL PROTECTED]> wrote:
>> jdk5 should not have the problem.
> 
> Did 1.5+ remove the 64K limitation?

The 64k is a limit for method bodies, not try/catch. It should still be
very much in force:
http://java.sun.com/docs/books/jvms/second_edition/html/ClassFile.doc.html#88659

I must admit that I've never heard of this "try/catch too big" problem
before.

Since the "code" and "exceptions" attributes of a method in a Java
.class file have the same limitations (64k), and the compiler checks the
try/catch limits before the code limits, then they really are the same
thing.

In either case, those limits are still in force (i.e. you cann't exceed
64k of code, try/catch or not).

This is one of those irritating issues that breaks down the facade that
JSP operates behind. JSP authors shouldn't have to worry about the
limitations of Java when authoring their pages, but they do :(

>> There may be or may be no code added for the validation. But this
>> is not the problem ...
> 
> Technically, no, but it's the gating issue in this case.
> 
> Try breaking up the JSP into dynamic includes (which will be easier
> to manage anyway, because 100 fields on a form is *way* too many, and
> must make editing/modifying a nightmare).

This might not help, depending in which type of include you use. Static
includes, for example, will just import the code from the included JSP,
solving nothing.

Simplifying the page is definitely a good idea, though. If you use a lot
of taglibs (such as emitting 100 form fields using Struts tags), you'll
get a lot of generated code, causing you to run out of space.

The validation is not the problem, though. If you removed validation
entirely, you'd still get this error.

- -chris

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFF9twQ9CaO5/Lv0PARAgX3AJ9CJTPbkAF7nQ5EJQ5bTjiGUPmtAACggJ+H
OvylAQkRLgU70hRGJUzcpXo=
=rObM
-END PGP SIGNATURE-

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



Re: Validation Framework

2007-03-13 Thread Dave Newton
--- Christopher Schultz wrote:
> Right. Under most circumstances, you should set
> validate="true" in your  definition, and 
> /not/ call form.validate() in your own action.
> You /are/ free to call validation by hand, but it's
> generally more convenient to allow Struts to handle 
> the validate/fail/redirect logic for you -- if only 
> to simplify the code in your own actions.

Bah. That still doesn't make any sense to me; my base
class handles all of the work and I don't have to
define another action with a different URL just to
display a form without running validation.

d.



 

We won't tell. Get more on shows you hate to love 
(and love to hate): Yahoo! TV's Guilty Pleasures list.
http://tv.yahoo.com/collections/265 

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



Re: Validation Framework

2007-03-13 Thread Christopher Schultz
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Balazs,

Balazs Michnay wrote:
> Thanks a lot for your help! It really does work! What I missed was
> the validate="true" attribute of the action tag, however, this was
> not mentioned by any of the articles I read.

If it's not mentioned, you should point that out to the authors. I'm
sure they would want to know about any oversights.

> The other thing is that now, the validation error message DID show
> up, but it is displayed on "destination-page" that should only show
> up when the validation was successful.What I want to do is to show
> the same for until valid values are not entered and when all the
> necessary fields are filled with valid values, forward the user to
> the "destination-page".

If validation actually fails, it should be redirecting the user to the
page mentioned in the "input" attribute of the  currently being
executed.

If validation has passes, but some other error has occurred, perhaps you
are handling that situation incorrectly in your code.

> Again, I'm missing some settings in my config files. You told me to
> use the validate() method but now it's completely removed because all
> the articles told me to remove it.

Right. Under most circumstances, you should set validate="true" in your
 definition, and /not/ call form.validate() in your own action.
You /are/ free to call validation by hand, but it's generally more
convenient to allow Struts to handle the validate/fail/redirect logic
for you -- if only to simplify the code in your own actions.

>  path="/L01FormAction" scope="request" type="com.myapp.struts.ACT_L01"
> validate="true">  
>   path="/LP/JSP_L01_1.jsp"/> 

I see the problem: "input" and "success" are set to the same page. Is
that what you meant to do?

I hope that helps,
- -chris
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFF9tly9CaO5/Lv0PARAm5yAJ9etlGCzbBFWnEK/oJCjZEcWhDZhACgvRXT
W5VsZyEawBx79bfMgy4+qag=
=V3DS
-END PGP SIGNATURE-

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



Re: Validation framework question

2007-03-13 Thread Mike Baroukh

>Did 1.5+ remove the 64K limitation?

I'm not absolutly sure, but  think.
I read this once and it's been a long time since I didn't saw this 
exception ...


Mike

Dave Newton a écrit :

--- Mike Baroukh <[EMAIL PROTECTED]> wrote:
  

jdk5 should not have the problem.



Did 1.5+ remove the 64K limitation?

  

There may be or may be no code added for the
validation. But this is not the problem ...



Technically, no, but it's the gating issue in this
case.

Try breaking up the JSP into dynamic includes (which
will be easier to manage anyway, because 100 fields on
a form is *way* too many, and must make
editing/modifying a nightmare).

d.



 


Now that's room service!  Choose from over 150,000 hotels
in 45,000 destinations on Yahoo! Travel to find your fit.
http://farechase.yahoo.com/promo-generic-14795097

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

  



--

Mike Baroukh

---
Cardiweb  - 31 Rue de Mogador Paris IXeme
06 63 57 27 22 - 01 53 21 82 63 - Jabber: [EMAIL PROTECTED]
http://www.cardiweb.com
---


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

RE: Validation framework question

2007-03-13 Thread Chaudhary, Harsh
I tried to do that but I could not find where my IDE stores those files. I am 
using WSAD 5.1.1 with WebSphere. Any suggestions would be appreciated.

Harsh.

-Original Message-
From: Mike Baroukh [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 13, 2007 11:56 AM
To: Struts Users Mailing List
Subject: Re: Validation framework question



then, you may try to look at the compiled jsp ?


Chaudhary, Harsh a écrit :
> I know that the exception "Maximum try/catch size reached" has something to 
> do with the compiler but what I would likt to know is that whether or not any 
> validation code is added to the compiled JSP file itself.
>
> Harsh.
>
> -Original Message-
> From: Mike Baroukh [mailto:[EMAIL PROTECTED] 
> Sent: Tuesday, March 13, 2007 11:51 AM
> To: Struts Users Mailing List
> Subject: Re: Validation framework question
>
>
>
> Hi.
>
> This is only a problem with javac and depending on wich java version you 
> use.
> jdk5 should not have the problem.
> You may also try to use jikes for compiler.
>
> There may be or may be no code added for the validation.
> But this is not the problem ...
>
> Mike
>
> Chaudhary, Harsh a écrit :
>   
>> I am having an arguement with a co-worker here and here is how it goes.
>>
>> We have a JSP which has about 100 input fields. These fields have custom
>> validators on them. When we try to run the JSP, it throws an exception
>> something to the tune of "Maximum try/catch size reached" or something
>> like that. He says that this is because of the validations and when we
>> remove the validations, everything is fine.
>>
>> I say that the validation framework has absolutely nothing to do with
>> the JSP's. It deals with the struts forms exclusively. So, the exception
>> could not have been because of the validators. He says that when the JSP
>> is compiled to a servlet, all the validation code is added to the
>> compiled version of the JSP, something I do not agree with.
>>
>> Any inputs?
>>
>> Thanks,
>> Harsh.
>>
>> -
>> To unsubscribe, e-mail: [EMAIL PROTECTED]
>> For additional commands, e-mail: [EMAIL PROTECTED]
>>
>>   
>> 
>
>
>   


-- 

Mike Baroukh

---
Cardiweb  - 31 Rue de Mogador Paris IXeme
06 63 57 27 22 - 01 53 21 82 63 - Jabber: [EMAIL PROTECTED]
http://www.cardiweb.com
---


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



Re: Validation framework question

2007-03-13 Thread Dave Newton
--- Mike Baroukh <[EMAIL PROTECTED]> wrote:
> jdk5 should not have the problem.

Did 1.5+ remove the 64K limitation?

> There may be or may be no code added for the
> validation. But this is not the problem ...

Technically, no, but it's the gating issue in this
case.

Try breaking up the JSP into dynamic includes (which
will be easier to manage anyway, because 100 fields on
a form is *way* too many, and must make
editing/modifying a nightmare).

d.



 

Now that's room service!  Choose from over 150,000 hotels
in 45,000 destinations on Yahoo! Travel to find your fit.
http://farechase.yahoo.com/promo-generic-14795097

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



Re: Validation framework question

2007-03-13 Thread Mike Baroukh


then, you may try to look at the compiled jsp ?


Chaudhary, Harsh a écrit :

I know that the exception "Maximum try/catch size reached" has something to do 
with the compiler but what I would likt to know is that whether or not any validation 
code is added to the compiled JSP file itself.

Harsh.

-Original Message-
From: Mike Baroukh [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 13, 2007 11:51 AM

To: Struts Users Mailing List
Subject: Re: Validation framework question



Hi.

This is only a problem with javac and depending on wich java version you 
use.

jdk5 should not have the problem.
You may also try to use jikes for compiler.

There may be or may be no code added for the validation.
But this is not the problem ...

Mike

Chaudhary, Harsh a écrit :
  

I am having an arguement with a co-worker here and here is how it goes.

We have a JSP which has about 100 input fields. These fields have custom
validators on them. When we try to run the JSP, it throws an exception
something to the tune of "Maximum try/catch size reached" or something
like that. He says that this is because of the validations and when we
remove the validations, everything is fine.

I say that the validation framework has absolutely nothing to do with
the JSP's. It deals with the struts forms exclusively. So, the exception
could not have been because of the validators. He says that when the JSP
is compiled to a servlet, all the validation code is added to the
compiled version of the JSP, something I do not agree with.

Any inputs?

Thanks,
Harsh.

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

  




  



--

Mike Baroukh

---
Cardiweb  - 31 Rue de Mogador Paris IXeme
06 63 57 27 22 - 01 53 21 82 63 - Jabber: [EMAIL PROTECTED]
http://www.cardiweb.com
---


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

RE: Validation framework question

2007-03-13 Thread Chaudhary, Harsh
I know that the exception "Maximum try/catch size reached" has something to do 
with the compiler but what I would likt to know is that whether or not any 
validation code is added to the compiled JSP file itself.

Harsh.

-Original Message-
From: Mike Baroukh [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, March 13, 2007 11:51 AM
To: Struts Users Mailing List
Subject: Re: Validation framework question



Hi.

This is only a problem with javac and depending on wich java version you 
use.
jdk5 should not have the problem.
You may also try to use jikes for compiler.

There may be or may be no code added for the validation.
But this is not the problem ...

Mike

Chaudhary, Harsh a écrit :
> I am having an arguement with a co-worker here and here is how it goes.
>
> We have a JSP which has about 100 input fields. These fields have custom
> validators on them. When we try to run the JSP, it throws an exception
> something to the tune of "Maximum try/catch size reached" or something
> like that. He says that this is because of the validations and when we
> remove the validations, everything is fine.
>
> I say that the validation framework has absolutely nothing to do with
> the JSP's. It deals with the struts forms exclusively. So, the exception
> could not have been because of the validators. He says that when the JSP
> is compiled to a servlet, all the validation code is added to the
> compiled version of the JSP, something I do not agree with.
>
> Any inputs?
>
> Thanks,
> Harsh.
>
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>   


-- 

Mike Baroukh

---
Cardiweb  - 31 Rue de Mogador Paris IXeme
06 63 57 27 22 - 01 53 21 82 63 - Jabber: [EMAIL PROTECTED]
http://www.cardiweb.com
---


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



Re: Validation framework question

2007-03-13 Thread Mike Baroukh


Hi.

This is only a problem with javac and depending on wich java version you 
use.

jdk5 should not have the problem.
You may also try to use jikes for compiler.

There may be or may be no code added for the validation.
But this is not the problem ...

Mike

Chaudhary, Harsh a écrit :

I am having an arguement with a co-worker here and here is how it goes.

We have a JSP which has about 100 input fields. These fields have custom
validators on them. When we try to run the JSP, it throws an exception
something to the tune of "Maximum try/catch size reached" or something
like that. He says that this is because of the validations and when we
remove the validations, everything is fine.

I say that the validation framework has absolutely nothing to do with
the JSP's. It deals with the struts forms exclusively. So, the exception
could not have been because of the validators. He says that when the JSP
is compiled to a servlet, all the validation code is added to the
compiled version of the JSP, something I do not agree with.

Any inputs?

Thanks,
Harsh.

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

  



--

Mike Baroukh

---
Cardiweb  - 31 Rue de Mogador Paris IXeme
06 63 57 27 22 - 01 53 21 82 63 - Jabber: [EMAIL PROTECTED]
http://www.cardiweb.com
---


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

Re: Validation Framework

2007-03-13 Thread Balazs Michnay
Hi Dave,

Thanks a lot for your help! It really does work! What I missed was the 
validate="true" attribute of the action tag, however, this was not mentioned by 
any of the articles I read.

The other thing is that now, the validation error message DID show up, but it 
is displayed on "destination-page" that should only show up when the validation 
was successful.What I want to do is to show the same for until valid values are 
not entered and when all the necessary fields are filled with valid values, 
forward the user to the "destination-page".

Again, I'm missing some settings in my config files.
You told me to use the validate() method but now it's completely removed 
because all the articles told me to remove it...

Here are some parts of my files:

--
Action mapping of struts-config.xml:
--











--
The form that should be validated (the textarea only)
--















JanuárFebruárMárciusÁprilisMájusJúniusJúliusAugusztusSzeptemberOktóberNovemberDecember 
   















 





   
 











<%--  --%>





- Original Message 
From: Dave Newton <[EMAIL PROTECTED]>
To: Struts Users Mailing List 
Sent: Tuesday, March 13, 2007 4:24:09 PM
Subject: Re: Validation Framework


--- Balazs Michnay <[EMAIL PROTECTED]> wrote:
> I'm relatively new to Struts and am trying to get
> the Validation Framework working without success.

You neither set validate='true' on your Action (in the
struts-config action-mapping configuration element)
nor call the form bean's 'validate' method (from, say,
your Action).

FWIW, it's usually sufficient to simply post the
relevent portions of the config and source files
rather than providing a ZIP file of your entire
project.

To answer your next question, you can either create an
action-mapping with validate="false" to forward to the
form's JSP page or you can set validate="false" and
call validate manually from within your Action based
on whether or not it's a GET or POST request (assuming
you submit with a POST; personally I have this
behavior in an Action base class and never use the
automagic validation, but this has been discussed to
death in the past :)

d.





Be a PS3 game guru.
Get your game face on with the latest PS3 news and previews at Yahoo! Games.
http://videogames.yahoo.com/platform?platform=120121

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


 

8:00? 8:25? 8:40? Find a flick in no time 
with the Yahoo! Search movie showtime shortcut.
http://tools.search.yahoo.com/shortcuts/#news

Re: Validation Framework

2007-03-13 Thread Dave Newton
--- Balazs Michnay <[EMAIL PROTECTED]> wrote:
> I'm relatively new to Struts and am trying to get
> the Validation Framework working without success.

You neither set validate='true' on your Action (in the
struts-config action-mapping configuration element)
nor call the form bean's 'validate' method (from, say,
your Action).

FWIW, it's usually sufficient to simply post the
relevent portions of the config and source files
rather than providing a ZIP file of your entire
project.

To answer your next question, you can either create an
action-mapping with validate="false" to forward to the
form's JSP page or you can set validate="false" and
call validate manually from within your Action based
on whether or not it's a GET or POST request (assuming
you submit with a POST; personally I have this
behavior in an Action base class and never use the
automagic validation, but this has been discussed to
death in the past :)

d.



 

Be a PS3 game guru.
Get your game face on with the latest PS3 news and previews at Yahoo! Games.
http://videogames.yahoo.com/platform?platform=120121

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



Re: Validation Framework

2007-03-13 Thread Mike Baroukh
I'm still using struts 1.1 and your struts config/form is really 
different from what I used to do.

But, in struts 1.1, we had to add
validate="true"
in the struts-config on the action ...

your struts-config doesn't have any.

Maybe ...

Mike

Balazs Michnay a écrit :

Dear Struts Users,
 
I'm relatively new to Struts and am trying to get the Validation Framework working without success. I've read several tutorials and articles on using it, but it just doesn't want to work. I'm using NetBeans 5.5, so that I can use Struts 1.2.9.

Having set everything, I get no error messages from the Sun Java Application 
Server 9, it just simply does not do any validation. It skips the validating my 
form and forwards me to the JSP page that should open only on successful 
validation.
I don't attach the sources, because the zip file is too big, but I share it 
with you:
 
http://www.inf.u-szeged.hu/~michnay/struts/SZTGKR.ZIP
 
My form should only validate a textarea html control.

Do I need to do any special settings in NetBeans or do I miss some settings?
 
Since it's been about 4 days I'm trying to get it working I'd be grateful if someone would please take a look at my form and my validation settings.
 
Thanks for your reply,
 
Regards,
 
  michnay



 

TV dinner still cooling? 
Check out "Tonight's Picks" on Yahoo! TV.

http://tv.yahoo.com/
  



--

Mike Baroukh

---
Cardiweb  - 31 Rue de Mogador Paris IXeme
06 63 57 27 22 - 01 53 21 82 63 - Jabber: [EMAIL PROTECTED]
http://www.cardiweb.com
---


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

Re: Validation Framework and DispatchAction

2006-12-28 Thread Wendy Smoak

On 12/28/06, Andy Foster <[EMAIL PROTECTED]> wrote:


This should solve my problem as each submitaction that requires validation
validates the same set of data.

However this will not work if there are three methods create and update both
need to validate but each validate against a different set of parameters and
the third submitaction does not validate.


To validate against a different set of parameters for each dispatched
method, consider how ValidatorForm and ValidatorActionForm work.
ValidatorForm keys off of the form name, while ValidatorActionForm
keys off the path.

You appear to already be using ValidatorActionForm, because you have
  
instead of
  

If you want to invent a new way to map requests to validation rule
sets, I think all you need to do is subclass ValidatorForm and
override getValidationKey().  Try having it return the value of the
parameter you're using for method dispatching, then use that for the
 in validation.xml.

Seems reasonable anyway... I haven't played with this in a while.

--
Wendy

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



Re: Validation Framework and DispatchAction

2006-12-28 Thread Ed Griebel

Use a "page" field in your form (set this in your action class before
you call form.validate()) and set page="x" in your validation.xml
file. The example below shows using a HTML hidden field "page", which
is a different way to set this page variable.

http://struts.apache.org/1.x/struts-extras/dispatchValidator.html

HTH,
-ed

On 12/28/06, Andy Foster <[EMAIL PROTECTED]> wrote:

Thanks Wendy,

Switching validation off in struts-config and invoking manually in each
method where required will work. This can be done as follows:

// validate
ActionMessages errors = form.validate(mapping,request);
if ( errors != null && !errors.isEmpty() )
{
saveErrors(request, errors);
return mapping.getInputForward();
}

This should solve my problem as each submitaction that requires validation
validates the same set of data.

However this will not work if there are three methods create and update both
need to validate but each validate against a different set of parameters and
the third submitaction does not validate.

Regards

Andy

-Original Message-
From: Wendy Smoak [mailto:[EMAIL PROTECTED]
Sent: 28 December 2006 16:46
To: Struts Users Mailing List
Subject: Re: Validation Framework and DispatchAction

On 12/28/06, Andy Foster <[EMAIL PROTECTED]> wrote:

> This validates at the action mapping level so in the above case it
validates
> on update as well as create.
>
> How do you validate just against the create submitaction of the
> DispatchAction mapping?

I would suggest turning off the automatic validation, and calling it
manually when needed.

Here's an article about it (though the motivation here is different):
   http://www.learntechnology.net/validate-manually.do

--
Wendy

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

-MY Original Message-
Hi all,

This is probably a common question but have struggled to find an answer so
apologies if I have missed the obvious. Below is an example of issue:

I have a page that uses a single form to hold all the display data but can
perform the following multiple submit actions:

Create - create as a new object
Update - update the original

The page calls "/process_object.do" which is represented by a DispatchAction
that has a method for each submit action. This is simple to implement and is
all working fine.

I now turn to the validation framework I want to specify a rule to validate
the name to 3 characters only when the submitaction is create and this is my
problem. So the basic validation.xml entry is:






minlength
3




This validates at the action mapping level so in the above case it validates
on update as well as create.

How do you validate just against the create submitaction of the
DispatchAction mapping?

Regards,

Andy Foster


-
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: Validation Framework and DispatchAction

2006-12-28 Thread Andy Foster
Thanks Wendy,

Switching validation off in struts-config and invoking manually in each
method where required will work. This can be done as follows:

// validate
ActionMessages errors = form.validate(mapping,request);
if ( errors != null && !errors.isEmpty() ) 
{
saveErrors(request, errors);
return mapping.getInputForward();
}

This should solve my problem as each submitaction that requires validation
validates the same set of data. 

However this will not work if there are three methods create and update both
need to validate but each validate against a different set of parameters and
the third submitaction does not validate.

Regards

Andy

-Original Message-
From: Wendy Smoak [mailto:[EMAIL PROTECTED] 
Sent: 28 December 2006 16:46
To: Struts Users Mailing List
Subject: Re: Validation Framework and DispatchAction

On 12/28/06, Andy Foster <[EMAIL PROTECTED]> wrote:

> This validates at the action mapping level so in the above case it
validates
> on update as well as create.
>
> How do you validate just against the create submitaction of the
> DispatchAction mapping?

I would suggest turning off the automatic validation, and calling it
manually when needed.

Here's an article about it (though the motivation here is different):
   http://www.learntechnology.net/validate-manually.do

-- 
Wendy

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

-MY Original Message-
Hi all,

This is probably a common question but have struggled to find an answer so
apologies if I have missed the obvious. Below is an example of issue:

I have a page that uses a single form to hold all the display data but can
perform the following multiple submit actions:

Create - create as a new object
Update - update the original

The page calls "/process_object.do" which is represented by a DispatchAction
that has a method for each submit action. This is simple to implement and is
all working fine.

I now turn to the validation framework I want to specify a rule to validate
the name to 3 characters only when the submitaction is create and this is my
problem. So the basic validation.xml entry is:






minlength
3

   
   

This validates at the action mapping level so in the above case it validates
on update as well as create. 

How do you validate just against the create submitaction of the
DispatchAction mapping?

Regards,

Andy Foster


-
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 Framework and DispatchAction

2006-12-28 Thread Wendy Smoak

On 12/28/06, Andy Foster <[EMAIL PROTECTED]> wrote:


This validates at the action mapping level so in the above case it validates
on update as well as create.

How do you validate just against the create submitaction of the
DispatchAction mapping?


I would suggest turning off the automatic validation, and calling it
manually when needed.

Here's an article about it (though the motivation here is different):
  http://www.learntechnology.net/validate-manually.do

--
Wendy

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



Re: Validation framework problem?

2006-09-18 Thread Laurie Harper

Mallik wrote:
Hi friends 
i have stuckup in validation framework because my form will get fields

dynamically on user request
and i cannot predect how my fields it will have when posting the form
i am creating Dynamic form fields using javascript like

txt = document.createElement('input');
txt.type='text';
txt.name = 'element1';
and adding to form td element
so now
how can i set for form bean property in struts-config.xml and in
validation.xml

please let me know the solution...
ur's
Mallik


It sounds like you're creating a form that allows entry of a list of 
values. So in your form bean, you need a property (or properties) that 
represents that list -- i.e. an array or list of values.


See the documentation on working with indexed properties [1], perhaps 
that will give you what you need.


L.

[1] http://struts.apache.org/1.2.9/userGuide/building_view.html#indexed


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



Re: Validation framework for Dynamically added HTML elements?

2006-09-14 Thread Laurie Harper
You can achieve what you want more simply; no need to start using Ajax 
just for expanding an input form :-)


What you need to do is to generate additional rows that use the correct 
naming conventions for the parameter names. Start by getting the form 
working for some fixed number of input rows, backed by indexed 
properties in your form bean. Then just modify your Javascript as 
necessary so that the dynamically generated inputs look the same as the 
ones that were served by Struts.


L.

Patil, Sheetal wrote:

U can create array and create field as per reqiuirment,but this has
limit and here problem is for "arrayindexoutofboundexception" after
limit exceeds.
Elsewise u can use ajax, put ur form in session and send requeset to an
action which will increase the size of array and again put into the
session. Then u can dynamically create as many fields u want...

-Original Message-
From: Mallik [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 14, 2006 11:40 AM

To: user@struts.apache.org
Subject: Validation framework for Dynamically added HTML elements?


Hi Friends
i have one form where user enter his family details for this i create on
row of fields (like name,relationtype,occupation) if user want to add
one more relation, he click on addmore button then i provied one more
row and user need more, click on addmore and i create another row this
way my form will get fields dynamically using javascript
createElement() method,
now i want to add validation framework for this form how to manage in
struts-config.xml ( for each form field we specify  or is there any alternative solution for this problem
in struts framework please let me know urs Mallik

--
View this message in context:
http://www.nabble.com/Validation-framework-for-Dynamically-added-HTML-el
ements--tf2269760.html#a634
Sent from the Struts - User forum at Nabble.com.


-
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 framework +dropdowns

2006-09-14 Thread Christopher Goldman
On Thu, 2006-09-14 at 16:13 +0530, Vaneet Sharma wrote:
> Hii Frns
> 
> I  have  two drop downs in my jsp page,
> 
> I want to validate second drop down only when  the value of selected item 
> of first drop down is 2.
> Can anybody tell me how to do this using validation framework.

Check this out:

http://struts.apache.org/1.2.9/userGuide/dev_validator.html#validwhen

It will let you do exactly what you're asking about.

Chris

-- 
Christopher D. Goldman
[EMAIL PROTECTED]



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



RE: Validation framework for Dynamically added HTML elements?

2006-09-14 Thread Mallik

Hi friend,
i want how to create array of elements 
please help me
urs
Mallik


Patil, Sheetal wrote:
> 
> U can create array and create field as per reqiuirment,but this has
> limit and here problem is for "arrayindexoutofboundexception" after
> limit exceeds.
> Elsewise u can use ajax, put ur form in session and send requeset to an
> action which will increase the size of array and again put into the
> session. Then u can dynamically create as many fields u want...
> 
> -Original Message-
> From: Mallik [mailto:[EMAIL PROTECTED] 
> Sent: Thursday, September 14, 2006 11:40 AM
> To: user@struts.apache.org
> Subject: Validation framework for Dynamically added HTML elements?
> 
> 
> Hi Friends
> i have one form where user enter his family details for this i create on
> row of fields (like name,relationtype,occupation) if user want to add
> one more relation, he click on addmore button then i provied one more
> row and user need more, click on addmore and i create another row this
> way my form will get fields dynamically using javascript
> createElement() method,
> now i want to add validation framework for this form how to manage in
> struts-config.xml ( for each form field we specify  name="" type=""/> or is there any alternative solution for this problem
> in struts framework please let me know urs Mallik
> 
> --
> View this message in context:
> http://www.nabble.com/Validation-framework-for-Dynamically-added-HTML-el
> ements--tf2269760.html#a634
> Sent from the Struts - User forum at Nabble.com.
> 
> 
> -
> 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]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/Validation-framework-for-Dynamically-added-HTML-elements--tf2269760.html#a6303477
Sent from the Struts - User forum at Nabble.com.


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



RE: Validation framework for Dynamically added HTML elements?

2006-09-13 Thread Patil, Sheetal
U can create array and create field as per reqiuirment,but this has
limit and here problem is for "arrayindexoutofboundexception" after
limit exceeds.
Elsewise u can use ajax, put ur form in session and send requeset to an
action which will increase the size of array and again put into the
session. Then u can dynamically create as many fields u want...

-Original Message-
From: Mallik [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 14, 2006 11:40 AM
To: user@struts.apache.org
Subject: Validation framework for Dynamically added HTML elements?


Hi Friends
i have one form where user enter his family details for this i create on
row of fields (like name,relationtype,occupation) if user want to add
one more relation, he click on addmore button then i provied one more
row and user need more, click on addmore and i create another row this
way my form will get fields dynamically using javascript
createElement() method,
now i want to add validation framework for this form how to manage in
struts-config.xml ( for each form field we specify  or is there any alternative solution for this problem
in struts framework please let me know urs Mallik

--
View this message in context:
http://www.nabble.com/Validation-framework-for-Dynamically-added-HTML-el
ements--tf2269760.html#a634
Sent from the Struts - User forum at Nabble.com.


-
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 framework problem?

2006-09-05 Thread Laurie Harper
Everything looks OK so far, based on a quick scan through. What does the 
rest of your login.jsp look like? In particular, what does your 
html:form tag look like and where is the html:javascript tag?


You specified staticJavascript="false", so where are you importing the 
static Javascript from? If you tell the tag not to generate it, you'll 
need to have something else do so.


L.

Mallik wrote:

Hi friends
--
this is my Action Login.java
package com.pack1;

import org.apache.struts.action.*;
import javax.servlet.http.*;

public class Login extends Action
{
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) throws Exception
{
return mapping.findForward("find");
}
}

-
this is my total struts-config.xml

http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd";>












		input="/pages/index.jsp" >


















 





















---
i hope this will help u in better 
waiting for solutions and thanks inadvance

Mallik


Mallik wrote:

HI Friends
i am using validation framework with struts at fontend
but the validation is not working properly
first-time validation is taking place at server side ( displaying errors
on window)
second-time onwards it is taking place at client side (getting alert)
why these all?
this is my code:
--
struts-config.xml





...
.




--
validator.xml






minlength
4



maxlength
10






minlength
4



maxlength
10




resources.properties file

#validator errors
errors.required = {0} is required.
errors.minlength = {0} cann't be less than {1} characters.
errors.maxlength = {0} cann't be more than {2} characters.
errors.invalid = {0} is invalid.

# -- Label messages --
label.userId = User ID
label.password = Password

login.jsp file



and i didn't change anything in validation-rules.xml


please let me know where i went worng

Mallik







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



RE: validation framework problem?

2006-09-05 Thread RoseIndia.net Help
HI,

Have a look at
http://www.roseindia.net/struts/struts_validator_framework.shtml

In this tutorial you will learn how to use Struts Validator Framework to
validate the user inputs on the client browser.

Regards
Deepak Kumar
http://www.roseindia.net


-Original Message-
From: Mallik [mailto:[EMAIL PROTECTED]
Sent: Tuesday, September 05, 2006 4:53 PM
To: user@struts.apache.org
Subject: Re: validation framework problem?



Hi friends
--
this is my Action Login.java
package com.pack1;

import org.apache.struts.action.*;
import javax.servlet.http.*;

public class Login extends Action
{
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) throws Exception
{
return mapping.findForward("find");
}
}

-
this is my total struts-config.xml

http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd";>




















































---
i hope this will help u in better
waiting for solutions and thanks inadvance
Mallik


Mallik wrote:
>
> HI Friends
> i am using validation framework with struts at fontend
> but the validation is not working properly
> first-time validation is taking place at server side ( displaying errors
> on window)
> second-time onwards it is taking place at client side (getting alert)
> why these all?
> this is my code:
> --
> struts-config.xml
>
>  type="org.apache.struts.validator.DynaValidatorForm">
>   
>   
> 
> ...
> .
> 
>  value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
> 
>
> --
> validator.xml
>
> 
> 
> 
> 
> 
> minlength
> 4
> 
> 
> 
> maxlength
> 10
> 
> 
> 
> 
> 
> 
> minlength
> 4
> 
> 
> 
> maxlength
> 10
> 
> 
> 
> 
> resources.properties file
>
> #validator errors
> errors.required = {0} is required.
> errors.minlength = {0} cann't be less than {1} characters.
> errors.maxlength = {0} cann't be more than {2} characters.
> errors.invalid = {0} is invalid.
>
> # -- Label messages --
> label.userId = User ID
> label.password = Password
> 
> login.jsp file
>
>  staticJavascript="false" />
>
> and i didn't change anything in validation-rules.xml
>
>
> please let me know where i went worng
>
> Mallik
>
>

--
View this message in context:
http://www.nabble.com/validation-framework-problem--tf2220180.html#a6150067
Sent from the Struts - User forum at Nabble.com.


-
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 framework problem?

2006-09-05 Thread Mallik

Hi friends
--
this is my Action Login.java
package com.pack1;

import org.apache.struts.action.*;
import javax.servlet.http.*;

public class Login extends Action
{
public ActionForward execute(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response) throws Exception
{
return mapping.findForward("find");
}
}

-
this is my total struts-config.xml

http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd";>






























   





















---
i hope this will help u in better 
waiting for solutions and thanks inadvance
Mallik


Mallik wrote:
> 
> HI Friends
> i am using validation framework with struts at fontend
> but the validation is not working properly
> first-time validation is taking place at server side ( displaying errors
> on window)
> second-time onwards it is taking place at client side (getting alert)
> why these all?
> this is my code:
> --
> struts-config.xml
> 
>  type="org.apache.struts.validator.DynaValidatorForm">
>   
>   
> 
> ...
> .
> 
>  value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
> 
> 
> --
> validator.xml
> 
> 
> 
> 
> 
> 
> minlength
> 4
> 
> 
> 
> maxlength
> 10
> 
> 
> 
> 
> 
> 
> minlength
> 4
> 
> 
> 
> maxlength
> 10
> 
> 
> 
> 
> resources.properties file
> 
> #validator errors
> errors.required = {0} is required.
> errors.minlength = {0} cann't be less than {1} characters.
> errors.maxlength = {0} cann't be more than {2} characters.
> errors.invalid = {0} is invalid.
> 
> # -- Label messages --
> label.userId = User ID
> label.password = Password
> 
> login.jsp file
> 
>  staticJavascript="false" />
> 
> and i didn't change anything in validation-rules.xml
> 
> 
> please let me know where i went worng
> 
> Mallik
> 
> 

-- 
View this message in context: 
http://www.nabble.com/validation-framework-problem--tf2220180.html#a6150067
Sent from the Struts - User forum at Nabble.com.


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



Re: validation framework problem?

2006-09-05 Thread Jorge Martín Cuervo
Hi

i used validator and i got problems with validWhen, i wrote validWhen
with caps and until i change to validwhen it didn't work properly.

Please send us the struts-config.xml or the  you use, maybe the
problem is there.


El mar, 05 de 09 de 2006 a las 13:05, Mallik escribió:

> HI Friends
> i am using validation framework with struts at fontend
> but the validation is not working properly
> first-time validation is taking place at server side ( displaying errors on
> window)
> second-time onwards it is taking place at client side (getting alert)
> why these all?
> this is my code:
> --
> struts-config.xml
> 
>  type="org.apache.struts.validator.DynaValidatorForm">
>   
>   
> 
> ...
> .
> 
>  value="/WEB-INF/validator-rules.xml,/WEB-INF/validation.xml"/>
> 
> 
> --
> validator.xml
> 
> 
> 
> 
> 
> 
> minlength
> 4
> 
> 
> 
> maxlength
> 10
> 
> 
> 
> 
> 
> 
> minlength
> 4
> 
> 
> 
> maxlength
> 10
> 
> 
> 
> 
> resources.properties file
> 
> #validator errors
> errors.required = {0} is required.
> errors.minlength = {0} cann't be less than {1} characters.
> errors.maxlength = {0} cann't be more than {2} characters.
> errors.invalid = {0} is invalid.
> 
> # -- Label messages --
> label.userId = User ID
> label.password = Password
> 
> login.jsp file
> 
>  staticJavascript="false" />
> 
> and i didn't change anything in validation-rules.xml
> 
> 
> please let me know where i went worng
> 
> Mallik

-- 
;-)

Jorge Martin Cuervo
Analista Programador

Outsourcing Emarketplace
deFacto Powered by Standards

email <[EMAIL PROTECTED]>
voz +34 985 129 820
voz +34 660 026 384



Re: Validation Framework Manual

2005-07-14 Thread James Mitchell

You can always just memorize the DTD :)

On the other hand, you could pick up a good text editor with autocompletion 
that supports DTD/XML Schema.  Even after Eclipse WTP M4 shipped, I prefer 
XML Buddy, so much so that I went ahead and purchased the Pro license a few 
months back.



--
James Mitchell
Software Engineer / Open Source Evangelist
Consulting / Mentoring / Freelance
EdgeTech, Inc.
http://www.edgetechservices.net/
678.910.8017
AIM:   jmitchtx
MSN:   [EMAIL PROTECTED]
Skype: jmitchtx

- Original Message - 
From: "Dave Newton" <[EMAIL PROTECTED]>

To: "Struts Users Mailing List" 
Sent: Thursday, July 14, 2005 8:41 PM
Subject: Re: Validation Framework Manual



Rafael Taboada wrote:


Yeah, that was the problem...
Do u know a tutorial about how to fill my validation.xml?
I want to know what i have to put in each tag.

Are the docs at http://struts.apache.org/userGuide/dev_validator.html not 
satisfactory?


Dave



-
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 Framework Manual

2005-07-14 Thread Dave Newton

Rafael Taboada wrote:


Yeah, that was the problem...
Do u know a tutorial about how to fill my validation.xml?
I want to know what i have to put in each tag.
 

Are the docs at http://struts.apache.org/userGuide/dev_validator.html 
not satisfactory?


Dave



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



Re: Validation Framework Manual

2005-07-14 Thread Rafael Taboada
Yeah, that was the problem...
 Do u know a tutorial about how to fill my validation.xml?
 I want to know what i have to put in each tag.



-- 
Rafael Taboada
Software Engineer

Cell : +511-97753290

"No creo en el destino pues no me gusta tener la idea de controlar mi vida"


Re: Validation Framework Manual

2005-07-14 Thread Wendy Smoak
From: "Rafael Taboada" <[EMAIL PROTECTED]>

> java.lang.NoClassDefFoundError: antlr/TokenStream

That just looks like you're missing antlr.jar from the classpath.  Is it in
WEB-INF/lib?

-- 
Wendy Smoak


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



RE: Validation framework

2005-07-14 Thread Nitish Kumar


With no intentions to create yet another thread of "I dont like Validator
Framework". I just wanted to know if there was any way of using validation
framework to validate collections element, without writing
bean.collection[0].property for the property, as it might not be possible to
know the size of collection (else why would I use collection? )

To make it easier, a lot of times i have a collection of textboxes to be
populated with numbers, Is there any way of validating?

overriding validate() method of ActionForm, is not an option, as I am using
BeanValidatorForm. 


Thanks and Regards, 
Nitish Kumar 




-Original Message-
From: Borislav Sabev [mailto:[EMAIL PROTECTED]
Sent: Thursday, July 14, 2005 3:34 PM
To: Struts Users Mailing List
Subject: Re: Validation framework


Rafael Taboada wrote:

>Hi folks I'm using validation framework in order to validate my fields in a

>form.
> I have three fields in a search form:
> strUsername
>strFromDate
>strToDate
> But we have the rule that the user can fill strUsername or use dates
range. 
>I mean he can search by username or he can search by dates range...
> When I use validation, it validates all the fields My question is how 
>can I set my search rule??? the user can search by username or by dates 
>range... If he choose username so validation only has to validate username 
>field... But if he choose dates range, so validation has to validate only 
>FromDate and ToDate...
> Any help would be appreciated...
> Thanks in advance.
>
>  
>
You have at least 3 choices:
1. client side validation i.e. to use javascript onSubmit to check such 
logic
2. write your own validator - see commons-validator for more info
3. validate it in the form.validate() metod
all 3 have +/- I recomend you the 3th method.

Regards
Borislav

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

2005-07-14 Thread Borislav Sabev

Rafael Taboada wrote:

Hi folks I'm using validation framework in order to validate my fields in a 
form.

I have three fields in a search form:
strUsername
strFromDate
strToDate
But we have the rule that the user can fill strUsername or use dates range. 
I mean he can search by username or he can search by dates range...
When I use validation, it validates all the fields My question is how 
can I set my search rule??? the user can search by username or by dates 
range... If he choose username so validation only has to validate username 
field... But if he choose dates range, so validation has to validate only 
FromDate and ToDate...

Any help would be appreciated...
Thanks in advance.

 


You have at least 3 choices:
1. client side validation i.e. to use javascript onSubmit to check such 
logic

2. write your own validator - see commons-validator for more info
3. validate it in the form.validate() metod
all 3 have +/- I recomend you the 3th method.

Regards
Borislav

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



Re: Validation framework

2005-07-13 Thread ichy
Hi, Rafael.
 you can find clue on the following documentation.
http://struts.apache.org/userGuide/dev_validator.html
 check validwhen.
 ichy

 2005/7/14, Rafael Taboada <[EMAIL PROTECTED]>: 
> 
> Hi folks I'm using validation framework in order to validate my fields in 
> a
> form.
> I have three fields in a search form:
> strUsername
> strFromDate
> strToDate
> But we have the rule that the user can fill strUsername or use dates 
> range.
> I mean he can search by username or he can search by dates range...
> When I use validation, it validates all the fields My question is how
> can I set my search rule??? the user can search by username or by dates
> range... If he choose username so validation only has to validate username
> field... But if he choose dates range, so validation has to validate only
> FromDate and ToDate...
> Any help would be appreciated...
> Thanks in advance.
> 
> --
> Rafael Taboada
> Software Engineer
> 
> Cell : +511-97753290
> 
> "No creo en el destino pues no me gusta tener la idea de controlar mi 
> vida"
> 
>