Re: Difference between DynaValidatorActionForm and DynaValidatorForm

2002-07-18 Thread David Winterfeldt

The key used to look up a set of validation rules is
different.

DynaValidatorForm 
--
The key passed into the validator is the action
element's 'name' attribute from the struts-config.xml
which should match the form element's name attribute
in the validation.xml.


DynaValidatorActionForm 

The key passed into the validator is the action
element's 'path' attribute from the struts-config.xml
which should match the form element's name attribute
in the validation.xml.


David

--- Hemanth Setty <[EMAIL PROTECTED]> wrote:
> Is there any difference between the two classes in
> terms of functionality?
> Why does DynaValidatorActionForm extend
> DynaValidatorForm? Am I missing
> something here??
> -h
> 
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 


__
Do You Yahoo!?
Yahoo! Autos - Get free new car price quotes
http://autos.yahoo.com

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Validator use of JavaScript

2002-07-17 Thread David Winterfeldt

It is just an option to have JavaScript validation. 
The JavaScript methods perform the same logic as the
java methods that are referenced. The server side
validation is always performed if you have everything
setup correctly and the JavaScript is just to enrich
the user's interface.

David

--- Jerry Jalenak <[EMAIL PROTECTED]> wrote:
> I've started looking at the struts-validator as a
> way to handle all of my
> basic form validation.  In looking at the
> validation.xml file in the
> struts-validator.war, it appears that JavaScript is
> required; i.e. several
> of the default validation routines use JavaScript to
> perform the actual
> validation.  How does this work is a user has
> JavaScript disabled in their
> browser?  Am I just missing something here?
> 
> Thanks!
> 
> Jerry
> 
> This transmission (and any information attached to
> it) may be confidential and is intended solely for
> the use of the individual or entity to which it is
> addressed. If you are not the intended recipient or
> the person responsible for delivering the
> transmission to the intended recipient, be advised
> that you have received this transmission in error
> and that any use, dissemination, forwarding,
> printing, or copying of this information is strictly
> prohibited. If you have received this transmission
> in error, please immediately notify LabOne at
> (800)388-4675.
> 
> 
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 


__
Do You Yahoo!?
Yahoo! Autos - Get free new car price quotes
http://autos.yahoo.com

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Validator

2002-07-11 Thread David Winterfeldt

You can go to my site to.  I have older downloads and
revision notes posted.  The version 1.0 under the
downloads (same as July 2001 release) was the last
version developed with Struts 1.0, but you can get
some later versions working with a little more effort
(getting all the extra jars).  

http://home.earthlink.net/~dwinterfeldt/


You can look at the revision info to see the changes
between the posted jars.  And all current work is in
CVS with Struts and the Commons Validator.

http://home.earthlink.net/~dwinterfeldt/revision.html

David

--- [EMAIL PROTECTED] wrote:
> It would also be great if you could read my chapter
> on 
> the Validator and provide some feedback on how
> helpful 
> it was to you. You can download the draft chapter
> from 
> here:
> 
>
http://www.theserverside.com/resources/strutsreview.jsp
> 
> The perspective from someone new to it would be very
> 
> helpful, and hopefully it would help you as well!
> 
> Chuck
> 
> > Check this out...
> > 
> > http://home.earthlink.net/~dwinterfeldt/
> > 
> > -Original Message-
> > From: Chilukuri, Pratap N Mr USAREC
> > [mailto:[EMAIL PROTECTED]] 
> > Sent: Tuesday, July 09, 2002 12:19 PM
> > To: 'Struts Users Mailing List'
> > Subject: Validator
> > 
> > 
> > Hi,
> > 
> >   we are using struts 1.02 and want to know how to
> use validator with
> > this
> > version. I went to jakarta commons site to
> download
> > commons-validator.jar
> > and jakarta-oro.jar and could not find them and do
> i need to work on 1.1
> > release for validator to work? Any inputs would be
> appreciated.
> > 
> > --
> > To unsubscribe, e-mail:
> >
> 
> > For additional commands, e-mail:
> > 
> > 
> > 
> > --
> > To unsubscribe, e-mail:  
> 
> > For additional commands, e-mail:
> 
> > 
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 


__
Do You Yahoo!?
Sign up for SBC Yahoo! Dial - First Month Free
http://sbc.yahoo.com

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Validator error

2002-07-11 Thread David Winterfeldt

I think you may have upgraded the Commons Validator
jar, but not Struts.  The SERVLET_CONTEXT_KEY was
removed from this class to try to completely separate
it from Struts and the web layer.  Try using the
Commons Validator that comes in the nightly download
for the version you are using.

David

--- "Chilukuri, Pratap N Mr USAREC"
<[EMAIL PROTECTED]> wrote:
> 
> I am getting "500 Servlet action:unable to service
> request: Servlet action
> threw the
>
exception:java.lang.NoSuchFieldError:org.apache.commons.validator.Validatior
> :field SERVLET_CONTEXT_KEY not found" if I validate
> my screen againt 2 date
> fields. 
> 
> The names match on the validation.xmlfile and the
> action form class. I have
> extended the action form class from validatorForm.
> Ichecked twice and am not
> sure what else to check. ANy ideas would be greatly
> appreciated and probably
> something stupid I must have done.
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 


__
Do You Yahoo!?
Sign up for SBC Yahoo! Dial - First Month Free
http://sbc.yahoo.com

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: 6-22-02 Validator Nightly set-property confusion

2002-06-24 Thread David Winterfeldt

It should be a comma delimitted list with the
'pathnames' property.  It was only the other way for a
few days, but unfortunately it made it into the beta.



David
--- Struts Newsgroup <[EMAIL PROTECTED]> wrote:
> Subject: 6-22-02 Validator Nightly set-property
> confusion
> From: "Matt Raible" <[EMAIL PROTECTED]>
>  ===
> I downloaded the 6.22 nightly build of Struts and
> noticed some conflicting
> statements in the Validator.
> 
> In struts-validator/WEB-INF/struts-config.xml, there
> is:
> 
>  value="/WEB-INF/validator-rules.xml,
>  
> /WEB-INF/validation.xml"/>
> 
> But in validator-rules.xml, in the comments, it
> specifies:
> 
>   
className="org.apache.struts.validator.ValidatorPlugIn">
>  value="/WEB-INF/validator-rules.xml"/>
>  value="/WEB-INF/validation.xml"/>
>   
> 
> Will both work, or is there a preferred way?
> 
> I'm trying to upgrade from Struts 1.1b1 to the
> nightly in hopes of staying
> current and avoiding these sorts of headaches later
> ;)
> 
> Matt
> 
> 
> 
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 


__
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Validator problem (or user problem... not sure which yet)

2002-06-20 Thread David Winterfeldt

The change from using multiple set-property elements
was made right after beta since it wasn't very clear
to call setPathname muliple times.  The Validator is
run through the ActionForm's validate method and
returns a standard ActionErrors object.  The
additional tags that used to come with the Validator
were for features now incorporated into Struts.

html:messages - Iterate through messages/errors.

logic:messagesPresent - check for the presence of a
message/error (can pass in an optional property to
check if there is a message/error for an individual
field)

logic:messagesNotPresent - check for the absence of a
message/error

David


--- [EMAIL PROTECTED] wrote:
> 
> the problem I was having was caused by the
> struts-config.xml file 
> defining the plug in like:
> 
> 
className="org.apache.struts.validator.ValidatorPlugIn">
> 
value="/WEB-INF/validator-rules.xml,/WEB-INF/validator.xml"/>
> 
> 
> I took a look at the struts blank war and copied
> that syntax over which 
> is like this:
> 
> 
className="org.apache.struts.validator.ValidatorPlugIn">
>  value="/WEB-INF/validator-rules.xml"/>
>  value="/WEB-INF/validator.xml"/>
> 
> 
> And it started recognizing my rules.  Now I cannot
> get it to show error 
> messages, although it does successfully redirect
> back until the 
> validation requirements are met.  Does validator
> feed the error messages 
> into the normal html:errors?  I noticed it had a
> validator taglib at one 
> point, but I am not sure where it is now that 1.1b
> incorporated alot
> 
> 
> 
> -Original Message-
> From: Chmura, William B. 
> Sent: Thursday, June 20, 2002 9:46 AM
> To: struts-user
> Subject: RE: Validator problem (or user problem...
> not sure which yet)
> 
> 
> 
> Where I have this in my validator.xml file...
> 
> ?1 This means it should give me an error if it is
> not filled in?
> ?2 Should I have to invoke something from the action
> to check it, or is 
> it just like an actionform?
> ?3 What else can I try?  Its like its all working,
> just ignoring my 
> validate.xml file or something
> 
>depends="required">
> key="registrationForm.firstname.displayname"/>
>  
> 
> -Original Message-
> From: Chmura, William B. 
> Sent: Wednesday, June 19, 2002 4:54 PM
> To: struts-user
> Subject: RE: Validator problem (or user problem...
> not sure which yet)
> 
> 
> 
> Nope...  Code runs, but it detects no errors...
> 
> AAARRGHHH
> 
> -Original Message-
> From: Raffy.Lata [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, June 19, 2002 4:29 PM
> To: struts-user
> Subject: RE: Validator problem (or user problem...
> not sure which yet)
> 
> 
> 
> Lot's of stuff in your action class, but I see that
> you defined a
> DynaValidatorForm in your  but you are
> casting it as a
> DynaActionForm in your action class...if you cast it
> correctly as a
> DynaValidatorForm and then invoke the validate()
> method (like in my
> previous email), it might correct the problem...try
> it...
> 
> 
> 
> 
> 
> [EMAIL PROTECTED] on 06/19/2002
> 01:24:28 PM
> 
> Please respond to "Struts Users Mailing List"
>   <[EMAIL PROTECTED]>
> 
> To:   [EMAIL PROTECTED]
> cc:
> Subject:  RE: Validator problem (or user problem...
> not sure which yet)
> 
> 
> 
> Here is everything:
> 
> Thanks in advance for any solutions!
> 
> 
> Struts-config.xml
> 
> 
>  Foundation//DTD
> Struts Configuration 1.1//EN"
>
"http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd";>
> 
>  property="autoCommit" value="false" /> property="description" value="MySql" /> property="driverClass"
> value="org.gjt.mm.mysql.Driver" /> property="maxCount" value="4" /> property="minCount"
> value="2" /> value="vuud"
> /> /> property="url"
> value="jdbc:mysql://localhost/plantsecurity"
> />
> 
>  type="org.apache.struts.validator.DynaValidatorForm"
> dynamic="true">
>  type="java.lang.String"
> initial="" />
>  type="java.lang.String"
> initial="" />
>  type="java.lang.String" initial="" />
>  type="java.lang.String"
> initial="" />
>  type="java.lang.String"
> initial="" />
>  type="java.lang.String" initial="" />
>  type="java.lang.String" initial="" />
>  initial="Simsbury"
> />
>  type="java.lang.String" initial="" />
>  initial="" />
> 
> 
> 
> 
> 
>  forward="plantsec.mainmenu"> path="plantsec.mainmenu" redirect="false"
> />
>  forward="plantsec.todo" />
> 
>  type="com.ebind.plantsec.create.actionCreateNew"
> name="formNewRequest"
> validate="true"
> input="plantsec.create.new"
> scope="request">
> 
>  redirect="false" />
>  redirect="false" />
> 
> 
>  type="com.ebind.plantsec.search.actionSearch" />
>  type="com.ebind.plantsec.search.actionSearch" />
>  type="com.ebind.plantsec.search.actionSearch" />
>  type="com.ebind.plantsec.search.actionSearch" />
> 
=== message truncated ===


__
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com

--
To un

RE: Validator for Struts 1.02

2002-06-20 Thread David Winterfeldt

The 7/2/2001 release is the Struts Validator 1.0
release to go with the Struts 1.0 release.  I even
have a 1.0 download which is just the 7/2/2001 release
zip renamed.  The 7/2/2001 release is very stable.  A
lot of people were using it with no bug reports for a
long time.  And even subsequent work done on it for
months was very minor until I started making the
Validator work with the Struts nightly builds.

David

--- "Jesse Alexander (KADA 11)"
<[EMAIL PROTECTED]> wrote:
> in the revision info the 7/2/2001 version is
> described as working with Struts 1.0.
> 
> It is the one that we also use with Struts 1.0.
> 
> hope this helps
> Alexander
> 
> -Original Message-
> From: Ted Bergeron [mailto:[EMAIL PROTECTED]]
> Sent: Donnerstag, 20. Juni 2002 07:29
> To: [EMAIL PROTECTED]
> Subject: Validator for Struts 1.02
> 
> 
> What version of Struts-Validator should I use with
> Struts 1.02?  I am
> working with 1.0, the 7/2001 release, but the docs
> mention:
> 
> The Struts Validator is going to be incorporated
> into Struts 1.1. I'm
> working on finalizing any design and/or feature
> issues before this
> occurs.
> Note: The version 0.5 release is the most stable
> release (using Struts
> 3/6/2001 build). 
> 
> I just want to check if the comment about stability
> is up to date, and
> on the possibly of using the latest version with a
> few tweaks.
> 
> Thanks,
> Ted
> 
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 


__
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Struts Validator and global commands

2002-06-20 Thread David Winterfeldt

If you are referring to redefining forms between
locales, you only need to override change from the
default locale (no language or country defined).  So
if the default locale has first name, last name, and
phone number and you wanted a different phone number
mask for french.  You would just have to create the
form with the same name and duplicate the phone number
field with the different mask.  

If you want to actually create shared groups of fields
for something like an adddress, you can't currently
create fields in the global section.  I want to do
that though.  So it will be something that eventually
gets done.  Then you could create a field set for
something like an address and reuse it.  But right
now, you will need to duplicate similar fields between
different form elements.  

David

--- Alok Ghosh <[EMAIL PROTECTED]> wrote:
> Hi, I am using the new version of Struts Validator
> (v1.1) to validate a
> form on one page.
> 
>  
> 
> The top of my form has common fields, ie. firstName,
> lastName, and the
> bottom of my form is dependent on a drop down box. 
> (ie, different forms
> are shown on different drop down selections. Like
> Province if Canada is
> picked, or State if USA is picked)
> 
>  
> 
> In my validation.xml file, I know I can have
> multiple versions of the
> same form in different  tags.  Ie)  
> 
> and .
> 
>  
> 
> But is there anyway I can specify a set of global
>  for the top
> common part of the form?
> 
>  
> 
> I know under  there is a 
> category used for
> variables, can I place  tags there?
> 
>  
> 
> How would I go on about doing something like this?
> 
> Please help,
> 
>  
> 
> Thank you,
> 
> Alok.
> 
> 


__
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Validator and DispatchAction

2002-06-14 Thread David Winterfeldt

I think that is good.  This along the lines of what I
was thinking.

David

--- William W <[EMAIL PROTECTED]> wrote:
> 
> My solution :
> 
> I did a class MyValidator with two methods
> (verifyMethod and 
> validateRequired)
> 
> ---
> private static boolean verifyMethod(
> Object bean,
> ValidatorAction va,
> Field field,
> ActionErrors errors,
> HttpServletRequest request) {
> 
> String methodRequest =
> request.getParameter("method");
> String methodsToValidate =
> field.getVarValue("method");
> 
> boolean validate = false;
> 
> if ((methodsToValidate != null) &&
> (methodsToValidate.length() > 0)) {
> if (methodRequest != null) {
> if (methodsToValidate != null) {
> StringTokenizer st = new
> StringTokenizer(methodsToValidate, 
> ",");
> String method = " ";
> while (st.hasMoreElements()) {
> method = (String)
> st.nextToken();
> if
> (method.equals(methodRequest)) {
> validate = true;
> break;
> }
> }
> }
> 
> }
> }
> 
> return validate;
> }
> 
> public static boolean validateRequired(
> Object bean,
> ValidatorAction va,
> Field field,
> ActionErrors errors,
> HttpServletRequest request) {
> 
>   if (verifyMethod(bean,va,field,errors,request))
>   return
>
StrutsValidator.validateRequired(bean,va,field,errors,request);
>   else
>return false;
> }
> --
> In the file validaion-rules.xml I changed the
> validator required like this:
>   classname="MyValidator"
>  method="validateRequired"
>  ...
> 
> 
> Now , I can configure in the validator.xml the
> methods that I want to 
> validate. For example :
> 
>  
>depends="required">
> key="logonForm.email.displayname"/>
>  
>   method
>  
> update,delete
> 
>  
>   
> David, What do you think about this solution ?
> 
> Thanks,
> William.
> 
> 
>
_
> MSN Photos is the easiest way to share and print
> your photos: 
> http://photos.msn.com/support/worldwide.aspx
> 
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 


__
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Validator and DispatchAction

2002-06-13 Thread David Winterfeldt

Actually, I think I take that back.  You want to
actually skip certain fields if it is an insert or a
delete.  Making a method validation that returns false
(fails) will stop all validation.  You really probably
want a dispatchMethodRequired validator and any other
ones so they skip that validation if it shouldn't be
checked.  The other Validator methods kind of work
like this with required.  Everything else depends on
required, but if you remove the dependecies all those
methods, like mask, check if the field isn't blank
before they perform the validation.  If it is blank,
mask returns true and doesn't really do anything.

David

--- William W <[EMAIL PROTECTED]> wrote:
> 
> Good  :)
> I will try !!!
> Thanks !!!!!
> WIlliam.
> 
> >From: David Winterfeldt <[EMAIL PROTECTED]>
> >Reply-To: "Struts Users Mailing List"
> <[EMAIL PROTECTED]>
> >To: Struts Users Mailing List
> <[EMAIL PROTECTED]>
> >Subject: Re: Validator and DispatchAction
> >Date: Thu, 13 Jun 2002 09:04:56 -0700 (PDT)
> >
> >You can't use booleans in the depends, but there
> can
> >be dependencies setup between validation routines.
> >You can make a method check pluggable validator and
> >have required and other validator depend on it.
> >Although the default configuration has everything
> >depend on required so if required depends on
> something
> >else, everything should work fine.  Method would be
> >checked first and then if it passes required would
> be
> >next.
> >
> > >classname="MyDispatchMethodChecker"
> >method="validateDispatchMethod"
>
>methodParams="java.lang.Object,org.apache.commons.validator.ValidatorAction,org.apache.commons.validator.Field,org.apache.struts.action.ActionErrors,javax.servlet.http.HttpServletRequest"
> >msg="errors.method"/>
> >
> > >   
> classname="org.apache.struts.util.StrutsValidator"
> >method="validateRequired"
>
>methodParams="java.lang.Object,org.apache.commons.validator.ValidatorAction,org.apache.commons.validator.Field,org.apache.struts.action.ActionErrors,javax.servlet.http.HttpServletRequest"
> >depends="method"
> >msg="errors.required"/>
> >
> >David
> >
> >--- William W <[EMAIL PROTECTED]> wrote:
> > >
> > > Is it possible ?
> > > Use boolean in the "depends" property ?
> > >
> > >  > >depends="method OR required">
> > >> > key="typeForm.password.displayname"/>
> > >   
> > >  methodName
> > >  update
> > >   
> > > 
> > >
> > >
> > > >From: "William W" <[EMAIL PROTECTED]>
> > > >Reply-To: "Struts Users Mailing List"
> > > <[EMAIL PROTECTED]>
> > > >To: [EMAIL PROTECTED]
> > > >Subject: Re: Validator and DispatchAction
> > > >Date: Thu, 13 Jun 2002 14:46:09 +
> > > >
> > > >
> > > >I think that if I use DispatchAction with
> > > ValidatorActionForm I will have
> > > >the same problem. How can I validate the form
> for
> > > diferents methods in the
> > > >same Action ? Am I wrong ?
> > > >Thanks,
> > > >William.
> > > >
> > > >
> > > >>From: David Winterfeldt
> <[EMAIL PROTECTED]>
> > > >>Reply-To: "Struts Users Mailing List"
> > > <[EMAIL PROTECTED]>
> > > >>To: Struts Users Mailing List
> > > <[EMAIL PROTECTED]>,  Rick
> > > >>Reumann <[EMAIL PROTECTED]>
> > > >>Subject: Re: Validator and DispatchAction
> > > >>Date: Wed, 12 Jun 2002 14:42:51 -0700 (PDT)
> > > >>
> > > >>You would currently have to write your own
> > > required
> > > >>validation method and have it check a variable
> > > defined
> > > >>by a field to see if it should perform the
> > > validation
> > > >>or not.  Or define a separate set of
> validation
> > > rules
> > > >>for each action and use ValidatorActionForm
> (which
> > > >>uses the action path to retrieve the
> validation
> > > >>rules).
> > > >>
> > > >>David
> > > >>
> > > >>--- Rick Reumann <[EMAIL PROTECTED]> wrote:
> > > 

RE: Struts Validator 1.1 -- Solution WIll Not WOrk

2002-06-13 Thread David Winterfeldt

Sorry, there isn't a way to change this now.  You
could file it in bugzilla as a feature request.

David

--- [EMAIL PROTECTED] wrote:
> The solution given below does not work for the case
> I described.  jsType.jsp
> defines one form with several masked field
> validations.
> 
> The example I'm having difficulty with is multiple
> forms with multiple
> fields with masked field validation which causes the
> Struts Validator to
> generate multiple versions of the function
> 
>   function mask () {}
> 
> for each of the  entries shown
> below:
> 
>   (1)  dynamicJavascript="true" staticJavascript="false"/>
> 
>   (2)  dynamicJavascript="true" staticJavascript="false"/>
> 
>   
> The first validator tag generates the following code
> (note the function
> mask() )
> 
>
>   
>   
>   
> while the second validator tag generates the
> following code (note the
> additional function mask() : NAMING CONFLICT )
> 
>
>   
>   
> 
> 
> In the static JavaScript generated by the following
> tag
> 
>   
src="../includes/staticStrutsValidatorJavascript.jsp">
> 
>   
>   staticStrutsValidatorJavascript.jsp
>   
>   <%@ page language="java" %>
>   <%-- set document type to Javascript (addresses a
> bug in
> Netscape according to a web resource --%>
>   <%@ page contentType="application/x-javascript" %>
> 
>   <%@ taglib uri="/WEB-INF/struts-validator.tld"
> prefix="validator" %>
> 
>staticJavascript="true"/>
>   -
> 
> the problem lies in the last statement shown in the
> code listing below which
> is defined in validator-rules.xml and generated by
> the static JavaScript
> 
> 
>
classname="org.apache.struts.validator.util.StrutsValidator"
>  method="validateMask"
>  depends="required"
>  msg="errors.invalid">
>  

Re: Validation with multiple string files

2002-06-13 Thread David Winterfeldt

There isn't a way currently.  Could you file a
bug/enhancement a on this in buzilla?  That way your
request won't get lost.

David

--- Alok Ghosh <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> IM Dying to find out if this is possible, and if I
> can do this.
> 
> I am running the new struts validation that uses the
> validation.xml
> file. 
> In my validation.xml file I have all my forms in
> there and the
> validation for every type of textbox of the
> different forms. 
> 
> My problem is the caption name (ie. firstName=First
> Name) for each of my
> forms are in sepearte Application.properties files. 
> But validation.xml seems to only look at the default
> Application.properties file, (the one without a
> key="x" specified in
> the struts-config.xml file. 
> 
> Is there any way I can use bundle="x" (or
> something else) to make
> validation.xml goto different
> ApplicationResources.properties files to
> find the message caption of the text box? 
> 
> Thanks a million, this is a great Validation system!
> 
> Alok, 
> (who one day dreams of seeing the text "First Name
> is Required" in an
> alert box, rather than "{space} is Requried" :)
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 


__
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Validator and DispatchAction

2002-06-13 Thread David Winterfeldt

You can't use booleans in the depends, but there can
be dependencies setup between validation routines. 
You can make a method check pluggable validator and
have required and other validator depend on it. 
Although the default configuration has everything
depend on required so if required depends on something
else, everything should work fine.  Method would be
checked first and then if it passes required would be
next.





David

--- William W <[EMAIL PROTECTED]> wrote:
> 
> Is it possible ?
> Use boolean in the "depends" property ?
> 
> depends="method OR required">
>key="typeForm.password.displayname"/>
>   
>  methodName
>  update
>   
> 
> 
> 
> >From: "William W" <[EMAIL PROTECTED]>
> >Reply-To: "Struts Users Mailing List"
> <[EMAIL PROTECTED]>
> >To: [EMAIL PROTECTED]
> >Subject: Re: Validator and DispatchAction
> >Date: Thu, 13 Jun 2002 14:46:09 +
> >
> >
> >I think that if I use DispatchAction with
> ValidatorActionForm I will have 
> >the same problem. How can I validate the form for
> diferents methods in the 
> >same Action ? Am I wrong ?
> >Thanks,
> >William.
> >
> >
> >>From: David Winterfeldt <[EMAIL PROTECTED]>
> >>Reply-To: "Struts Users Mailing List"
> <[EMAIL PROTECTED]>
> >>To: Struts Users Mailing List
> <[EMAIL PROTECTED]>,  Rick 
> >>Reumann <[EMAIL PROTECTED]>
> >>Subject: Re: Validator and DispatchAction
> >>Date: Wed, 12 Jun 2002 14:42:51 -0700 (PDT)
> >>
> >>You would currently have to write your own
> required
> >>validation method and have it check a variable
> defined
> >>by a field to see if it should perform the
> validation
> >>or not.  Or define a separate set of validation
> rules
> >>for each action and use ValidatorActionForm (which
> >>uses the action path to retrieve the validation
> >>rules).
> >>
> >>David
> >>
> >>--- Rick Reumann <[EMAIL PROTECTED]> wrote:
> >> > On Wednesday, June 12, 2002, 10:14:09 AM,
> William
> >> > wrote:
> >> >
> >> > WW> I have a UserForm, the fields are : userId
> and
> >> > userName.
> >> > WW> I have a UserAction that extends
> DispatchAction.
> >> > The UserAction have  two
> >> > WW> methods (insert and update). For the insert
> >> > method only the userName is
> >> > WW> required, and for update method the userId
> and
> >> > the userName are required.
> >> > WW> How can I can do a dependency validation
> with
> >> > the validator.xml ?
> >> >
> >> > I'm curious about this as well. There was a
> post
> >> > a few days back
> >> > dealing with the same issue. I think you
> are
> >> > able to nest
> >> > validation rules for a form but I forgot
> the
> >> > exact syntax. Maybe
> >> > someone else could shed some light again on
> how
> >> > to do this.
> >> >
> >> >
> >> > --
> >> >
> >> > Rick
> >> > mailto:[EMAIL PROTECTED]
> >> >
> >> > "If you go to a party, and you want to be the
> >> > popular one at the
> >> > party, do this: Wait until no one is looking,
> then
> >> > kick a burning log
> >> > out of the fireplace onto the carpet. Then jump
> on
> >> > top of it with your
> >> > body and yell, "Log o' fire! Log o' fire!" I've
> >> > never done this, but I
> >> > think it'd work."
> >> >   -Jack Handey
> >> >
> >> >
> >> > --
> >> > To unsubscribe, e-mail:
> >> >
> <mailto:[EMAIL PROTECTED]>
> >> > For additional commands, e-mail:
> >> > <mailto:[EMAIL PROTECTED]>
> >> >
> >>
> >>
> >>__
> >>Do You Yahoo!?
> >>LAUNCH - Your Yahoo! Music Experience
> >>http://launch.yahoo.com
> >>
> >>--
> >>To unsubscribe, e-mail:   
>
>><mailto:[EMAIL PROTECTED]>
> >>For additional commands, e-mail: 
> >><mailto:[EMAIL PROTECTED]>
> >
> >
> >
> >
>
>_
> >MSN Photos is the easiest way to share and print
> your photos: 
> >http://photos.msn.com/support/worldwide.aspx
> >
> >
> >--
> >To unsubscribe, e-mail:   
> ><mailto:[EMAIL PROTECTED]>
> >For additional commands, e-mail: 
> ><mailto:[EMAIL PROTECTED]>
> 
> 
> 
> 
>
_
> Join the world’s largest e-mail service with MSN
> Hotmail. 
> http://www.hotmail.com
> 
> 
> --
> To unsubscribe, e-mail:  
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> 


__
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com

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




Re: Indexed Property Validation on a String[]

2002-06-13 Thread David Winterfeldt

There is an example of this in the Validator example
webapp in the type.jsp page in the nightly builds
using an ArrayList, but I believe everything should
work for an array too (or you could use
java.util.Arrays to convert to a Collection if you
need to).  

web/validator/WEB-INF/validation.xml
--

   
 


web/validator/type.jsp

  
 
   
  
   
   
 


   
  
   

 

 
   
 
  


David

--- Ted Husted <[EMAIL PROTECTED]> wrote:
> If all the options are going to have the same name,
> then this should
> work 
> 
>   property="options">
>size="2"/>
>  
> 
> Since each element is a String, the tag will just
> that instead of making
> a property call.
> 
> I believe that validator may just then apply
> whatever validation you
> have set for options to every element of the array. 
> 
> In 1.1, you can use the indexed attribute to number
> the options, and be
> sure they go back to the same elements in the array
> or collection, if
> that's important. Should just be 
> 
>   property="options">
>indexed="true/>
>  
> 
> For an array, I believe that's all you might need. 
> 
> -T.
> 
> 
> [EMAIL PROTECTED] wrote:
> > 
> > Hi:
> > 
> > I have a form bean that contains an attribute
> defined as a String[].
> > 
> > public class MyFormBean
> > {
> > String[] options = new
> String[100];
> > 
> > public void setOptions(String[]
> options)
> > {
> > this.options = options;
> > }
> > 
> > public String[] getOptions()
> > {
> > return options;
> > }
> > }
> > 
> > I want to be able to display all 100 options in a
> JSP using the iterate tag.
> > Let's assume that my form bean is stored in the
> session scope under the
> > attribute named myFormBean.
> > 
> >  name="myFormBean" property="options"
> > indexId="index">
> > 
> >  name="anOption" property='?'
> > size="2"/>  
> > 
> > <% if ( (index.intValue()+1) % 10
> == 0 ) %>
> > 
> > 
> > 
> > 
> > What should be filled in for the property since
> "anOption" is a String?
> > 
> > Next, I need to set up a field validation in
> validation.xml.  From the
> > following URL,
> > 
> >
>
http://home.earthlink.net/~dwinterfeldt/revision.html
> > 
> > a suggestion is made to use the following:
> > 
> >  name="registrationForm"
> > property="listElementList" indexId="index">
> >  name="listElement"
> > property="value" cols="60" rows="8"/>
> > 
> > 
> >  > indexedProperty="listElement"
> >
> indexedListProperty="listElementList"
> > depends="required">
> >  key="registrationForm.paragraph.displayname"/>
> > 
> > 
> > So far, I have the following:
> > 
> >  > indexedProperty="anOption"
> > indexedListProperty="options"
> > depends="required">
> >  key="label.optionLabel"/>
> > 
> > 
> > What should be filled in for the property since
> "anOption" is a String?
> > 
> > Any help that anyone can provide will be greatly
> appreciated!
> > 
> > Thanks in advance.
> > 
> > Michael
> > 
> > --
> > To unsubscribe, e-mail:  
> 
> > For additional commands, e-mail:
> 
> 
> -- Ted Husted, Husted dot Com, Fairport NY US
> -- Developing Java Web Applications with Struts
> -- Tel: +1 585 737-3463
> -- Web: http://husted.com/about/services
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 


__
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: JavascriptValidatorTag and Indexed Fields

2002-06-12 Thread David Winterfeldt

No.  It's on the long to do list.

David

--- Peter Onthrops <[EMAIL PROTECTED]> wrote:
> 
> Have there been any updates to
> JavascriptValidatorTag to handle indexed fields?
> 
> Thanks,
> 
> P.
> 
> 
> 
> -
> Do You Yahoo!?
> Sign-up for Video Highlights of 2002 FIFA World Cup


__
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Struts Validator 1.1

2002-06-12 Thread David Winterfeldt

Creating a Separate Page for Static JavaScript
If you want to just generate the dynamic JavaScript on
you form page and have a separate page with the static
JavaScript to take advantage of browser caching you
can use the dynamicJavascript and staticJavascript
attributes to the JavascriptValidatorTag. You can turn
each attribute's generation of JavaScript on and off
by putting in true or false (they default to true).
Reference jsType.jsp and staticJavascript.jsp in the
main example webapp for a working example.

In your form page:



This wouldn't work right in IE 5.0 when I made the
source an attribute of the tag.

In your static JavaScript page.
<%@ page contentType="application/x-javascript" %>


http://home.earthlink.net/~dwinterfeldt/jsptags.html

There is an example of this in the example webapp.

David

--- [EMAIL PROTECTED] wrote:
> 
> Does the Struts Validator  v1.0 or v1.1 allow
> multiple page form
> validations?
> 
> I have a page with two forms, each requiring
> validation before submission.
> 
>   Form 1:  method="post"
> onsubmit="return validateForm1(this)">
>   
>   Form 2:  method="post"
> onsubmit="return validateForm2(this)" >
> 
> Both of these forms contain one field that requires
> a mask validation.
> 
> However, version 1.0 of the Struts Validator which I
> am using generates two
> JavaScript functions 
> 
>
>   
>   
> 
>
>   
>   
> 
> By defining two functions both with the same name (
> i.e. function mask ),
> the Struts Validator 1.0 prevents me from performing
> validation on multiple
> forms on the same page with the same validation
> rules (i.e. mask in this
> case).
> 
> Any suggestions or workarounds?  If v1.0 does not
> support this, does v1.1
> address this issue by generating unique function
> names per form?
> 
> Any help is greatly appreciated.
> 
> Thanks.
> 
> Michael
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 


__
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Validator and DispatchAction

2002-06-12 Thread David Winterfeldt

You would currently have to write your own required
validation method and have it check a variable defined
by a field to see if it should perform the validation
or not.  Or define a separate set of validation rules
for each action and use ValidatorActionForm (which
uses the action path to retrieve the validation
rules).

David

--- Rick Reumann <[EMAIL PROTECTED]> wrote:
> On Wednesday, June 12, 2002, 10:14:09 AM, William
> wrote:
> 
> WW> I have a UserForm, the fields are : userId and
> userName.
> WW> I have a UserAction that extends DispatchAction.
> The UserAction have  two 
> WW> methods (insert and update). For the insert
> method only the userName is 
> WW> required, and for update method the userId and
> the userName are required.
> WW> How can I can do a dependency validation with
> the validator.xml ?
> 
> I'm curious about this as well. There was a post
> a few days back
> dealing with the same issue. I think you are
> able to nest
> validation rules for a form but I forgot the
> exact syntax. Maybe
> someone else could shed some light again on how
> to do this.
> 
> 
> -- 
> 
> Rick
> mailto:[EMAIL PROTECTED]
> 
> "If you go to a party, and you want to be the
> popular one at the
> party, do this: Wait until no one is looking, then
> kick a burning log
> out of the fireplace onto the carpet. Then jump on
> top of it with your
> body and yell, "Log o' fire! Log o' fire!" I've
> never done this, but I
> think it'd work." 
>   -Jack Handey
> 
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 


__
Do You Yahoo!?
LAUNCH - Your Yahoo! Music Experience
http://launch.yahoo.com

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: R: validator generated HTML code

2002-05-28 Thread David Winterfeldt

It makes it very difficult to debug the JavaScript
when all whitespace is stripped out.  The best thing
to do if you are concerned about the extra download
size of the web page (I am assuming this is the
concern) is to make a separate page for the generic
JavaScript functions.  There is an example of this in
the Validator webapp.

Creating a Separate Page for Static JavaScript
If you want to just generate the dynamic JavaScript on
you form page and have a separate page with the static
JavaScript to take advantage of browser caching you
can use the dynamicJavascript and staticJavascript
attributes to the JavascriptValidatorTag. You can turn
each attribute's generation of JavaScript on and off
by putting in true or false (they default to true).
Reference jsType.jsp and staticJavascript.jsp in the
main example webapp for a working example.

In your form page:



In your static JavaScript page.
<%@ page contentType="application/x-javascript" %>




David

--- Adolfo Miguelez <[EMAIL PROTECTED]> wrote:
> 
> however, if, as you say, all are loaded in bundle,
> is this not overhead for 
> the web server, since HTML generated pages are much
> conger. Could not this 
> be optimized in validator framework?
> 
> Just a sugestion,
> 
> regards and thanks,
> 
> Adolfo.
> 
> >From: "Adolfo Miguelez" <[EMAIL PROTECTED]>
> >Reply-To: "Struts Users Mailing List"
> <[EMAIL PROTECTED]>
> >To: [EMAIL PROTECTED]
> >Subject: Re: R: validator generated HTML code
> >Date: Tue, 28 May 2002 14:57:16 +
> >
> >
> >cheers daniele
> >
> >>From: "daniele rizzi" <[EMAIL PROTECTED]>
> >>Reply-To: "Struts Users Mailing List"
> <[EMAIL PROTECTED]>
> >>To: "Struts Users Mailing List"
> <[EMAIL PROTECTED]>
> >>Subject: R: validator generated HTML code
> >>Date: Tue, 28 May 2002 16:38:15 +0200
> >>
> >>
> >>Hi,
> >>you're not the only one studying this stuff! As
> far as I may know
> >>(after 3 days & nigths of hard work) the answers
> are:
> >>
> >>---q1
> >>--Can I get rid of the other functions?
> >>
> >>No, they're loaded in bundle, but you can always
> get into
> >>the validator-rule.xml and remove what you don't
> like
> >>
> >>---q2
> >>--i notice that i get a lot of \n characters in
> between the lines...
> >>
> >>oh, open the file with textpad and substitute any
> \n\n with \n
> >>
> >>(maybe the writer worked on a pc, then sent the
> code to a unix box,
> >>so every \n became a \n\n)
> >>
> >>like it?
> >>bye, daniele rizzi
> >>
> >>
> >>-Messaggio originale-
> >>Da: Adolfo Miguelez [mailto:[EMAIL PROTECTED]]
> >>Inviato: martedì 28 maggio 2002 16.25
> >>A: [EMAIL PROTECTED]
> >>Oggetto: validator generated HTML code
> >>
> >>
> >>
> >>Hi All,
> >>
> >>i have been checking the validator framework and i
> have some issues for 
> >>yuo.
> >>First a, probably silly, question. I place in my
> JSP:
> >> onsubmit="return
> validateLoginForm(this);"
> >>in the  and
> >> .
> >>
> >>The result is that I am getting all the javascript
> functions present in my
> >>validator-rules.xml file in the generated HTML,
> i.e:
> >>
> >>function validateShort(form)
> >>function validateMask(form)
> >>function validateCreditCard(form)
> >>function validateEmail(form)
> >>function validateMaxLength(form)
> >>function validateDate(form)
> >>function validateFloat(form)
> >>function validateRange(form)
> >>function validateMinLength(form)
> >>function validateRequired(form)
> >>function validateInteger(form)
> >>function validateByte(form)
> >>
> >>I suppose, I should only get the necessary
> functions for my validation, in
> >>my case function validateRequired(form). What am I
> doing wrong or missing?
> >>Can I get rid of the other functions?
> >>
> >>Secondly, i notice that i get a lot of \n
> characters in between the lines 
> >>of
> >>the generated functions, i.e.:
> >>
> >>function validateRequired(form) {
> >>
> >> var bValid = true;
> >>
> >> var focusField = null;
> >>
> >> var i = 0;
> >>
> >> var fields = new Array();
> >>
> >> oRequired = new required();
> >>
> >>
> >>
> >> for (x in oRequired) {
> >>
> >> if
> ((form[oRequired[x][0]].type == 'text' ||
> >>form[oRequired[x][0]].type == 'textarea' ||
> form[oRequired[x][0]].type ==
> >>'select-one' || form[oRequired[x][0]].type ==
> 'radio' ||
> >>form[oRequired[x][0]].type == 'password') &&
> form[oRequired[x][0]].value 
> >>==
> >>'') {
> >>
> >>if (i == 0)
> >>
> >>   focusField =
> form[oRequired[x][0]];
> >>
> >>
> >>
> >>fields[i++] =
> oRequired[x][1];
> >>
> >>
> >>
> >>bValid = false;
> >>
> >> }
> >>
> >> }
> >>
> >>
> >>
> >> if (fields.length > 0) {
> >>
> >>focusField.focus();
> >>
> >>alert(fields.join('\n'));
> >>
> >> }
> >

Re: Validation Solutions

2002-04-07 Thread David Winterfeldt


--- "James A. Hillyerd" <[EMAIL PROTECTED]> wrote:
> I'm using Struts 1.0.2.  I don't want to upgrade to
> 1.1 just yet.  Can I
> use the Struts validator package with 1.0.2?  
Yes.  The 1.0 release (7/2/2001) was the last one
developed with Struts 1.0.

Archive
http://home.earthlink.net/~dwinterfeldt/archive/

>Does the validator include
> any methods for populating a business object with
> the validated (and
> converted) data?
I'm working on it for the Struts 1.1 and Commons
Validator release.  The current nightly build give
access to any transformed data in a Map, but there
isn't anything like this for older versions.

Struts Transformer by Ron Smith - Transformations are
responsible for taking an object in one form and
transforming it into another.(e.g. Date object to
String; String to Date).

http://www.rpsenterprises.com/struts/index.html

David

> 
> -james
> 
> -- 
> []  James A. Hillyerd <[EMAIL PROTECTED]> - Java
> Software Engineer
> []  PGP 1024D/D31BC40D F87B 7906 C0DA 32E8 B8F6 DE23
> FBF6 4712 D31B C40D
> 
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 


__
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Struts Validator

2002-04-07 Thread David Winterfeldt

This wasn't added until 6/17/2001.

http://home.earthlink.net/~dwinterfeldt/revision.html
Update 6/17/2001 (using Struts 1.0)
A bCancel variable was added to the
JavascriptValidatorTag code generation so the onclick
attribute of the html:cancel tag can be assigned
"bCancel=true;" so the JavaScript validation isn't
performed and the onclick attribute of a html:submit
tag can be assigned "bCancel=false;". 

David

--- taranjeet <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> 
> 
> I am using struts-validator for form validations,
> 
> it is working fine for Save submit but I dont want
> to validate form for search button , 
> 
> I tried  the switch to cancel validation it isn't
> workng
> 
>  styleClass="innoButton">
> 
> I am using
>
Struts_Validator-20010308.jar,jakarta-regexp-1.2.jar,struts20010306.jar,struts.jar
> 
> 
> Please advise
> 
> 
> 
> 


__
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: DynaValidatorActionForm/DynaValidatorAction

2002-04-04 Thread David Winterfeldt

DynaValidatorForm just extends DynaActionForm and
overrides the validate method.  From a discussion on
the dev list I was under the impression that it would
work the same, but I didn't have time to test them or
make examples.  I was rushed to get them into the
beta.  If you can't just replace DynaValidatorForm in
a working DynaActionForm, could you file a bug in
bugzilla so it doesn't get missed and definitely gets
fixed for Struts 1.1?

http://nagoya.apache.org/bugzilla/

ValidatorForm & DynaValidatorForm use
mapping.getAttribute() to retrieve the form

DynaActionForm & DynaValidatorActionForm use
mapping.getPath() to retrieve a form

David

--- Phase Web and Multimedia <[EMAIL PROTECTED]> wrote:
> Can someone please give me a snippet of code that
> uses these classes
> properly. I have found no examples. Perhaps because
> it is new, maybe. But, I
> have tried to use it like the DynaActionForm in my
> form-bean declaration and
> I have tried to cast it from the ActionForm form in
> my Action class to both
> DynaValidatorActionForm and DynaValidatorForm. On
> the first one I get a null
> pointer exception on the getProperty(...) and on the
> latter I get
> ClassCastExcpetion. I am not sure what I am doing.
> But, can someone provide
> an explanation or example. I've got a better
> understanding of the
> DynaActionForm. Now, I need some help with
> DynaValidatorActionForm and
> DynaValidatorAction. Also, why the two different
> DynaValidator classes. What
> are the differences between the two besides logging?
> 
> Brandon Goodin
> Phase Web and Multimedia
> P (406) 862-2245
> F (406) 862-0354
> [EMAIL PROTECTED]
> http://www.phase.ws
> 
> 
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 


__
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Validator within Struts 1.1

2002-04-02 Thread David Winterfeldt

Are you still using the your old validator definitions
in the validations.xml?  It would be good to switch to
using conf/share/validator-rules.xml.  You can either
cut and paste them into the top of your old file or
leave them separate and erase the old ones.  

for beta:

   


as of nightly build from a one night ago (comma
delimitted):



You would also need the Commons Validator jar when
using the new classes.  Also, are you extending
org.apache.struts.validator.ValidatorForm and not the
old one?

Also as of last night the Validator is using Jakarta
ORO instead of Jakarta Regexp.  I think it might have
broken the nightly build last night, but I'm sure it
will be fixed soon.

David

--- "Barthel Volker, HH" <[EMAIL PROTECTED]>
wrote:
> Hi David,
> 
> We tried your great validation framework with Struts
> 1.0 and it worked very
> well. Now we switched to Struts 1.1 and configured
> the necessary .xml files
> to work with the Validator-Plugin instead of the
> ValidatorServlet. Our
> application still works, but unfortunatly the
> validator mechanism does not
> work anymore. It seems, that the form is just not
> getting validated - at
> least, not correctly. I would really appreciate We
> also tried it with a
> totally new Form, which did not exist in the Struts
> 1.0 version - without
> success. 
> 
> To follow our setup, here are the major steps we
> made of using the Validator
> built in Struts1.1:
> - adding the following lines to struts-config.xml :
>   
className="org.apache.struts.validator.ValidatorPlugIn">
>  value="/WEB-INF/validation.xml"/>
>   
> - adding the validation.xml to the WEB-INF directory
> of our application,
> which contains these lines:
> 
> 
> 
>depends="required,minlength">
> key="anEntryWhichExistsInOurResourceFile"/>
> key="${var:minlength}" resource="false"/>
>   
>  minlength
>  5
>
>  
>   
>   
> 
> - extending the LogonForm-Bean from ValidatorForm
> instead in ActionForm and
> deleting the validate-Method in it
> 
> We did not change any jsp-files. The struts-config
> file already contained
> these lines:
>  type="outPackagePath.logon.LogonForm"/>
> and
>  type="ourPackagePath.logon.LogonAction"
> name="logonForm"
> scope="request"
> validate="true"
> input="/jsp/login.jsp">
>  path="/jsp/start.jsp"/>
>  path="/jsp/login.jsp"/>
> 
> 
> In the login.jsp is a html:input-field defined,
> where the properties name is
> "user".
> When we enter either nothing or strings less than 5
> characters long, the
> application forwards to "success" instead if the
> same page (now with an
> Error message) again. We have no clue what this
> could cause.
> May be you have an idea how to help us. Thanks so
> much! I hope, we do not
> bother you much with this kind of question, but we
> really would like to use
> the validator in our application.
> 
> Regards,
> Volker Barthel
> 
> Volker Barthel, FJA GmbH, ++49-40-236005-49
> Süderstraße 77, D-20097 Hamburg,
> [EMAIL PROTECTED]
> 
> 


__
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://http://taxes.yahoo.com/

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: validation plugin

2002-04-01 Thread David Winterfeldt

After the bean is populated from the request.  Then
the validate method in the ActionForm is called if
validate is set to 'true' in the Action definition in
the struts-config.xml.  Or you can call the validate
method yourself from an Action if you need to.

David

--- Vladimir Levin <[EMAIL PROTECTED]> wrote:
> I have recently downloaded struts 1.1 beta. It
> includes a sample
> application (developed by David Wintefeldt) which
> does
> form-level validation using a config file. Question:
> Does this
> validation take place before or after the controller
> servlet
> (ActionServlet) calls the setter method on the form
> bean?
> 
> Thanks for any insights,
> 
> Vlad
> 
> 
> 
> 
> 
> 
>
_
> Send and receive Hotmail on your mobile device:
> http://mobile.msn.com
> 
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 


__
Do You Yahoo!?
Yahoo! Greetings - send holiday greetings for Easter, Passover
http://greetings.yahoo.com/

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Automatic form validation

2002-03-26 Thread David Winterfeldt

You should have access to the bean if automatic
validation fails.  Are you seeing any error messages
even?  I would double check your struts-config.xml and
your html:form tags reference to the action.

David

--- [EMAIL PROTECTED] wrote:
> During automatic form validation, when errors occur,
> 
> does the framework pass an instance of the formbean
> to 
> the target of the "input" attribute?  None of the
> fields 
> are being repopulated when it goes back to the form.
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 


__
Do You Yahoo!?
Yahoo! Movies - coverage of the 74th Academy Awards®
http://movies.yahoo.com/

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: DynaValidatorActionForm

2002-03-26 Thread David Winterfeldt

I don't see anything wrong, but I wrote the javadoc so
I might be missing something.

DynaValidatorForm - uses the name of your form bean
(registrationForm) to retrieve the set of validation
rules

DynaValidatorActionForm - uses the name of your action
(/registration) to retrieve the set of validation
rules

These just give you a choice how you want to handle
storing/retrieving your validation rules.

The form element's name attribute in the
validation.xml is just a key used to store and
retrieve a set of validation rules.

David

--- See Yam Lim <[EMAIL PROTECTED]> wrote:
> The key passed into the validator is the action
> element's 'path' attribute
> from the struts-config.xml which should match the
> form element's name
> attribute in the validation.xml.
> 
> Validator validator =
> StrutsValidatorUtil.initValidator(mapping.getPath(),
>  
> this,
>  
> application,
> request,
>  
> errors,
> page);
> 
> i found the above javadoc and code that in
> DynaValidatorActionForm which i
> think it should be the action element's 'name'
> attribute from the
> struts-config.xml to form element's name attribute
> in the validation.xml.
> Can anyone confirm me on that or tell me why
> otherwise?
> 
> Thanks so much!
> 
> 
> 
> See-Yam Lim
> 
> 


__
Do You Yahoo!?
Yahoo! Movies - coverage of the 74th Academy Awards®
http://movies.yahoo.com/

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Struts Validator: Use of anchor tag

2002-03-26 Thread David Winterfeldt

My last e-mail about the issue with single quotes was
referring to the JavaScript part of the Struts
Validator.  The filter="false" is the way to go
rendering the html.

David

--- Struts Newsgroup <[EMAIL PROTECTED]> wrote:
> Subject: Re: Struts Validator: Use of anchor tag
> From: "Arthur Frankel" <[EMAIL PROTECTED]>
>  ===
> Got it:
> 
> Use filter="false" in the bean:write of the error
> 
> 
> "Arthur Frankel" <[EMAIL PROTECTED]> wrote in
> message
> news:a7d0l7$4ci$[EMAIL PROTECTED]...
> > Due to lots of fields on a form, I am trying to
> offer links within the
> error
> > messages (using Struts Validator).   I would
> assume that I can do
> something
> > like this,
> >
> > errors.date={0} is not a date
> and must be in the format
> > of {1}.
> >
> >
> > but this just dumps out the  the page.
> >
> > Any ideas?
> >
> > Arthur.
> >
> >
> 
> 
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 


__
Do You Yahoo!?
Yahoo! Movies - coverage of the 74th Academy Awards®
http://movies.yahoo.com/

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Struts Validator: Use of anchor tag

2002-03-26 Thread David Winterfeldt

I think there is an issue with using single quotes
inside error messages and variables in JavaScript.  Or
it might have been just variables.  You should
definitely be able to escape a double quote though if
you have any problems with the single quote.
-
David

--- Ted Husted <[EMAIL PROTECTED]> wrote:
> You probably need to escape the quote character,
> either by using '' or
> maybe \'
> 
> -- Ted Husted, Husted dot Com, Fairport NY US
> -- Developing Java Web Applications with Struts
> -- Tel: +1 585 737-3463
> -- Web: http://husted.com/about/services
> 
> "Struts Newsgroup (@Basebeans.com)" wrote:
> > 
> > Subject: Struts Validator: Use of anchor tag
> > From: "Arthur Frankel" <[EMAIL PROTECTED]>
> >  ===
> > Due to lots of fields on a form, I am trying to
> offer links within the error
> > messages (using Struts Validator).   I would
> assume that I can do something
> > like this,
> > 
> > errors.date={0} is not a date
> and must be in the format
> > of {1}.
> > 
> > but this just dumps out the  the page.
> > 
> > Any ideas?
> > 
> > Arthur.
> > 
> > --
> > To unsubscribe, e-mail:  
> 
> > For additional commands, e-mail:
> 
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 


__
Do You Yahoo!?
Yahoo! Movies - coverage of the 74th Academy Awards®
http://movies.yahoo.com/

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Validating an ActionForm "conditionnally"

2002-03-22 Thread David Winterfeldt

If you have a form nested like this, it probably
doesn't have the servlet reference set on it.

ServletContext application =
getServlet().getServletContext();

Otherwise what you are doing should be fine.

David

--- "Sobkowski, Andrej" <[EMAIL PROTECTED]>
wrote:
> Hello,
> 
> I've been using the Struts Validator (nightly build
> of November) with no
> problems for a few months (great work!).
> 
> Now I need to call the validation method of a
> specific "nested form" based
> on a condition:
> 
> ParentForm
> +useChild: boolean
> +getChildForm:ChildForm
> 
> If useChild returns true, I want to call the
> validate(mapping, request) of
> ChildForm (ie the nested form).
> 
> I thought that the validator only needed the
> "mapping.getAttribute()" (name
> of the ActionForm) to perform the validation so I
> tried with the following
> (ugly, I know):
> 
> if (parentForm.useChild()) {
>   ActionMapping newMap = new ActionMapping();
>   newMap.setAttribute("childForm"); 
>   ActionErrors errors =
> parentForm.getChildForm().validate(newMap,
> request);
> }
> 
> The configuration is extremely basic:
> - In struts-config.xml:
>  type="com.company.ChildForm"/>
> - In validation.xml:
>   
>   ...
>   
> 
> I'm getting a NullPointerException in the
> validator's code.
> 
> What am I doing wrong? Is this a good way to handle
> the problem (I doubt
> it...)? Any suggestions?
> 
> Thanks.
> 
> Andrej
> 


__
Do You Yahoo!?
Yahoo! Movies - coverage of the 74th Academy Awards®
http://movies.yahoo.com/

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: How can I used html:select with a Collection of String

2002-03-19 Thread David Winterfeldt

I normally use List (List myList = new ArrayList();)
or Collection.  If you are going to use Vector, at
least use it through the Collection or List interface
(List myList = new Vector();).  Although I wouldn't
use it unless you really need the synchronization.

David

--- "Cakalic, James" <[EMAIL PROTECTED]>
wrote:
> I have only the "usual" advice which is to say that
> all of Vector's methods
> are synchronized. Choosing Vector as your "standard"
> collection results in
> the overhead, whatever that is these days on your
> JVM, of synchronization
> when synchronization might be completely unnecessary
> in your case. Also,
> advice on using Collection classes is to
> "standardize" on the interfaces,
> not the implementations. 
> 
> But you probably already knew that.
> 
> Jim
> 
> > -Original Message-
> > From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, March 19, 2002 11:40 AM
> > To: Struts Users Mailing List
> > Subject: Re: How can I used html:select with a
> Collection of String
> > 
> > 
> > 
> > 
> > Hey guy's:
> >  I am a little confused from what Ted stated:
> >  "People often have trouble using Vectors with
> the Struts 
> > tags. They are
> > really designed to work best with the new
> Collection objects or with
> > simple arrays. My best advice would be to have a
> property like"
> > 
> > Object[] getCollection() {
> >   return vector.toArray()
> > }
> > 
> > I have been using application scoped Vectors that
> go directly into a
> > logic:iterate tag with no problem . The Java doc
> for the 
> > java.util Vector
> > states:
> >  "As of the Java 2 platform v1.2, this class
> has been 
> > retrofitted to
> > implement List, so that it becomes a part of
> Java's 
> > collection framework."
> > 
> > We are slowly cleaning up a JSP appwe have and for
> starters, 
> > I have been using
> > the standalone taglib where I can.  We have chosen
> the Vector 
> > as or "standard"
> > collection.
> > 
> > Is there more I should consider?
> > 
> > 
> > 
> > 
> > 
> > 
> > Ted Husted <[EMAIL PROTECTED]> on 03/19/2002
> 11:04:43 AM
> > 
> > Please respond to "Struts Users Mailing List" 
> > <[EMAIL PROTECTED]>
> > 
> > To:   Struts Users Mailing List
> <[EMAIL PROTECTED]>
> > cc:
> > 
> > Subject:  Re: How can I used html:select with a 
> Collection of String
> > 
> > 
> > "People often have trouble using Vectors with the
> Struts 
> > tags. They are
> > really designed to work best with the new
> Collection objects or with
> > simple arrays. My best advice would be to have a
> property like"
> > 
> > 
> > 
> > Object[] getCollection() {
> >   return vector.toArray()
> > }
> > 
> > But if you search the mail-archives, there have
> been several threads
> > about this.
> > 
> >
>
http://www.mail-archive.com/struts-user%40jakarta.apache.org/
> > 
> > If you come up with a good answer, I'll put in the
> newbie FAQ we're
> > constructing.
> > 
> > http://jakarta.apache.org/struts/newbie.html
> > 
> > -- Ted Husted, Husted dot Com, Fairport NY US
> > -- Developing Java Web Applications with Struts
> > -- Tel: +1 585 737-3463
> > -- Web: http://husted.com/about/services
> > 
> > 
> > "Aroui, Dr. Djelloul" wrote:
> > >
> > > myCollection is a Vector of Integer. I dont need
> property 
> > or labelProperty.
> > > How can I use the select with a Collection.
> > >
> > > 
> > > 
> > > 
> > >
> > > please any help
> > >
> > > thanks
> > >
> > > --
> > > To unsubscribe, e-mail:   
> >
> 
> > > For additional commands, e-mail: 
> > 
> > 
> > --
> > To unsubscribe, e-mail:   
> >
> 
> > For additional commands, e-mail: 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > 
> > --
> > To unsubscribe, e-mail:   
> >
> 
> > For additional commands, e-mail: 
> > 
> > 
> 


__
Do You Yahoo!?
Yahoo! Sports - live college hoops coverage
http://sports.yahoo.com/

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: turning off debug on console - Validator

2002-03-19 Thread David Winterfeldt

The jars should match the same nights nightly build. 
I just moved the Struts Validator into the core a
couple nights ago (struts-validator.jar unecessary). 
So if you are able to use the nightly binary, it will
have all the jars you need in the lib directory. 
There are some changes to configuring the Validator. 
It is using the new PlugIn interface so you don't need
the ValidatorServlet defined in the web.xml anymore. 
I need to add new documentation and some of the
package names have changed.  You can look at the
Validator webapp for an example if you decide to do
this or post questions.  

David

--- Struts Newsgroup <[EMAIL PROTECTED]> wrote:
> Subject: Re: turning off debug on console -
> Validator
> From: "Arthur Frankel" <[EMAIL PROTECTED]>
>  ===
> thanks.  This appears to work upon startup, but now
> I'm confused as to which
> .jars I really need:
> 
> struts.jar
> commons-validator.jar
> struts-validator.jar
> commons-beanutils.jar
> *.tlds?
> 
> ??? and which version of each?
> 
> Arthur.
> 
> 
> "David Winterfeldt" <[EMAIL PROTECTED]> wrote
> in message
>
news:[EMAIL PROTECTED]...
> > I think the debug level wasn't getting passed to
> every
> > class, but everything was upgraded to use Commons
> > Logging a few weeks ago which will give finer
> control
> > over logging.  So if you download a recent nightly
> > build, this should be fixed.
> >
> > David
> >
> > --- Struts Newsgroup <[EMAIL PROTECTED]> wrote:
> > > Subject: turning off debug on console -
> Validator
> > > From: "Arthur Frankel"
> <[EMAIL PROTECTED]>
> > >  ===
> > > With the struts validator I get a bunch of debug
> > > statements on startup.
> > >
> > > I have my web.xml set as such for the validator
> > > servlet
> > >
> > >   
> > >  debug
> > >  0
> > >
> > >
> > > Any ideas?
> > >
> > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> > >
> <mailto:[EMAIL PROTECTED]>
> > > For additional commands, e-mail:
> > > <mailto:[EMAIL PROTECTED]>
> > >
> >
> >
> > __
> > Do You Yahoo!?
> > Yahoo! Sports - live college hoops coverage
> > http://sports.yahoo.com/
> >
> > --
> > To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> >
> 
> 
> 
> --
> To unsubscribe, e-mail:  
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> 


__
Do You Yahoo!?
Yahoo! Sports - live college hoops coverage
http://sports.yahoo.com/

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




Re: turning off debug on console - Validator

2002-03-18 Thread David Winterfeldt

I think the debug level wasn't getting passed to every
class, but everything was upgraded to use Commons
Logging a few weeks ago which will give finer control
over logging.  So if you download a recent nightly
build, this should be fixed.

David

--- Struts Newsgroup <[EMAIL PROTECTED]> wrote:
> Subject: turning off debug on console - Validator
> From: "Arthur Frankel" <[EMAIL PROTECTED]>
>  ===
> With the struts validator I get a bunch of debug
> statements on startup.
> 
> I have my web.xml set as such for the validator
> servlet
> 
>   
>  debug
>  0
>
> 
> Any ideas?
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 


__
Do You Yahoo!?
Yahoo! Sports - live college hoops coverage
http://sports.yahoo.com/

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Validator Problem

2002-03-17 Thread David Winterfeldt

These tags were deprecated for a while and when the
Validator was repackaged under
org.apache.struts.validator they weren't moved over
since there are the equivalent tags in Struts.  So
they might not be there depending on what version of
the Validator you are using.

validator:errorsExist --> logic:messagesExist
validator:errors --> html:messages

If you download a release before the last one
(1/14/2002), the tags are still there.  
   http://home.earthlink.net/~dwinterfeldt

David

--- Barry Glasco <[EMAIL PROTECTED]> wrote:
> 
> 
> Environment: Weblogic 6.1. sp2 
> 
> Jsp tag: 
> 
> <%@ taglib uri="/WEB-INF/tlds/struts-html.tld"
> prefix="html" %> 
> <%@ taglib uri="/WEB-INF/tlds/struts-validator.tld"
> prefix="validator" %> 
>  
> 
> 
> 
>
> 
> 
>  
> 
> 
> 
> ERROR MESSAGE: 
> 
>   
> <[WebAppServletContext(6657758,veh 
> -web,/veh-web)] Root cause of ServletException 
> javax.servlet.jsp.JspException: (line 19): no
> handler for tagname='errorsExist' 
> at
>
org.apache.struts.taglib.template.InsertTag.doEndTag(InsertTag.java:1
> 
> 49) 
> at
>
jsp_servlet.__department._jspService(__department.java:274)
> 
> at
>
weblogic.servlet.jsp.JspBase.service(JspBase.java:27)
> 
> at
>
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
> 
> pl.java:265) 
> at
>
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
> 
> pl.java:304) 
> at
>
weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
> 
> pl.java:200) 
> at
>
weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
> 
> rvletContext.java:2495) 
> at
>
weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
> 
> pl.java:2204) 
> at
>
weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:139)
> 
> 
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 


__
Do You Yahoo!?
Yahoo! Sports - live college hoops coverage
http://sports.yahoo.com/

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Problem in HTML:ERROR tag

2002-03-14 Thread David Winterfeldt

I use the html:messages (in nightly builds).  It is
like html:errors except it iterates over the error
messages.  I don't think it has this problem, but I
haven't checked in the last week or two.

David

--- Matt Barnicle <[EMAIL PROTECTED]> wrote:
> It also happens in Jetty.  I had the same problem. 
> Not an issue to
> me.  Just add blank entries in your resources file,
> problem solved.
> 
> On Thu, 14 Mar 2002 [EMAIL PROTECTED] wrote:
> 
> > It's a websphere issue. Do a search on the mail
> archive for websphere and
> > null.
> > 
> > -Original Message-
> > From: Jay sissom
> [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, March 14, 2002 8:30 AM
> > To: Struts Users Mailing List
> > Subject: Re: Problem in HTML:ERROR tag
> > 
> > 
> > Struts shouldn't print NULL before and after your
> errors if you don't put 
> > errors.header and errors.footer in your
> Application Resources file, 
> > correct?
> > 
> > We all understand how it is supposed to work.  We
> don't understand why
> > "null" is printing on the page.  It didn't used to
> print.  Has the
> > behaviour of Struts changed so that errors.header
> and errors.footer is
> > required?  If so, the documentation should have
> been updated to reflect
> > that.
> > 
> > 
> > On Thu, 14 Mar 2002, keithBacon wrote:
> > 
> > > you can put HTML in your error messages 
> > > 
> > > errors.header=
> > > errors.footer=
> > > 
> > > UserValidator.userID.must.be.entered=moron!
> enter required data
> > > 
> > > I think there was talk on this list about a way
> of keeping all the html in
> > your
> > > jsp. The above way is a bit of a bodge but
> commonly used.
> > > 
> > > 
> > > --- Jay sissom <[EMAIL PROTECTED]>
> wrote:
> > > > If we do that, the errors would bring like
> this:
> > > > 
> > > > abcderror,error,errorefgh, correct?  Isn't
> that just as bad or worse
> > than 
> > > > the null problem?
> > > > 
> > > > We're having this problems with tomcat also.
> > > > 
> > > > Jay
> > > > 
> > > > On Thu, 14 Mar 2002, nsg wrote:
> > > > 
> > > > > I had met the problem.
> > > > > you append the
> "errors.head=abcd","errors.footer=efgh" two lines in
> > your
> > > > > resource file.
> > > > > it will be OK.
> > > > > 
> > > > > hope helps
> > > > > 
> > > > > Laker
> > > > > - Original Message -
> > > > > From: "subhendukumar mohanty"
> <[EMAIL PROTECTED]>
> > > > > To: <[EMAIL PROTECTED]>
> > > > > Sent: Thursday, March 14, 2002 10:07 AM
> > > > > Subject: Problem in HTML:ERROR tag
> > > > > 
> > > > > 
> > > > > Hi
> > > > > I am setting the action error in my action
> class. Then when the error
> > > > > displays in the screen it appends "null" in
> front and end of the
> > message.
> > > > > For example if the error message is "Error
> occurred", it shows as
> > "null
> > > > > Error Occurred null". I am using struts with
> visualage 4.0.
> > > > > 
> > > > > I am using struts 1.0.1 and modified the
> form tag to work for
> > websphere
> > > > test
> > > > > environment.
> > > > > 
> > > > > Any Help??
> > > > > Thanks,
> > > > > Subhendu
> > > > > 
> > > > > 
> > > > > --
> > > > > To unsubscribe, e-mail:
> > > > >
> 
> > > > > For additional commands, e-mail:
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > 
> > > > > --
> > > > > To unsubscribe, e-mail:  
> > > >
> 
> > > > > For additional commands, e-mail:
> > > > 
> > > > > 
> > > > 
> > > > 
> > > > --
> > > > To unsubscribe, e-mail:
> >
> 
> > > > For additional commands, e-mail:
> > 
> > > > 
> > > 
> > > 
> > > =
> > >
>
~~
> > > Search the archive:-
> > >
>
http://www.mail-archive.com/struts-user%40jakarta.apache.org/
> > >
>
~~
> > > Keith Bacon - Looking for struts work -
> South-East UK.
> > > phone UK 07960 011275
> > > 
> > >
> __
> > > Do You Yahoo!?
> > > Yahoo! Sports - live college hoops coverage
> > > http://sports.yahoo.com/
> > > 
> > > --
> > > To unsubscribe, e-mail:
> >
> 
> > > For additional commands, e-mail:
> > 
> > > 
> > 
> > 
> > --
> > To unsubscribe, e-mail:
> >
> 
> > For additional commands, e-mail:
> > 
> > 
> 
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 


__
Do You Yahoo!?
Yahoo! Sports - live college hoops coverage
http://sports.yahoo.com/

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Struts Validator changing the "key" in the validator.xml

2002-03-11 Thread David Winterfeldt


There are some examples here.
http://home.earthlink.net/~dwinterfeldt/overview.html#i18n

> In the Application resources properties currently I
> have "{0} is invalid"
> for my "errors.invalid" tag. What I would like to
> have is "{0} is invalid
> because {1}" but I don't know how to define the {1}
> in the validation.xml
> and validation-rules.xml.

 
   


   
  mask
  ^[a-zA-Z]*$
   
 

or you can override the default message:

 

   

   
  mask
  ^[a-zA-Z]*$
   
 

David

--- Ben Kafka <[EMAIL PROTECTED]> wrote:
> Was wondering if there is a way to access a unique
> string to display for a
> "required" error in the javascript function under
> validator-rules.xml. Right
> now the following happens:
> If in the validator.xml file I specify the  key=regform.firstname.displayname" > it is
> used by both the "required" and "mask" javascript
> functions to display a
> canned error like
> Firstname is invalid.
> Firstname required.
> 
> How can I differentiate these. For instance I would
> like to say..
> Firstname in invalid because only upper and lower
> case letters are allowed.
> 
> In the Application resources properties currently I
> have "{0} is invalid"
> for my "errors.invalid" tag. What I would like to
> have is "{0} is invalid
> because {1}" but I don't know how to define the {1}
> in the validation.xml
> and validation-rules.xml.
> 
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 


__
Do You Yahoo!?
Try FREE Yahoo! Mail - the world's greatest free email!
http://mail.yahoo.com/

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Struts Validator NoClassDefFoundError

2002-03-07 Thread David Winterfeldt

What version of the Struts Validator are you using? 
Package names were changed at some point from
com.wintecinc.struts.* to
org.apache.struts.validator.* (1/14/2002).  When this
was done, most of the validator was moved to the
Jakarta Commons Validator
(http://jakarta.apache.org/commons).  I would double
check the files/package names in the jar you have.

David

--- Craig Raw <[EMAIL PROTECTED]> wrote:
> Hi, 
> 
> I am using the Struts Validator in my webapp but
> encounter the following
> error on each page that tries to use it.
> 
> java.lang.NoClassDefFoundError:
> org/apache/struts/validator/action/ValidatorForm
>   at java.lang.ClassLoader.defineClass0(Native
> Method)
>   at
>
java.lang.ClassLoader.defineClass(ClassLoader.java:509)
> 
> 
> My WEB-INF/lib has the following jars
> commons-beanutils.jar
> commons-collections.jar
> commons-digester.jar
> jakarta-regexp-1.2.jar
> struts.jar
> struts-validator.jar
> tiles.jar
> 
> The ValidatorForm is thus clearly in the webapp
> classpath.
> I have read this may be because of the ValidatorForm
> class appearing
> twice on my system classpath, but this does not seem
> to be the case. My
> system classpath on JBoss is:
> 
> c:\Java\j2sdk1.4.0/lib/tools.jar
> run.jar
> ../lib/crimson.jar
> /C:/var/jboss/log/
> /C:/var/jboss/lib/ext/activation.jar
> /C:/var/jboss/lib/ext/castor-0.9.1.jar
> /C:/var/jboss/lib/ext/gnu-regexp-1.0.8.jar
> /C:/var/jboss/lib/ext/hsql.jar
> 
> /C:/var/jboss/lib/ext/idb.jar
> /C:/var/jboss/lib/ext/jboss-j2ee.jar
> /C:/var/jboss/lib/ext/jboss-management.jar
> /C:/var/jboss/lib/ext/jboss.jar
> /C:/var/jboss/lib/ext/jbosscx.jar
> /C:/var/jboss/lib/ext/jbossmq.jar
> /C:/var/jboss/lib/ext/jbosspool.jar
> /C:/var/jboss/lib/ext/jbosssx.jar
> /C:/var/jboss/lib/ext/jetty-service.jar
> 
> /C:/var/jboss/lib/ext/jmxtools.jar
> /C:/var/jboss/lib/ext/jndi.jar
> /C:/var/jboss/lib/ext/jnpserver.jar
> /C:/var/jboss/lib/ext/jpl-util-0_5b.jar
> /C:/var/jboss/lib/ext/log4j.jar
> /C:/var/jboss/lib/ext/mail.jar
> /C:/var/jboss/lib/ext/mysql.jar
> /C:/var/jboss/lib/ext/oswego-concurrent.jar
> /C:/var/jboss/lib/ext/ots-jts_1.0.jar
> /C:/var/jboss/lib/ext/tomcat-service.jar
> /C:/var/jboss/lib/ext/tyrex-0.9.8.5.jar
> 
> /C:/var/jboss/tmp/
> /C:/var/jboss/db/
> /C:/var/tomcat/lib/ant.jar
> /C:/var/tomcat/lib/jasper.jar
> /C:/var/tomcat/lib/servlet.jar
> /C:/var/tomcat/lib/tools.jar
> /C:/var/tomcat/lib/webserver.jar
> 
> 
> The example war that came with the Validator seems
> to work fine, so it
> must be a local issue to my deployment.
> 
> Any ideas?
> 
> Craig
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 


__
Do You Yahoo!?
Try FREE Yahoo! Mail - the world's greatest free email!
http://mail.yahoo.com/

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: indexing of errors?

2002-03-07 Thread David Winterfeldt

Your property isn't really 'blah'.  It is 'blah[0]',
'blah[1]', etc.  So if you use the full property for a
field for the ActionErrors key, then you can retrieve
it next to each field.

ActionErrors errors = new ActionErrors();
errors.add("blah[0]", new ActionError("error.msg"));

 

This type of question would be a good question to ask
on the Struts User list.  And any development
suggestions are good to post to bugzilla if there
really is a feature request you want so they don't get
lost.

David

--- "Kerstetter, Shawn" <[EMAIL PROTECTED]> wrote:
> 
> I have a form which contains 0 .. n "blah" text
> boxes all of which need to
> be validated for integer content on the server.  If
> the ith, the jth and the
> kth elements fail validation, I would like to be
> able to present the error
> message "Invalid Number Format" next to the
> appropriate "blah" text boxes.
> My custom validation component is capable of
> tracking the index, but I don't
> see support for indexing in ActionError,
> ActionErrors or in ErrorTag.  I am
> wondering how this case is normally handled in
> Struts.
> 
> Currently, if I do:
> 
>  
> 
> for each blah form element I would get the error
> message repeated for each
> failure for each element. 
> I need to be able to do something like the
> following:
> 
> 
> 
> As a real world example, consider a "view cart" page
> in a typical ecom
> application, in which a customer would set the
> quantity to zero to remove
> one or more items from the cart.  Now imagine that
> this user fat fingers the
> situation and enters something that is not a number
> in one of the quantity
> text boxes.  Finally, imagine that I wanted to
> direct the user's attention
> to the offending row of the table with a friendly
> message.
> 
> Thanks for any help,
> 
> Shawn.
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 


__
Do You Yahoo!?
Try FREE Yahoo! Mail - the world's greatest free email!
http://mail.yahoo.com/

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Logging & Log4J in 1.1

2002-03-06 Thread David Winterfeldt

Log4J recently added some new classes.  I would check
that you have a version of Log4J and Commons Logging
from the same time.  I had some trouble too until I
went and downloaded the latest version of each.

David

--- Chris Hane <[EMAIL PROTECTED]> wrote:
> 
> I'm trying to get a Struts 1.0 application running
> under the new build 1.1 
> and seem to be experiencing an issue with the new
> logging capabilities.  I 
> use Log4J in my application and there is an
> interaction between the 
> commons-logger and Log4J that is causing the
> ActionServlet to not 
> initialize in TomCat 4.0.
> 
> I can get the struts-example application to work
> just fine.  I seem to have 
> narrowed my problem to the log4j.jar file.  Anyone
> have a suggestion on how 
> to configure the setup so the Struts 1.1 (with the
> commons-logger.jar) and 
> Log4J can work together.  I've read some of the
> logger documentation and 
> have not seen a specific configuration I need to
> perform.
> 
> The error I'm getting when I try to initialize the
> ActionServlet is 
> below.  It appears to be trying to instantiate
> (newInstance) something; but 
> of what?  And how do I define or setup what it
> needs.
> 
> - Root Cause -
>
org.apache.commons.logging.LogConfigurationException:
> 
> java.lang.reflect.InvocationTargetException
>   at 
>
org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:509)
>   at 
>
org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:285)
> 
> Thanks,
> Chris
> 
> 
> 
> 
> 
> === Full Error Message ===
> 
> 2002-03-05 18:51:28 StandardWrapper[/mr:invoker]:
> Loading container servlet 
> invoker
> 2002-03-05 18:51:28 invoker: init
> 2002-03-05 18:51:28 StandardWrapper[/mr:jsp]: Using
> Jasper classloader for 
> servlet jsp
> 2002-03-05 18:51:28 jsp: init
> 2002-03-05 18:51:28 LMSControl: init
> 2002-03-05 18:51:29 StandardContext[/mr]: Servlet
> /mr threw load() exception
> javax.servlet.ServletException: Servlet.init() for
> servlet LMSControl threw 
> exception
>   at
>
org.apache.catalina.core.StandardWrapper.load(Unknown
> Source)
>   at
>
org.apache.catalina.core.StandardContext.loadOnStartup(Unknown
> Source)
>   at
>
org.apache.catalina.core.StandardContext.start(Unknown
> Source)
>   at
>
org.apache.catalina.core.ContainerBase.addChild(Unknown
> Source)
>   at
>
org.apache.catalina.core.StandardHost.addChild(Unknown
> Source)
>   at
>
org.apache.catalina.core.StandardHost.install(Unknown
> Source)
>   at
>
org.apache.catalina.startup.HostConfig.deployApps(Unknown
> Source)
>   at
> org.apache.catalina.startup.HostConfig.start(Unknown
> Source)
>   at
>
org.apache.catalina.startup.HostConfig.lifecycleEvent(Unknown
> Source)
>   at
>
org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(Unknown
> 
> Source)
>   at
> org.apache.catalina.core.ContainerBase.start(Unknown
> Source)
>   at
> org.apache.catalina.core.ContainerBase.start(Unknown
> Source)
>   at
>
org.apache.catalina.core.StandardEngine.start(Unknown
> Source)
>   at
>
org.apache.catalina.core.StandardService.start(Unknown
> Source)
>   at
>
org.apache.catalina.core.StandardServer.start(Unknown
> Source)
>   at
> org.apache.catalina.startup.Catalina.start(Unknown
> Source)
>   at
> org.apache.catalina.startup.Catalina.execute(Unknown
> Source)
>   at
> org.apache.catalina.startup.Catalina.process(Unknown
> Source)
>   at java.lang.reflect.Method.invoke(Native Method)
>   at
> org.apache.catalina.startup.Bootstrap.main(Unknown
> Source)
> - Root Cause -
>
org.apache.commons.logging.LogConfigurationException:
> 
> java.lang.reflect.InvocationTargetException
>   at 
>
org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:509)
>   at 
>
org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:285)
>   at
>
org.apache.commons.logging.LogFactory.getLog(LogFactory.java:400)
>   at
>
org.apache.commons.digester.Digester.(Digester.java:309)
>   at
>
org.apache.struts.action.ActionServlet.initServlet(ActionServlet.java:1037)
>   at
>
org.apache.struts.action.ActionServlet.init(ActionServlet.java:411)
>   at
>
javax.servlet.GenericServlet.init(GenericServlet.java:258)
>   at
>
org.apache.catalina.core.StandardWrapper.load(Unknown
> Source)
>   at
>
org.apache.catalina.core.StandardContext.loadOnStartup(Unknown
> Source)
>   at
>
org.apache.catalina.core.StandardContext.start(Unknown
> Source)
>   at
>
org.apache.catalina.core.ContainerBase.addChild(Unknown
> Source)
>   at
>
org.apache.catalina.core.StandardHost.addChild(Unknown
> Source)
>   at
>
org.apache.catalina.core.StandardHost.install(Unknown
> Source)
>   at
>
org.apache.catalina.startup.HostConfig.deployApps(Unknown
> Source)
>   at
> org.apache.catalina.startup.HostConfig.start(Unknown
> Source)
>   at
>
org.apache.

Re: Wanted : a perfect solution for CharterEncoding

2002-03-02 Thread David Winterfeldt

If you are using a servlet 2.3 compliant server like
Tomcat 4.0, you can use a filter to control this. 
Look at this example 'Example: Modifying the Request
Character Encoding' at: 

http://java.sun.com/products/servlet/Filters.html

Or you could modify the Struts source code to set your
character type on the request as it comes into the
ActionServlet if you can't use filters.  Although the
filter solution is much cleaner and separate from your
main code.

David

--- Gordon Luk <[EMAIL PROTECTED]> wrote:
> Hi all,
> 
> I got problem on charterencoding, because my program
> for chinese, so i
> have use charset=big5, but when use the actionform,
> it change back to
> iso8859. :-( then, I search for the problem/solution
> for charterencoding
> on mail-list, i got the solution, that is i write my
> own ActionServlet,
> and set encoding to "Big5"... that mean hardcode on
> my program :-(,
> anyway, it work fine.
> 
> I just wonder, any better solution for other then
> default iso8859
> encoding, that i don't need hardcode on my program?
> 
> Thanks for attention. :-)
> 
> 
> Gordon
> 
> 
>
_
> Do You Yahoo!?
> Get your free @yahoo.com address at
> http://mail.yahoo.com
> 
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 


__
Do You Yahoo!?
Yahoo! Sports - sign up for Fantasy Baseball
http://sports.yahoo.com

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Struts Validator Questions

2002-03-01 Thread David Winterfeldt

Could I see your xml for the validator definition?  Do
you have the depends in the xml validator set to
something so it is never getting to this validation? 
If you put debug code in the method, you never see it
run either?

David

--- Ben Kafka <[EMAIL PROTECTED]> wrote:
> 
> Hi,
> 
>   Was able to fix the first problem by going into
> the js and checking for
> "select-one" and value=0.
> 
>   Regarding the 2nd issue, I have specified the
> class where I put the method
> in the
> valiation-xml e.g. my
> clasname="com.mypackagename.ui.RegistrationForm" 
> and
> I have
> a method there called
> validateTwoFields(Object bean,ValidatorAction va,...
> just like yours.
> 
> The only difference is that in errors.add() I have
>
errors.add(field.getKey,StrutsValidatorUtil.getActionError(.)
> and you have
>
errors.add(field.getKey.ValidatorUtil.getActionError(.
> 
> I am compiling and running okay, but it never gets
> to this routine.
> (Thanks for your help by the way)
> 
> Ben
> 
> -Original Message-
> From: David Winterfeldt
> [mailto:[EMAIL PROTECTED]]
> Sent: Friday, March 01, 2002 11:57 AM
> To: Struts Users Mailing List
> Subject: Re: Struts Validator Questions
> 
> 
> 
> --- Ben Kafka <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> >I started using the struts validator package
> > about a week ago and have
> > the following questions:
> >
> > 1 - How do I get the validator to validate a
> > required field for a selection
> > box?
> > My selection is on an integer property. I noticed
> > in the
> > validator-rules.xml file it is checking for type
> > "select-one". What "type"
> > is a ? I tried replacing "select-one"
> > with "select" but it
> > still doesn't find it.
> The "select-one" is the correct type in Javascript
> for
> an html:select tag.  I'm not sure what is in your
> select list, but if it is an integer how can you
> check
> that it is blank (zero length string) or null?  You
> could use the range method to see if it falls in a
> range or write your own.
> 
> >
> > 2 - Cannot get the two password comparison example
> > working. I put in the
> > code specified under ~dwinterfeldt. Was wondering
> if
> > anyone has gotten this
> > working. The only difference I can see in my code
> > and the example was that I
> > am using StrutsValidatorUtil.getActionError
> instead
> > of
> > ValidatorUtil.getActionError (the latter the
> > compiler complained about no
> > such method signature). Was wondering if there was
> a
> > javascript method also
> > that could be included.
> No error messages?  Everything works on the same
> principle.  Does the validator definition in the xml
> have the same method and class defined as where the
> validation method actually is (no types)?
> 
> You can make a Javascript method to match if you
> want
> to.  You can follow one of the examples to see how
> to
> make a generic Javascript method.  You have access
> to
> the error message and the variables you've defined
> in
> the Javascript.
> 
> David
> 
> >
> >
> > --
> > To unsubscribe, e-mail:
> >
> <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> >
> 
> 
> __
> Do You Yahoo!?
> Yahoo! Greetings - Send FREE e-cards for every
> occasion!
> http://greetings.yahoo.com
> 
> --
> To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> 
> 
> --
> To unsubscribe, e-mail:  
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> 


__
Do You Yahoo!?
Yahoo! Greetings - Send FREE e-cards for every occasion!
http://greetings.yahoo.com

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




Re: Struts Validator Questions

2002-03-01 Thread David Winterfeldt


--- Ben Kafka <[EMAIL PROTECTED]> wrote:
> Hi,
> 
>I started using the struts validator package
> about a week ago and have
> the following questions:
> 
> 1 - How do I get the validator to validate a
> required field for a selection
> box?
>   My selection is on an integer property. I noticed
> in the
> validator-rules.xml file it is checking for type
> "select-one". What "type"
> is a ? I tried replacing "select-one"
> with "select" but it
> still doesn't find it.
The "select-one" is the correct type in Javascript for
an html:select tag.  I'm not sure what is in your
select list, but if it is an integer how can you check
that it is blank (zero length string) or null?  You
could use the range method to see if it falls in a
range or write your own.

> 
> 2 - Cannot get the two password comparison example
> working. I put in the
> code specified under ~dwinterfeldt. Was wondering if
> anyone has gotten this
> working. The only difference I can see in my code
> and the example was that I
> am using StrutsValidatorUtil.getActionError instead
> of
> ValidatorUtil.getActionError (the latter the
> compiler complained about no
> such method signature). Was wondering if there was a
> javascript method also
> that could be included.
No error messages?  Everything works on the same
principle.  Does the validator definition in the xml
have the same method and class defined as where the
validation method actually is (no types)?

You can make a Javascript method to match if you want
to.  You can follow one of the examples to see how to
make a generic Javascript method.  You have access to
the error message and the variables you've defined in
the Javascript.

David

> 
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 


__
Do You Yahoo!?
Yahoo! Greetings - Send FREE e-cards for every occasion!
http://greetings.yahoo.com

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Validation Error Messages and Formatting was [Memory consumption of tags]

2002-02-28 Thread David Winterfeldt


--- "Yu, Yanhui" <[EMAIL PROTECTED]> wrote:
> This is posted a couple of times, hope someone can
> help me out:
> 
> 
> > What I need to do is this:  I would like to
> display an error message to
> the
> > user in a little more customized way, such as, if
> some special characters
> > are not allowed in a field, if they entered any of
> this special character
> > set, (say @#$), I would like to display that "@#$
> is not allowed in this
> > field".  

You can do things like this in the Struts Validator
framework.  It is in the nightly source in the
contrib/validator directories and posted at
http://home.earthlink.net/~dwinterfeldt.;

This is a partial code snippet that uses a regular
expression to check if any of these characters are in
the field you are checking.  The regular expresion and
the error message are created based on the 'chars'
constant.  The double quote is escaped because this
information is stored in xml.  The '^' means all the
following are not allowed in the regular expression
(mask variable).  The 'msg name="mask"' overrides the
default error message for the mask validator.  The
'arg0 name="mask"' takes precedence over the arg0
element without a name attribute for the mask
validator.  This is a bit to get into, but it will do
what you want.

partial snippet from xml configuration file:

 
  
 
   
  
  
  
  
mask
[^${chars}]
  
   
 


ApplicationResources.properties:
my.errors.invalid={0} is not allowed in this field.


> Also I would like to change the fields
> where erroneous data exist
> > into red, possbly change the font of the erroneous
> data into a different
> > font color.  When the user correct the error,  I
> want the background of
> that
> > field to be original color and font back to
> original color too.  
You can use logic:messagesPresent in the Struts
nightly builds to control formatting.


   
   
   
  
   
   


or to check if there is an error for a specific field:


   
   
  
   
   



> I would
> > also like to focus my cursor in the first
> erroneous field, if erroneous
> data
> > exists, I would like to select that erroneous
> data.   Can I do that?  
Javascript

David

> How
> do
> > I do that?  It seems like Javascript is not
> welcomed here, so I am looking
> > for a solution in Struts.  Hopefully there is a
> nice way to do this.
> > 
> > Really appreciate all your time and help,
> 
> Yanhui
> 
> 
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 


__
Do You Yahoo!?
Yahoo! Greetings - Send FREE e-cards for every occasion!
http://greetings.yahoo.com

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Vaildation using regexp fails for large strings

2002-02-28 Thread David Winterfeldt

I've had problems with this too.  That is why I added
minlength and maxlength validation routines so regular
expression wouldn't need to be used this way.

ORO could also be used if you write your own validator
using ORO instead of Jakarta Regexp.

David

--- Dave J Dandeneau <[EMAIL PROTECTED]> wrote:
> We are experiencing a problem where the regexp
> package that the
> validator uses fails for some expressions and causes
> the system to hang.
> I am definitly not the best with regular
> expressions, but the expression
> that fails is ^.{1,30}$. It is fine until you test
> against a string
> longer then two or so characters. Is it possible to
> use ORO instead of
> the regexp package when doing validation? 
> 
> Dave
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 


__
Do You Yahoo!?
Yahoo! Greetings - Send FREE e-cards for every occasion!
http://greetings.yahoo.com

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Question on Validation

2002-02-28 Thread David Winterfeldt

This isn't an issue with validating.  This is
formatting your view based on the ActionErrors object
generated by validation.

Struts nightly builds has logic:messagesPresent and
logic:messagesNotPresent jsp tags to control
formating.

The Struts Validator before the 1/14/2002 build posted
on 
http://home.earthlink.net/~dwinterfeldt have a
validator:messagesExist jsp tag.  Below are a couple
of examples.  The 'validator:messagesExist
property="lastName"' will evaluate the its body if
there is an error for the lastName property.

Messages Exist Tag
A simple logic tag that checks for an object in the
request attribute under the default or specified
message key. If there is an object, then the body of
the tag is evaluated. 
 


   


 

 


   


 


David

--- Saeid Zoonematkermani
<[EMAIL PROTECTED]> wrote:
> Hello,
> 
> I am using struts 1.0.2 and have been looking at
> ways to do more than the 
> default validation provides. I have downloaded and
> tested "Struts 
> Validator" package but it does not seem to provide
> what we are looking for.
> 
> Here is the problem... After the user submits the
> form and it fails 
> validation, we would like to some how distinguish
> the input field in 
> question by either changing the background color of
> the cell, the font 
> color, putting an asterisk in front of it, or some
> thing of that flavor.
> 
> I can't find in the docs or the archives any mention
> of this way of 
> handling validation. So is this possible in struts
> 1.0.2? Did I miss some 
> thing in the "Struts Validator" package? Is there
> another package that 
> might provide it?
> 
> Any help, advice, and/or exmples would be greatly
> appreciated. Thanks,
> 
> - Saeid
> 
> 
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 


__
Do You Yahoo!?
Yahoo! Greetings - Send FREE e-cards for every occasion!
http://greetings.yahoo.com

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Logging in beans

2002-02-26 Thread David Winterfeldt

You could use this class.  It takes the ServletContext
as a constructor and extends PrintWriter.

org.apache.struts.util.ServletContextWriter

But I think using Commons Logging with Log4J is nicer.
 You can define that certain packages are logged to
different loggers in the Log4J configuration file. 
This example would log the package 'org.apache.struts'
to MyAppender.  You can setup as many of these as you
need.  You could have a master one and one for each
main package.  You can also control the log level for
each appender.

log4j.appender.MyAppender=org.apache.log4j.DailyRollingFileAppender
log4j.appender.MyAppender.File=../log/my.log
log4j.appender.MyAppender.DatePattern='.'-MM-dd
log4j.appender.MyAppender.layout=org.apache.log4j.PatternLayout
log4j.appender.MyAppender.layout.ConversionPattern=%d{MM/dd/
HH:mm:ss} %-5p %c - %m%n
log4j.category.org.apache.struts=DEBUG, MyAppender


David

--- Ben Liang <[EMAIL PROTECTED]> wrote:
> Can't you have a logger point to tomcat log file?
> 
> Ben
> - Original Message -
> From: "Charlie Toohey" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List"
> <[EMAIL PROTECTED]>
> Sent: Tuesday, February 26, 2002 1:18 PM
> Subject: Re: Logging in beans
> 
> 
> > Thanks for all of the responses. They've gotten
> away from my original
> > question just a bit.
> >
> > Assuming that I am using the Commons Logging
> package/Log4j in my beans,
> and I
> > want to log something to the Tomcat log file, how
> can the bean obtain the
> > output stream for the Tomcat log file in a webapp
> framework independent
> way
> > --- i.e. I don't want to pass the ActionServlet
> object to the bean and use
> > its log method, as the bean would then be tied to
> a particular web
> > application framework (in this case, Struts),
> which would inhibit its
> > reusability. Instead, I would want to pass
> something more generic,
> > java.io.OuputStream-like, to the bean, so that it
> can use whatever logging
> > package I have chosen to log to this stream. The
> question is really, how
> do I
> > obtain the java.io.OutputStream for the Tomcat log
> file in my Struts
> action
> > class so that I can pass it as a parameter to my
> bean methods.
> >
> > Charlie
> >
> >
> > On Tuesday 26 February 2002 10:04 am, you wrote:
> > > I think it is nice to use Commons Logging just
> so you
> > > have the option of easily switching to another
> logging
> > > framework.  You may want to use some other
> logging
> > > framework other than Log4J (my choice) or Jdk1.4
> at
> > > some point.  You won't have to change any of you
> code
> > > if you use Commons Logging.  Struts 1.1 is going
> to
> > > use Commons Logging.  The Struts shared source
> is
> > > using it as of last nights build.
> > >
> > > David
> > >
> > > --- keithBacon <[EMAIL PROTECTED]>
> wrote:
> > > > Does anybody know how the new Java 1.4 logging
> API
> > > > affects things?
> > > > My guess is it increases the desirability of
> using
> > > > the
> > > > jakarta Commons Logging Package. You can use
> log4j
> > > > for now & easily switch
> > > > later.
> > > > But for students or people that can gurantee
> they
> > > > will deploy on Java 1.4
> > > > shouldn't they just use the JDK logging API
> > > > directly?
> > > > But then surely the next release of struts
> will use
> > > > the Commons logging so we
> > > > should too? Oh boy.
> > > >
> > > >
> > > > --- David Winterfeldt <[EMAIL PROTECTED]>
> > > >
> > > > wrote:
> > > > > I would suggest using the Commons Logging
> Package
> > > > >
> (http://jakarta.apache.org/commons/logging.html).
> > > > > This is a generic interface to logging
> packages.
> > > >
> > > > If
> > > >
> > > > > Log4J is detected, it will use it.
> > > > >
> > > > > excerpt from the website:
> > > > > "The Logging package is an ultra-thin bridge
> > > >
> > > > between
> > > >
> > > > > different logging libraries. Commons
> components
> > > >
> > > > may
> > > >
> > > > > use the Logging API to remove compile-time
> and
> > > > > run-time dependencies on an

RE: Logging in beans

2002-02-26 Thread David Winterfeldt

I think it is nice to use Commons Logging just so you
have the option of easily switching to another logging
framework.  You may want to use some other logging
framework other than Log4J (my choice) or Jdk1.4 at
some point.  You won't have to change any of you code
if you use Commons Logging.  Struts 1.1 is going to
use Commons Logging.  The Struts shared source is
using it as of last nights build.  

David

--- keithBacon <[EMAIL PROTECTED]> wrote:
> Does anybody know how the new Java 1.4 logging API
> affects things?
> My guess is it increases the desirability of using
> the 
> jakarta Commons Logging Package. You can use log4j
> for now & easily switch
> later.
> But for students or people that can gurantee they
> will deploy on Java 1.4
> shouldn't they just use the JDK logging API
> directly?
> But then surely the next release of struts will use
> the Commons logging so we
> should too? Oh boy.
> 
> 
> --- David Winterfeldt <[EMAIL PROTECTED]>
> wrote:
> > I would suggest using the Commons Logging Package
> > (http://jakarta.apache.org/commons/logging.html). 
> > This is a generic interface to logging packages. 
> If
> > Log4J is detected, it will use it.  
> > 
> > excerpt from the website:
> > "The Logging package is an ultra-thin bridge
> between
> > different logging libraries. Commons components
> may
> > use the Logging API to remove compile-time and
> > run-time dependencies on any particular logging
> > package, and contributors may write Log
> > implementations for the library of their choice."
> > 
> > 
> > David
> > 
> > --- Phase Web and Multimedia <[EMAIL PROTECTED]>
> wrote:
> > > log4j would work well. Schedule away a day or so
> to
> > > become familiar with it
> > > and download the 1.2b3 version. This will insure
> > > that you are prepared for
> > > the future changes in log4j and will keep you
> from
> > > programming with
> > > deprecated code.
> > > 
> > > http://jakarta.apache.org/log4j/
> > > 
> > > Brandon Goodin
> > > Phase Web and Multimedia
> > > P (406) 862-2245
> > > F (406) 862-0354
> > > [EMAIL PROTECTED]
> > > http://www.phase.ws
> > > 
> > > 
> > > -Original Message-
> > > From: Charlie Toohey
> [mailto:[EMAIL PROTECTED]]
> > > Sent: Monday, February 25, 2002 7:28 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: Logging in beans
> > > 
> > > 
> > > I would like to log some information in the
> Tomcat
> > > log file from my beans.
> > > But I don't want to use the ActionServlet log
> > > method, as passing an
> > > ActionServlet object as a parameter to a bean
> would
> > > violate the bean
> > > philosophy that beans should be completely
> > > independent of a web application
> > > framework, such as Struts, for reusability. How
> > > could I just pass in the
> > > Stream to the Tomcat log file to a bean so that
> it
> > > can log to the Stream and
> > > maintain its web app framework independence ?
> > > 
> > > Thanks,
> > > Charlie
> > > 
> > > --
> > > To unsubscribe, e-mail:
> > >
> <mailto:[EMAIL PROTECTED]>
> > > For additional commands, e-mail:
> > > <mailto:[EMAIL PROTECTED]>
> > > 
> > > 
> > > 
> > > --
> > > To unsubscribe, e-mail:  
> > >
> <mailto:[EMAIL PROTECTED]>
> > > For additional commands, e-mail:
> > > <mailto:[EMAIL PROTECTED]>
> > > 
> > 
> > 
> > __
> > Do You Yahoo!?
> > Yahoo! Sports - Coverage of the 2002 Olympic Games
> > http://sports.yahoo.com
> > 
> > --
> > To unsubscribe, e-mail:  
> <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> > 
> 
> 
> =
>
~~
> Search the archive:-
>
http://www.mail-archive.com/struts-user%40jakarta.apache.org/
>
~~
> Keith Bacon - Looking for struts work - South-East
> UK.
> phone UK 07960 011275
> 
> __
> Do You Yahoo!?
> Yahoo! Sports - Coverage of the 2002 Olympic Games
> http://sports.yahoo.com
> 
> --
> To unsubscribe, e-mail:  
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> 


__
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com

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




RE: Logging in beans

2002-02-26 Thread David Winterfeldt

I would suggest using the Commons Logging Package
(http://jakarta.apache.org/commons/logging.html). 
This is a generic interface to logging packages.  If
Log4J is detected, it will use it.  

excerpt from the website:
"The Logging package is an ultra-thin bridge between
different logging libraries. Commons components may
use the Logging API to remove compile-time and
run-time dependencies on any particular logging
package, and contributors may write Log
implementations for the library of their choice."


David

--- Phase Web and Multimedia <[EMAIL PROTECTED]> wrote:
> log4j would work well. Schedule away a day or so to
> become familiar with it
> and download the 1.2b3 version. This will insure
> that you are prepared for
> the future changes in log4j and will keep you from
> programming with
> deprecated code.
> 
> http://jakarta.apache.org/log4j/
> 
> Brandon Goodin
> Phase Web and Multimedia
> P (406) 862-2245
> F (406) 862-0354
> [EMAIL PROTECTED]
> http://www.phase.ws
> 
> 
> -Original Message-
> From: Charlie Toohey [mailto:[EMAIL PROTECTED]]
> Sent: Monday, February 25, 2002 7:28 PM
> To: [EMAIL PROTECTED]
> Subject: Logging in beans
> 
> 
> I would like to log some information in the Tomcat
> log file from my beans.
> But I don't want to use the ActionServlet log
> method, as passing an
> ActionServlet object as a parameter to a bean would
> violate the bean
> philosophy that beans should be completely
> independent of a web application
> framework, such as Struts, for reusability. How
> could I just pass in the
> Stream to the Tomcat log file to a bean so that it
> can log to the Stream and
> maintain its web app framework independence ?
> 
> Thanks,
> Charlie
> 
> --
> To unsubscribe, e-mail:
> 
> For additional commands, e-mail:
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 


__
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Struts Validator help

2002-02-25 Thread David Winterfeldt

It is keyed on the property, not the message resource
key.  So it would be the same as the property for you
html:text tag.



This would represent getEmail/setEmail.

David

--- [EMAIL PROTECTED] wrote:
> Hi,
> 
> I'm new to Struts and Struts Validator.  I have been
> able to setup struts and the validator package to
> work properly on my machine.  I'm having trouble
> however with getting and displaying the error
> message properly.  I can display them at the top of
> the page using  tag but I would like
> to be able to place the errors individually at
> different places in the page.  I tried  
>  property="registrationForm.email.displayname" /> but
> this doesn't seem to be working.  The line in the
> resource file is:
> "registrationForm.email.displayname=E-mail".  I
> think the key is not in the collection of errors. 
> Is there a way to see what keys are available in
> that collection.   I do not have specific
> error.propname=... entry in the resource file.  Is
> that needed?
> 
> Thank you.
> 
> Bill
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 


__
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: commons valiador

2002-02-15 Thread David Winterfeldt

The Struts Validator is in the contrib/validator
directory.

contrib/validator/src/share/org/apache/struts/validator/action/ValidatorForm.java

A binary version is available on my website and is in
the dist directory of the download
(dist/struts-validator.jar).

http://home.earthlink.net/~dwinterfeldt/

The Commons Validator just has the basic validation
framework for validating a java bean.  All Struts
specific things are still in the Struts Validator
project (contrib/validator).

David


--- [EMAIL PROTECTED] wrote:
> Hi David, thanks for replying... I had a look at
> your example and in
> particular the form beans. I notice your forms
> extend ValidatorForm, which
> in turn extends ActionForm, but in the nightly
> builds of Validator there is
> no class for ValidatorForm! I notice several other
> changes since earlier
> versions. Am I wrong here? Maybe I have
> misunderstood something?
> 
> Thanks again
> 
> Neil
> 
> > There is an example in the nightly source in
> > contrib/validator (contrib/validator/src/example
> and
> > contrib/validator/web/example).  It is also posted
> at
> > http://home.earthlink.net/~dwinterfeldt/ and there
> is
> > a compiled jar of the Commons Validator in the
> build
> > directory (no nightly build of it yet).
> >
> > David
> >
> > --- [EMAIL PROTECTED] wrote:
> >> Hi I decided to try one of the recent nightly
> builds
> >> of struts since I
> >> wanted to become familiar with the commons
> >> validator. I am having some
> >> problems understanding what changes are needed
> (if
> >> any) in my source code
> >> for my formbeans etc.
> >> Is there an example app which uses the commons
> >> validator? I would like to
> >> study some working example.
> >>
> >> Thanks
> >>
> >> Neil
> >>
> >>
> >>
> >> --
> >> To unsubscribe, e-mail:
> >>
> 
> >> For additional commands, e-mail:
> >> 
> >>
> >
> >
> > __
> > Do You Yahoo!?
> > Send FREE Valentine eCards with Yahoo! Greetings!
> > http://greetings.yahoo.com
> >
> > --
> > To unsubscribe, e-mail:
> >
> 
> For additional
> > commands, e-mail:
> 
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 


__
Do You Yahoo!?
Got something to say? Say it better with Yahoo! Video Mail 
http://mail.yahoo.com

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Order Validation Errors

2002-02-15 Thread David Winterfeldt

In the nightly builds the order is maintained in
ActionErrors.

David

--- Adam Hardy <[EMAIL PROTECTED]> wrote:
> I was just looking in the ActionErrors class myself
> and the ActionError objects are held in a hashtable,
> which I think has no defined ordering system. 
> 
> The messages which go into the ActionError though
> can have up to five substitution snippets, so you
> could put all your validation messages in order into
> one blank message with five substitutions:
> 
> in your ApplicationResources.properties:
> 
> error.blank.5bits={0}{1}{2}{3}{4}
> 
> in your validation code:
> 
> errors.add(ActionErrors.GLOBAL_ERROR,
>new
> ActionError("error.blank.5bits",
>"error1",
> "error2", etc...));
> 
> 
> Actually it might only be four that it can handle,
> not 5.
> 
> Regards
> Adam
> 
> On Fri, 15 February 2002, Satish Jeejula wrote:
> 
> > 
> > Hello All,
> > 
> > In a jsp page which had form with this order or
> elements.
> > 
> > 1) Element A (required)
> > 2) Element B (required)
> > 3) Element C (not Required).
> >   some more elements
> > 
> > I submit the form with entering any data for the
> required fields.
> > 
> > In my validation method of the form, I check for
> required fields in the same
> > order as they are in the form and add them to
> Action Error class in that
> > order. But when the errors are displayed back, the
> order of errors is not in
> > the order in which I add them.
> > 
> > I would like to know in what order the errors are
> sorted and displayed?
> > 
> > thanks,
> > Satish
> > 
> > 
> > 
> > --
> > To unsubscribe, e-mail:  
> 
> > For additional commands, e-mail:
> 
> 
> 
> Find the best deals on the web at AltaVista
> Shopping!
> http://www.shopping.altavista.com
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 


__
Do You Yahoo!?
Got something to say? Say it better with Yahoo! Video Mail 
http://mail.yahoo.com

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: commons valiador

2002-02-14 Thread David Winterfeldt

There is an example in the nightly source in
contrib/validator (contrib/validator/src/example and
contrib/validator/web/example).  It is also posted at 
http://home.earthlink.net/~dwinterfeldt/ and there is
a compiled jar of the Commons Validator in the build
directory (no nightly build of it yet).

David

--- [EMAIL PROTECTED] wrote:
> Hi I decided to try one of the recent nightly builds
> of struts since I
> wanted to become familiar with the commons
> validator. I am having some
> problems understanding what changes are needed (if
> any) in my source code
> for my formbeans etc.
> Is there an example app which uses the commons
> validator? I would like to
> study some working example.
> 
> Thanks
> 
> Neil
> 
> 
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 


__
Do You Yahoo!?
Send FREE Valentine eCards with Yahoo! Greetings!
http://greetings.yahoo.com

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Validation Question?

2002-01-20 Thread David Winterfeldt

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

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

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

David

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


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

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Why ActionMessages not part of Struts 1.0.1?

2002-01-17 Thread David Winterfeldt

Only bug fixes have gone into Struts 1.0.1.  Adding
the ActionMessages would be a feature.  Plans are in
the works for having a Struts 1.1 release which would
be based off the nightly builds (no date set yet, but
should happen relatively soon).

David

--- Alex Colic <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> I have been using the ActionMessages class for a
> while. For the last 6?
> months they have been part of  the nightly build. I
> just downloaded the
> latest version of Struts and none of my code
> compiled. It looks like
> ActionMessages is still in the nightly code?
> 
> Why? It's pretty stable. Never had a problem with
> it.
> 
> Alex
> 
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 


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

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Where is the messages tag...

2002-01-14 Thread David Winterfeldt

The html:messages tag is in the nightly builds (not
v1.0).  It is very similiar to ActionErrors, but can
be used for general messages.

ActionMessages messages = new ActionMessages();
messages.add(ActionMessages.GLOBAL_MESSAGE, new
ActionMessage("userForm.insert", info.getUserName()));
messages.add("activationDate", new
ActionMessage("userForm.active",
info.getSubscriptionLength()));


  
 
  


By default the tag will retrieve the request scope
bean it will iterate over from the Action.ERROR_KEY
constant string, but if this attribute is set to
'true' the request scope bean will be retrieved from
the Action.MESSAGE_KEY constant string. Also if this
is set to 'true', any value assigned to the name
attribute will be ignored. 

David

--- Alex Paransky
<[EMAIL PROTECTED]> wrote:
> I know about the message (singular) tag, but there
> is also a messages
> (plural) tag mentioned in the documentation:
> 
>
http://jakarta.apache.org/struts/struts-html.html#messages
> 
> ???
> -AP_
> 
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]
> Sent: Monday, January 14, 2002 1:50 PM
> To: Struts Users Mailing List
> Subject: Re: Where is the messages tag...
> 
> 
> 
> Here is an example of the message tag in use for a
> page title - the keyt
> points to a resource bundle key.
> 
> <%@ page language="java" %>
> <%@ taglib uri="/WEB-INF/struts-bean.tld"
> prefix="bean" %>
> <%@ taglib uri="/WEB-INF/struts-html.tld"
> prefix="html" %>
> <%@ taglib uri="/WEB-INF/struts-logic.tld"
> prefix="logic" %>
> 
> 
> 
> 
> 
> 
> 
> - Cody
> 
> 
> 
> 
> 
> 
> 
> Alex Paransky <[EMAIL PROTECTED]>
> on 01/14/2002 03:43:24
> PM
> 
> Please respond to Struts Users Mailing List
>   <[EMAIL PROTECTED]>
> To:   Struts Users Mailing List
> <[EMAIL PROTECTED]>
> cc:
> Subject:  Where is the messages tag...
> 
> 
> I am just starting with STRUTS and have a basic
> question...
> 
> I looked at the struts documentation, and it
> mentions that there should be
> a
> messages (not message) tag.  I only was able to find
> errors tag.  I want to
> show a message to the user, which is not an error. 
> Should I still be using
> the errors tag?
> 
> Thanks.
> -AP_
> 
> 
> --
> To unsubscribe, e-mail:   <
> mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <
> mailto:[EMAIL PROTECTED]>
> 
> 
> 
> 
>

> The information transmitted is intended only for the
> person or entity to
> which it is addressed and may contain confidential
> and/or privileged
> material.  Any review, retransmission, dissemination
> or other use of, or
> taking of any action in reliance upon, this
> information by persons or
> entities other than the intended recipient is
> prohibited.   If you received
> this in error, please contact the sender and delete
> the material from any
> computer.
> 
> 
> --
> To unsubscribe, e-mail:
> 
> For additional commands, e-mail:
> 
> 
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 


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

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Returns from erroneous validation without aditional information

2002-01-13 Thread David Winterfeldt

When I want to do something like this, I set
validation="false" in the struts-config.xml for the
action.  Then I can call validate on the ActionForm
when appropriate.  Or you can have two actions.  One
to prepopulate fields (with validation="false") and
one with validation="true".

David

--- João_Guilherme_Del_Valle <[EMAIL PROTECTED]>
wrote:
> Hi,
> 
> Struts´ automatic validation seems to be very
> useful, centralizing
> validation logic. But I have a problem. My page has
> some aditional
> information in it, example: I´m updating a book, the
> page has all those
> fields about book name, ISBN and so. But I have some
> information about book
> volumes, that I set as attributes on the request
> when forwarding to the JSP.
> But when something goes wrong with the validation,
> control flow does not
> pass throught the Action class, so I can´t populate
> the request with the
> volume data.
> 
> A solution would be populate the request int the
> validate method, but
> definitively this does not seem to be a interesting
> approach.
> 
> Any other idea?
> 
> João.
> 
> 
> Joao Guilherme Del Valle
> [EMAIL PROTECTED]
> Visionnaire Informática SA
> http://www.visionnaire.com.br
> Tel/Fax: +55 41 373-7400 r: 217
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 


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

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: MessagesPresent tag

2002-01-13 Thread David Winterfeldt

It's in the nightly builds.  Are you using a nightly
build (last few months) or Struts v1.0?

David

--- "Pedone, Tim" <[EMAIL PROTECTED]> wrote:
> I noticed a tag called "messagesPresent" in the
> logic tag docs
>
http://jakarta.apache.org/struts/struts-logic.html#messagesPresent
> but got a
> "Can't find tag lib" error.  Is this a future
> feature? 
> 
> I'm trying to use it to detect if there is an
> ActionError of a particular
> kind.  I've got a form with personal info on it and
> if the user forgets a
> field, I want to detect that particular error and
> render the field label in
> red.  I figured that I'd just look for the
>  error that my
> ActionForm created.
> 
> Thanks,
> 
> Tim Pedone
> 


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

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Struts-Validator ActionForm error

2002-01-10 Thread David Winterfeldt

The Validator jar is in the WEB-INF/lib with the
Struts jar?  And neither is in the classpath?

David

--- Patrick Liardet <[EMAIL PROTECTED]>
wrote:
> Thanks Michelle
> 
> Unfortunately this doesn't seem to be the problem
> (although I'm told the
> classpath issue you mention can be a source of
> problems for new struts
> users).
> 
> Struts framework builds and runs fine. I have the
> struts-jar on my webapps's
> classpath as stated below. It's not on my container
> classpath, otherwise I'd
> be getting other problems unrelated to the wintecinc
> validator problem.
> 
> I am using the latest October release of Validator
> against the 1.0 Struts
> release. I'll try the July 2 build instead. It says
> here
> 
> http://home.earthlink.net/~dwinterfeldt/
> 
> that this could be the correct version.
> 
> Thanks
> 
> Patrick
> 
> > -Original Message-
> > From:   Michelle Popovits
> [SMTP:[EMAIL PROTECTED]]
> > Sent:   08 January 2002 20:47
> > To: 'Struts Users Mailing List'
> > Subject:RE: Struts-Validator ActionForm error
> > 
> > remove struts-jar from classpath and add to
> web-inf/lib directory.
> > Check to make sure the jar is no where in the
> web/app server class path.
> > 
> > -Original Message-
> > From: Patrick Liardet
> [mailto:[EMAIL PROTECTED]]
> > Sent: Tuesday, January 08, 2002 3:32 PM
> > To: Struts Users Mailing List
> > Subject: Struts-Validator ActionForm error
> > 
> > 
> > Hi All
> > 
> > I'm using the com.wintecinc.struts validator
> library.
> > 
> > When I subclass my formbean from an ActionForm, it
> runs Ok, but doesn't
> > validate.
> > 
> > When I subclass my formbean from a
> > com.wintecinc.struts.action.ValidatorForm
> > as suggested, I receive the following runtime
> error:
> > 
> > java.lang.NoClassDefFoundError:
> org/apache/struts/action/ActionForm
> > 
> > 
> > This seems odd. I certainly have the struts.jar in
> my webapp's classpath
> > as
> > standard struts functionality is available.
> > 
> > Any ideas ?
> > 
> > Patrick
> >
>
==
> > =
> > The information in this E-mail (which includes any
> files transmitted with
> > it), is confidential and may also be legally
> privileged. It is intended
> > for
> > the addressee only. Access to this E-mail by
> anyone else is unauthorised.
> > If
> > you have received it in error, please destroy any
> copies and delete it
> > from
> > your system notifying the sender immediately. Any
> use, dissemination,
> > forwarding, printing or copying of this E-mail is
> prohibited. E-mail
> > communications are not secure and therefore Rolfe
> & Nolan does not accept
> > legal responsibility for the contents of this
> message. Any views or
> > opinions
> > presented are solely those of the author and do
> not necessarily represent
> > those of Rolfe & Nolan.
> >
>
==
> > =
> > 
> > --
> > To unsubscribe, e-mail:
> >
> 
> > For additional commands, e-mail:
> > 
> > 
> > --
> > To unsubscribe, e-mail:
> >
> 
> > For additional commands, e-mail:
> > 
>
===
> The information in this E-mail (which includes any
> files transmitted with
> it), is confidential and may also be legally
> privileged. It is intended for
> the addressee only. Access to this E-mail by anyone
> else is unauthorised. If
> you have received it in error, please destroy any
> copies and delete it from
> your system notifying the sender immediately. Any
> use, dissemination,
> forwarding, printing or copying of this E-mail is
> prohibited. E-mail
> communications are not secure and therefore Rolfe &
> Nolan does not accept
> legal responsibility for the contents of this
> message. Any views or opinions
> presented are solely those of the author and do not
> necessarily represent
> those of Rolfe & Nolan.
>
===
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 


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

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: changing default text.

2002-01-09 Thread David Winterfeldt

If you are using the nightly builds, there are
html:messages, logic:messagesPresent, and
logic:messageNotPresent to help with formatting and
display of messages.  The html:messages tag is like
html:error, but it iterates through the errors
instead.  Specifying a header and/or footer by passing
in the message resource key is optional.



   



   


David

--- "João Paulo G. Batistella" <[EMAIL PROTECTED]>
wrote:
> This message only tell you that you had an error.
> You can use your own messages with ActionError
> class. See in the example that came with  Struts.
> 
> JP
> 
> Robert Tyler Retzlaff wrote:
> 
> > Ah yes your right it's in
> ApplicationResource.properties however if I change
> > it there it will change it for all occurences,
> sometimes I'd like to have
> > it say one thing and another time something else
> is this possible?
> >
> > Thanks again
> >
> > rob
> >
> > >
> > > I don't remeber wich option but try to
> find(grep?) the string "Validation Error" in a
> > > properties(*.properties) file.
> > >
> > > []'s
> > > JP
> > >
> > > Robert Tyler Retzlaff wrote:
> > >
> > > > How do you change the default text "Validation
> Error\n you must correct the following
> > > > error(s) before proceeding:" that is displayed
> whenever you use the  tag?
> > > >
> > > > Also, I've been happily using ActionErrors for
> returning errors from forms but I
> > > > would also like to use it for displaying other
> errors (not from forms) is ActionErrors
> > > > the appropriate facility to be doing this with
> or is there something else I should
> > > > be using for this purpose?
> > > >
> > > > Lastly, struts seems to be a very complete
> framework and as a new web programmer I am
> > > > unfamiliar with all of the capabilities that
> struts could be providing for me.  In
> > > > order to avoid re-writing code that struts may
> already provide is there a listing
> > > > of all of the 'things you can do' with struts
> persay listed online?
> > > >
> > > > Thanks
> > > >
> > > > rob
> > > >
> > > > --
> > > > To unsubscribe, e-mail:  
> 
> > > > For additional commands, e-mail:
> 
> > >
> > > --
> > > João Paulo G. Batistella
> > > Ci&T - Software enabling the e-world
> > > Phone: +55 (19) 3737-4515
> > > http://www.cit.com.br
> > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:  
> 
> > > For additional commands, e-mail:
> 
> > >
> >
> > --
> > To unsubscribe, e-mail:  
> 
> > For additional commands, e-mail:
> 
> 
> --
> João Paulo G. Batistella
> Ci&T - Software enabling the e-world
> Phone: +55 (19) 3737-4515
> http://www.cit.com.br
> 
> 
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 


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

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Form Date Validation - how to?

2002-01-08 Thread David Winterfeldt

There is a validation framework in the
contrib/validator directory in the nightly source.  It
can handle date valdiations.  


 
 
   datePatternStrict
   MM/dd/
 


So if you keep your field in the ActionForm a String,
you could use one of the transformation packages to
transform the data from the ActionForm to a JavaBean
with the correct types for fields and then continue
processing your business logic.  Of course this may be
more than you want to get into if you just have the
date field and everything else doesn't need to be
transformed.

Struts Transformer by Ron Smith
http://www.rpsenterprises.com/struts/index.html

Mapper Framework by Capco
http://www.rpsenterprises.com/struts/index.html

Hope this helps.

David

--- Bill Pfeiffer <[EMAIL PROTECTED]> wrote:
> Is there a recommended method for performing normal
> date validation of struts form date property?  
> 
> It seems like I am doing a lot of work that may
> already be done (parsing date text, catching
> exception in multiple places, maintaining both text
> and date properties, etc).
> 
> Thanks in advance for any pointers,
> 
> Bill Pfeiffer
> 


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

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Where can I find ?

2002-01-05 Thread David Winterfeldt

The html:messages tag is in the nightly builds (after
v1.0).  The Validator package has a custom JSP tag
that iterates through errors.  It is in the nightly
build in the contrib/validator directory and it is
also posted here
(http://home.earthlink.net/~dwinterfeldt).


   


David

--- Peter Pilgrim <[EMAIL PROTECTED]> wrote:
> I want to customise the errors messages for invalid
> data entry.
> Where can I get my hands on the  tag?
> This tag does not exists Struts 1.0 ?
> 
> Or how can use the present tags to iterate through
> the
> error messages?
> 
> --
> Peter Pilgrim ++44 (0)207-545-9923
> 
>  //_\\
> "Mathematics is essentially the study of islands of 
> ===
> disparate subjects in a sea of ignorance."  
> || ! ||
> Andrew Wiles
> __/\/\__||_!_||__
> 
> 
> 
> --
> 
> This e-mail may contain confidential and/or
> privileged information. If you are not the intended
> recipient (or have received this e-mail in error)
> please notify the sender immediately and destroy
> this e-mail. Any unauthorized copying, disclosure or
> distribution of the material in this e-mail is
> strictly forbidden.
> 
> 
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 


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

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: org.apache.struts.action.MESSAGE

2001-12-26 Thread David Winterfeldt

This is the value of Action.MESSAGES_KEY.  It is used
to store the application message resources
(ApplicationResources.properties) under application
scope.

Action.MESSAGES_KEY =
"org.apache.struts.action.MESSAGE"

I don't know why you would get intermittent messages. 
It should load at startup and then stay cached.  You
can check that you are correctly referencing your
properties file in the web.xml.

David

--- troy <[EMAIL PROTECTED]> wrote:
> Does anyone know what the resource key
> "org.apache.struts.action.MESSAGE" is
> used for? I am getting an intermittent exception
> that complains about the
> absense of this key... Any help would be
> appreciated.
> 
> Thanks,
> 
> Troy
> 
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 


__
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: PLEASE: Validating A session level form on the Server side

2001-12-25 Thread David Winterfeldt

The validator example also is doing the validations
server side.

Multi Page Forms
The field element has an optional page attribute. It
can be set to an integer. All validation for the any
field page value less than or equal to the current
page is performed server side. All validation for the
any field page equal to the current page is generated
for the client side Javascript. A mutli-part form
expects the page attribute to be set.
   ex:  

This could be used instead of page numbers if you
define a separate action for each validation.
ValidatorActionForm
This class extends ValidatorForm and provides basic
field validation based on an XML file.  The key passed
into the validator is the action element's 'path'
attribute from the struts-config.xml which should
match the form element's name attribute in the
validation.xml.


David

--- Dave J Dandeneau <[EMAIL PROTECTED]> wrote:
> I have checked the mailing list archives, but have
> been unable to find a
> solution to validating a session level form on the
> serverside. We have
> one action class that passes a form around and needs
> to validate the
> fields in chunks. i.e. it should only validate the
> first few fields when
> on the first page, but the second fields when on the
> second page. I saw
> that the validator.war example does this on the
> client-side, but we need
> to do it on the server-side. Has anyone done this?
> How was it done? 
> 
> Thanks for the help,
> Dave Dandeneau
> 
> 


__
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Is it ok to ask about validator?

2001-12-25 Thread David Winterfeldt

It's ok to ask.  Do you have the ValidatorServlet
defined in your web.xml?  If you have the debug set to
greater than zero, you should see some ouput to the
console window as the validation.xml loads.

David

--- Marcelo Caldas - CCSC <[EMAIL PROTECTED]> wrote:
> Hi, I'm trying to use the validator framework
> (com.wintecinc.struts.action.ValidatorServlet)
> 
> But I can't compile my JSP... It's complaining about
> a NullPointerExeption on the declaration of the
> 
> 
> Here's the code pieces, so someone can tell me if
> I'm missing something:
> On my jsp:
>   onsubmit="return
> validateServiceAreaEditActionForm(this);">
> 
> at the end of the jsp:
>   formName="serviceAreaEditActionForm"/> 
> 
> On my validation.xml:
> 
> 
>   depends="required">
>  key="error.serviceArea.description.displayName"/>
>  
> 
>   depends="required">
>  key="error.serviceArea.code.displayName"/>
>  
> 
> 
> 
> Any help is greatly appreciated...
> Thanks in advance,
> Marcelo.
> 


__
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Is there a global constructor I can use to initialise applica tion wide beans?

2001-12-25 Thread David Winterfeldt

There is a Service Manager package in the nightly
source contrib/service-manager directory.  It can be
used to initialize resources without having to create
your own servlet or extend the ActionServlet.

David

--- "Krueger, Jeff" <[EMAIL PROTECTED]> wrote:
> Create a class that extends
> javax.servlet.http.HttpServlet.  In the init
> method create your beans and put them in session. 
> Then in your web.xml add
> another servlet entry specifying the class that you
> just created and give it
> a  number less than the one you
> have for your struts
> controller.  That should do it.
> 
> 
> Jeff Krueger
> 
> 
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]
> Sent: Monday, December 24, 2001 9:38 PM
> To: Struts Users Mailing List
> Subject: Re: Is there a global constructor I can use
> to initialise
> application wide beans?
> 
> 
> Thanks for the reply.  Can you please tell me how to
> make a servlet load 
> on startup.
> 
> 
> Sandeep Takhar wrote:
> 
> > Well - there are a number of ways of doing this.
> > 
> > One way is to create a servlet and have it load on
> > startup and do the work there.
> > 
> > Sandeep
> > --- [EMAIL PROTECTED] wrote:
> > 
> >>Hi
> >>
> >>I have some beans which I want to be visible
> >>application wide.  I want 
> >>them to be initilised when my struts application
> is
> >>started.  Is there a 
> >>mechanism in struts I can use to make a java
> program
> >>run as part of the
> >>initilisation process.  I would put the intilising
> >>code into a file 
> >>called InitiliseWebApp.java,  this would initilise
> >>the beans and add 
> >>them to the application scope.
> 
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:
> 
> For additional commands, e-mail:
> 
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 


__
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: 2 problems with

2001-12-10 Thread David Winterfeldt

In nightly builds there is an html:messages tag that
iterates through errors and the header and footer are
optional.

David

--- Jonathan James <[EMAIL PROTECTED]>
wrote:
> I just looked at the ErrorsTag code (as of struts
> 1.0) and it IS checking to
> see if those properties exist and is not using them
> if they are not defined.
> So the error you're seeing must be something else,
> or this got broken in the
> later versions of Struts? Ok, I'm now looking at the
> source from 12/7 and it
> looks wrong to me. Here's the logic that looks bad:
> 
> 
> 
> // Check for presence of header and footer message
> keys
> boolean headerPresent =
> RequestUtils.present(pageContext,
> bundle, locale,
> "errors.header");
> boolean footerPresent =
> RequestUtils.present(pageContext,
> bundle, locale,
> "errors.footer");
> 
> // Render the error messages appropriately
>  StringBuffer results = new StringBuffer();
> String message = null;
> if (headerPresent)
> message =
> RequestUtils.message(pageContext, bundle,
>locale,
> "errors.header");
> Iterator reports = null;
> if (property == null)
> reports = errors.get();
> else
> reports = errors.get(property);
>// Render header iff this is a global tag or
> there is an error for
> this property
>boolean propertyMsgPresent =
> reports.hasNext();
>if ((message != null)&&(property == null) ||
> propertyMsgPresent) {
>results.append(message);
>results.append("\r\n");
>}
> 
> 
> 
> This code says that if propertyMsgPrsent is true
> then it will prepend the
> header, even if it's null!
> 
> So yeah, this looks broken in the version that you
> have, and is still broken
> in the 12/10 release. Someone should submit a bug
> report Guess that
> should be me.
> 
> -Jonathan
> 
> - Original Message -
> From: "Jeff Martin" <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List"
> <[EMAIL PROTECTED]>
> Sent: Monday, December 10, 2001 10:19 AM
> Subject: RE: 2 problems with 
> 
> 
> This is a HUGE source of user error. Is there a
> chance we can make
> html:errors work WITHOUT the special properties in
> the
> ApplicationResources.properties file?
> 
> -Original Message-
> From: Jonathan James
> [mailto:[EMAIL PROTECTED]]
> Sent: Monday, December 10, 2001 8:40 AM
> To: Struts Users Mailing List
> Subject: Re: 2 problems with 
> 
> 
> Oops, that should be errors.header & errors.footer
> 
> -Jonathan
> 
> - Original Message -
> From: "Jonathan James"
> <[EMAIL PROTECTED]>
> To: "Struts Users Mailing List"
> <[EMAIL PROTECTED]>
> Sent: Monday, December 10, 2001 7:36 AM
> Subject: Re: 2 problems with 
> 
> 
> > Sounds like you don't have errors.header &
> errors.header defined in
> your
> > ApplicationResources.properties file, since those
> get prepended &
> appended
> > to every error message.
> >
> > -Jonathan
> >
> > - Original Message -
> > From: "Mike Hoeffner"
> <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Sunday, December 09, 2001 2:25 PM
> > Subject: RE: 2 problems with 
> >
> >
> > >
> > > I'm at a loss for why, but I did a lot of trial
> and error and the
> > following
> > > solved my first problem:
> > >
> > >  property="children"
> > > indexId="index">
> > >   <% String errorKeyChildFirstName =
> > > "children["+index.intValue()+"].firstName"; %>
> > >property="<%=errorKeyChildFirstName%>"/>
> > > 
> > >
> > > I'm still stuck with problem #2 though
> ("null\r\n" added to the
> start
> and
> > > end of every error message).
> > >
> > > Mike
> > >
> > > -Original Message-
> > > From: Mike Hoeffner
> [mailto:[EMAIL PROTECTED]]
> > > Sent: Saturday, December 08, 2001 2:12 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: 2 problems with 
> > >
> > >
> > > I am using the nightly build from 12/07.
> > >
> > > 1) I have JSP that looks like this:
> > >
> > >  property="children"
> > > indexId="index">
> > >   A:  property="children[0].firstName"/>
> > >   B:  > >
>
property="<%="children["+index.intValue()+"].firstName"%>"/>
> > > 
> > >
> > > This is what gets printed out:
> > >
> > >   A:
> > >   B:  property="children[0].firstName"/>
> > >
> > > When do the  tags get evaluated? 
> Is their a way to set
> the
> > > property dynamically and still have it be
> replaced with the
> appropriate
> > > error message?
> > >
> > > 2) All of my  tags are now replaced
> with:
> > >
> > > null
> > > 
> > > null
> > >
> > > instead of just the error message.  This started
> happening when I
> upgraded
> > > from 1.0 to nightly-12-07.  I've tried setting
> errors.header and
> > > errors.footer, but they don't make it into the
> error either.  I
> looked
> at
> > > the source for ErrorTag, MessageResources, and
> RequestUtil (all
> seemed
> to
> > > have changed quite a bit), but I wasn't able to
> easily figure
> anythin

Re: lost form data when validate returns errors

2001-12-08 Thread David Winterfeldt


--- Ted Husted <[EMAIL PROTECTED]> wrote:
> Calling reset is a prelude to autopopulation. Unless
> the request is
> being redirected along the way, this should just put
> the same values
> back into the ActionForm. 
> 
> Reset must be called to ensure that the properties
> for some controls,
> like checkboxes, are set correctly. The default
> reset does nothing. It
> is really only needed for checkboxes.
That's true.  I was thinking that if you have some
inner value objects that you are accidentally setting
to null in the reset instead of reinitializing or
clearing that could cause a problem.

I see you forwarding to this after an error, but I
don;t see the forward defined.
   return (mapping.findForward("user1add"));

David

> 
> Dan Tanner wrote:
> > 
> > >>I'm having the problem of losing form data when
> my
> > >>action class returns
> > >>errors.  The error displays properly, but I lose
> all
> > >>the form data.
> > >>
> > > Maybe there is an issue with the reset method in
> your
> > > ActionForm?  The validation error messages make
> sense?
> > >  If they do then the data is being populated
> correctly
> > > into your ActionForm from you form.
> > 
> > You're right...the form data is getting to the
> action, and for some
> > reason the reset method is getting called when I
> don't think it should.
> >I have the form info in my action and it passes
> the form's
> > validation, but if I add an error in the action
> and return a new
> > ActionForward, the displayed page doesn't have the
> form info.
> > 
> > I'm a struts newbie, and odds are that I'm just
> missing something really
> > lame, but I've been tearing my hair out trying to
> figure out what it is.
> > Is it that once a form gets past
> ActionForm.validate, the form data
> > will no longer be returned?  I tried setting the
> form scope to both
> > session and request, to no avail.
> > 
> > Thanks again for any help.
> > 
> > >>
> > >>--
> > >>  > >> path="/user/add1"
> > >> type="com.usbank.crm.user.UserAction"
> > >> name="userForm"
> > >> scope="session"
> > >> validate="false"
> > >> input="/user/user1.jsp"
> > >> parameter="add">
> > >>> >>path="/user/user1.jsp"/>
> > >>> >>path="/user/main.jsp"/>
> > >> 
> > >>
> > >>  > >> path="/user/edit1"
> > >> type="com.usbank.crm.user.UserAction"
> > >> name="userForm"
> > >> scope="session"
> > >> validate="false"
> > >> input="/user/user1.jsp"
> > >> parameter="select">
> > >>> >>path="/user/user2.jsp"/>
> > >>> >>path="/user/main.jsp"/>
> > >> 
> > >>
> > >>  > >> path="/user/save1"
> > >> type="com.usbank.crm.user.UserAction"
> > >> name="userForm"
> > >> scope="session"
> > >> validate="true"
> > >> input="/user/user1.jsp"
> > >> parameter="continue">
> > >>> >>path="/user/adduser2.jsp"/>
> > >>> >>path="/user/main.jsp"/>
> > >> 
> > >>
> > >>
> > >>public class UserAction extends BaseAction {
> > >>
> > >> protected ActionForward
> doAction(ActionMapping
> > >>mapping,
> > >> ActionForm form, HttpServletRequest
> > >>request,
> > >> HttpServletResponse response,
> String
> > >>action)
> > >> {
> > >> UserForm userForm = (UserForm)form;
> > >>
> > >> // add user action - this is the
> initial
> > >>action when the user
> > >> // enters the page to create a new user
> > >> if ("add".equals(action)) {
> > >> System.err.println("\n\n\n in add
> > >>action \n\n\n");
> > >>
> > >> // populate the user type options
> > >> userForm.setUserType(2);
> > >>
> > >> return (new
> > >>ActionForward(mapping.getInput()));
> > >> }
> > >>
> > >> // select - this is to edit an existing
> > >>user
> > >> if ("select".equals(action)) {
> > >> System.err.println("\n\n\n in
> select
> > >>action \n\n\n");
> > >>
> > >> // get the userid
> > >>
> > >> // populate the form
> > >>
> > >> return (new
> > >>ActionForward(mapping.getInput()));
> > >> }
> > >>
> > >> // the continue is used for both adds
> and
> > >>edits...it validates the
> > >> // data and continues on to the next
> page
> > >>if successful.
> > >> if ("continue".equals(action)) {
> > >> System.err.println("\n\n\n in
> continue
> > >>action \n\n\n");
> > >>
> > >> // validate the username isn't
> already
> > >>in use
> > >> boolean alreadyExists = true;  //
> will
> > >>cause an ActionError
> > >>
> > >> if (alreadyExists) {
> > >> ActionErrors errors = new
> > >>ActionErrors();
> > >>
> > >>
> > >>errors.add(ActionErrors.GLOBAL_ERROR,
> > >>new
>

Re: lost form data when validate returns errors

2001-12-07 Thread David Winterfeldt


--- Dan Tanner <[EMAIL PROTECTED]> wrote:
> I'm having the problem of losing form data when my
> action class returns 
> errors.  The error displays properly, but I lose all
> the form data.
Maybe there is an issue with the reset method in your
ActionForm?  The validation error messages make sense?
 If they do then the data is being populated correctly
into your ActionForm from you form.

> 
> Looking at older posts, I've seen the same problem,
> but haven't seen a 
> fix or workaround yet.  I've included the relevant
> code snippets.
> 
> Also, I like the added features of the latest
> validation.jar, but it 
> forces me to use a newer version of struts than the
> 1.0 release because 
> of its ActionMessage usage.  Are the latest nightly
> builds fairly safe, 
> or would people recommend I stick with struts 1.0
> for production until a 
> new major release comes out?
I assume you mean the validator framework
(contrib/validator).  It doesn't use ActionMessage
from Struts.  The issues with using the newer version
of the Validator with Struts 1.0 are that the
Validator uses the commons packages for Bean Utils,
Collections, and the Digester.  I believe some people
have this working, but I haven't had time to try it.

David

> 
> Thanks in advance for any help.
> 
> --
>path="/user/add1"
>  type="com.usbank.crm.user.UserAction"
>  name="userForm"
>  scope="session"
>  validate="false"
>  input="/user/user1.jsp"
>  parameter="add">
> path="/user/user1.jsp"/>
> path="/user/main.jsp"/>
>  
> 
>path="/user/edit1"
>  type="com.usbank.crm.user.UserAction"
>  name="userForm"
>  scope="session"
>  validate="false"
>  input="/user/user1.jsp"
>  parameter="select">
> path="/user/user2.jsp"/>
> path="/user/main.jsp"/>
>  
> 
>path="/user/save1"
>  type="com.usbank.crm.user.UserAction"
>  name="userForm"
>  scope="session"
>  validate="true"
>  input="/user/user1.jsp"
>  parameter="continue">
> path="/user/adduser2.jsp"/>
> path="/user/main.jsp"/>
>  
> 
> 
> public class UserAction extends BaseAction {
> 
>  protected ActionForward doAction(ActionMapping
> mapping,
>  ActionForm form, HttpServletRequest
> request,
>  HttpServletResponse response, String
> action)
>  {
>  UserForm userForm = (UserForm)form;
> 
>  // add user action - this is the initial
> action when the user
>  // enters the page to create a new user
>  if ("add".equals(action)) {
>  System.err.println("\n\n\n in add
> action \n\n\n");
> 
>  // populate the user type options
>  userForm.setUserType(2);
> 
>  return (new
> ActionForward(mapping.getInput()));
>  }
> 
>  // select - this is to edit an existing
> user
>  if ("select".equals(action)) {
>  System.err.println("\n\n\n in select
> action \n\n\n");
> 
>  // get the userid
> 
>  // populate the form
> 
>  return (new
> ActionForward(mapping.getInput()));
>  }
> 
>  // the continue is used for both adds and
> edits...it validates the
>  // data and continues on to the next page
> if successful.
>  if ("continue".equals(action)) {
>  System.err.println("\n\n\n in continue
> action \n\n\n");
> 
>  // validate the username isn't already
> in use
>  boolean alreadyExists = true;  // will
> cause an ActionError
> 
>  if (alreadyExists) {
>  ActionErrors errors = new
> ActionErrors();
> 
> 
> errors.add(ActionErrors.GLOBAL_ERROR,
> new 
> ActionError("error.username.already.exists"));
> 
>  saveErrors(request, errors);
>  return
> (mapping.findForward("user1add"));
>  }
> 
>  return
> (mapping.findForward("continue"));
>  }
> -
> 
> 
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 


__
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Producing alternating background colours in struts in a table

2001-12-07 Thread David Winterfeldt

This is nice.

RowTag (ZIP file for download) - Source for a
Struts-compatible tag to generate alternating row
colors in a table by Niall Pemberton. [NOTE: Requires
a Struts build dated after 2001-04-28]

http://www.husted.com/struts/resources.htm#taglibs

David

--- Struts Newsgroup <[EMAIL PROTECTED]> wrote:
> Subject: Re: Producing alternating background
> colours in struts in a table
> From: [EMAIL PROTECTED] (Dalibor42)
>  ===
> [EMAIL PROTECTED] wrote in
> <[EMAIL PROTECTED]>: 
> 
> >I have a list I am printing out and would like to
> alternate the 
> >background colour between each item in the list
> between light blue and 
> >light grey.  The list is not in a table at the
> moment, but if this is 
> >the best way to go I can put it in a table.  What
> is the best way to 
> >acheive this.  The list is currently getting
> generated in a 
> > tag.
> 
> Use your own bean:
> 
>class="your.color.bean">
> 
> Set you colors with:
> 
>value="#d7ddf3"/>
>value="#eef2fb"/>
> 
> And change background where you need with:
> 
>   
> 
> your.color.bean looks like this:
> 
>   private String color1="white";  // default color
>   private String color2="yellow"; // default color
>   private boolean which = false;
>   public void setColor1(String color) { color1 =
> color; }
>   public void setColor2(String color) { color2 =
> color; }
>   public String getColor() { return which ? color1 :
> color2; }
>   public String getNextColor() { which = !which;
> return getColor(); }
> 
> -- 
> e-mail: [EMAIL PROTECTED]
> emajl : [EMAIL PROTECTED]
> ICQ # : 129068041
> phone : 1ABACA@098
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 


__
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




struts-user@jakarta.apache.org

2001-12-06 Thread David Winterfeldt

If you can use a servlet engine that supports v2.3
(tomcat 4.0), you could use a Filter to parse out the
url that was entered and extract any parameters that
you encoded differently.  Then you could forward the
request to the actual page or servlet it should go to.

David

--- Phase Communcations <[EMAIL PROTECTED]> wrote:
> Has anyone succefully swapped out the "?" and the
> "&" in a querystring with
> another symbol , such as "/". A problem with various
> search engine spiders
> (not all, but, several) is that they will not move
> past a ?. It would be
> advantagous to allow for the use of a more
> compatible querystring (a way
> around) especially when we  are talking about
> shopping carts and sites with
> dynamic content that is accessed through links and
> not forms. I have seen
> this done with other sites using php :( and it is
> very effective on the
> search engines. I am endeavoring myself to figure a
> way around the "?" and
> "&", using Struts (of course). Yet, if someone has
> attempted this succefully
> I sure would appreciate some wisdom or code (code
> would be better, I think).
> Otherwise, I will embark on my crusade alone.
> 
> Thanks ahead of time,
> Brandon Goodin
> Phase Web and Multimedia
> P (406) 862-2245
> F (406) 862-0354
> [EMAIL PROTECTED]
> http://www.phase.ws
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 


__
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Struts Validator (dumb?) question

2001-12-06 Thread David Winterfeldt

You either would need to define at least one action
with validate="true" and another with validate="false"
or perform the call to the ActionForm validates method
yourself in the action.  There is an example of using
one action this way in the jdbc example web app that
comes with the Validator.

ActionErrors errors = form.validate(mapping, request);

if (errors == null || errors.empty()) {
   update(request, info);
} else {
   saveErrors(request, errors);
   return (new ActionForward(mapping.getInput()));  
}


David

--- "Sobkowski, Andrej" <[EMAIL PROTECTED]>
wrote:
> Hello All,
> 
> I'm trying to use the Struts validator but it
> doesn't seem to be working in
> my - relatively common - case.
> 
> I have a modify.jsp page that is displayed upon
> calling
> /modifyAction?command=init (using the
> DispatchAction). No validation must be
> performed at this point. The user then enters some
> data and submits the form
> to /modifyAction?command=update and at this point I
> clearly want the
> validation to be performed. I also have a search
> page that can be called
> with /modifyAction?command=search (no validation, of
> course).
> 
> How can I do this?
> 
> I've tried the following:
> - myForm extends ValidatorForm and  name="myForm ...> in
> validation.xml. 
> This doesn't work as the form is validated on the
> init method (the blank
> modify.jsp is displayed the first time with an error
> message saying "field
> required" as the validation is performed on the
> form)
> - myForm extends ValidatorActionForm and  name="/modifyAction" ...> in
> validation.xml
> This doesn't work because when I call the search
> page with
> /modifyAction?command=search, the validation is
> triggered (it matches
> "/modifyAction") and doesn't allow me to go to the
> search page until the
> data is valid (which doesn't really make sense since
> I want to select
> something).
> 
> Do you have any suggestions? Is there a way I can do
> the above with the
> Struts validator? Am I structuring my actions in the
> wrong way? I think I
> need a "DispatchValidatorForm"... :)
> 
> Thank you for any help.
> 
> Andrej
> 
> 


__
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: ActionError Header/Foorters - can Global vs Non-Global be dif ferentiated

2001-12-05 Thread David Winterfeldt

I'm not 100% sure if this is what you are asking
about, but the Validator Framework has the concept of
levels of validation errors.  You can setup a
validator to depends on another one.  The 'minlength'
validator depends on the 'required' validator.  So
until this level (required) is completed, the next
level will not occur.






You can find the framework in the Struts nightly
builds in the contrib/validator directory or at the
url below.

http://home.earthlink.net/~dwinterfeldt/

David

--- Greg Callaghan <[EMAIL PROTECTED]> wrote:
> Hi Jon, all
> 
> That might be the easiest way for the moment,
> however it doesn't provide the 
> feature that the user ends back at the previous page
> (depending how 
> important one thinks this is).
> 
> Can I assume the current struts error tags don't
> support what I was 
> suggesting below and that if I wanted to do this I
> would have to make a 
> modification to the struts  tag code?
> 
> Cheers
> Greg
> 
> Original Message Follows
> From: "Jon.Ridgway" <[EMAIL PROTECTED]>
> Reply-To: "Struts Users Mailing List"
> <[EMAIL PROTECTED]>
> To: "'Struts Users Mailing List'"
> <[EMAIL PROTECTED]>
> Subject: RE: ActionError Header/Foorters - can
> Global vs Non-Global be dif 
> ferentiated
> Date: Wed, 5 Dec 2001 09:39:09 -
> 
> Hi Greg,
> 
> You could try using the standard Struts
> ActionError's mechanism for
> validation errors. Use the standard J2EE exception
> handling mechanism
> errors.
> 
> To do this add error-page entries to your web.xml;
> one for exceptions and
> another for warnings. Then through two types of
> corresponding user-defined
> exceptions from your code.
> 
> Jon.
> 
> -Original Message-
> From: Greg Callaghan
> [mailto:[EMAIL PROTECTED]]
> Sent: 05 December 2001 07:26
> To: [EMAIL PROTECTED]
> Subject: ActionError Header/Foorters - can Global vs
> Non-Global be
> differentiated
> 
> Hi,
> 
> Noting that one may use an ActionError, and struts
> ErrorTag to display both
> GLOBAL and validation errors (non-GLOBAL).
> 
> Currently the header/footer text I use is focused on
> the non-Global errors
> (ie validation errors in a form).  Is there a way
> with struts to throw the
> errors back such that it would be more like the
> following -:
> 
> * Global Error1 (eg for resource not available
> error)
> * Global Error1
> 
>  eg correct validation errors in form
> before proceeding
> * Validation Error 1 - date should be in dd/mm/
> format
> * Validation Error 2
> 
> 
> Regards
> Greg
> 
> 
> 
>
_
> Get your FREE download of MSN Explorer at
> http://explorer.msn.com/intl.asp
> 
> 
> --
> To unsubscribe, e-mail:
> 
> For additional commands, e-mail:
> 
> 
> --
> To unsubscribe, e-mail:   
> 
> For additional commands, e-mail: 
> 
> 
> 
> 
>
_
> Get your FREE download of MSN Explorer at
> http://explorer.msn.com/intl.asp
> 
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 


__
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE:

2001-12-05 Thread David Winterfeldt

The equivalent of validator:errors is now 
html:messages in the Struts nightly builds.  The
equivalent of validator:errorsExist is now 
logic:messagesPresent in the Struts nightly builds.  I
consider the most recent releases of the Validator to
be in sync with the nightly builds.  If you look at
the revision info
(http://home.earthlink.net/~dwinterfeldt/revision.html),
you can see what Validator version was built/developed
with what version of Struts.

David

--- Alexander  Jesse <[EMAIL PROTECTED]> wrote:
> Hi Mohammed,
> 
> well I still use Struts 1.0 with David's Framework
> in the July-version.
> 
> If you use Struts 1.0.1 or a nightly build, it can
> be that David's
> tags have been moved either into Struts or into the
> Apache commons-project.
> 
> For the newer versions of Struts I cannot give you a
> final answer...
> regards
> Alexander
> 
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, December 05, 2001 2:27 PM
> To: [EMAIL PROTECTED]
> Subject: Re: 
> 
> 
> Hi Alexander,
> 
> I read the Doc of Winterfeldt package . The errot
> tag class has been
> deprecated.
> 
> Mohammed
> - Original Message -
> From: "Alexander Jesse" <[EMAIL PROTECTED]>
> To: "struts-user" <[EMAIL PROTECTED]>
> Sent: Wednesday, December 05, 2001 2:09 PM
> Subject: RE: 
> 
> 
> > Hi Mohammed,
> >
> > I do not know... The Winterfeldt tags also allow
> for more flexible
> formatting.
> > That's why I use only them. And they work also, if
> you do not use David's
> > Validation Framework...
> >
> > Alexander
> >
> > -Original Message-
> > From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, December 05, 2001 2:02 PM
> > To: [EMAIL PROTECTED]
> > Subject: Re: 
> >
> >
> > Hi Alexander,
> >
> > is there a new version of struts which fixes this
> bug
> >
> >
> > Mohammed
> > - Original Message -
> > From: "Alexander Jesse" <[EMAIL PROTECTED]>
> > To: "struts-user" <[EMAIL PROTECTED]>
> > Sent: Wednesday, December 05, 2001 1:14 PM
> > Subject: RE: 
> >
> >
> > > Hi,
> > >
> > > that's a little bug in the 1.0
> struts-error-tags.
> > > I use the error-tags coming with David
> Winterfeldt's validation
> framework.
> > > The are compatible, allow for more flexible
> formatting and work.
> > >
> > > hope this helps
> > > Alexander Jesse
> > >
> > > -Original Message-
> > > From: Mohammed [mailto:[EMAIL PROTECTED]]
> > > Sent: Wednesday, December 05, 2001 12:48 PM
> > > To: Struts Users Mailing List
> > > Subject: 
> > >
> > >
> > > Hi,
> > >
> > > 1)  In my jsp file I insert two error tags as
> follow:
> > >
> > > 
> > > 
> > >
> > > the registrationerror1 is added if the form
> validating of Action1
> fails.
> > > and the reigstrationerror2 is added in action2
> if inserting the new
> > customer
> > > in the database fails.
> > >
> > > if an error occurs in Action2 I am forwarding to
> Action1 which sendes my
> > jsp
> > > file to the browser.
> > > my problem is when no error under the property
> registrationerroe1 is
> added
> > > in Action1 the Errorheader andErrorfooter
> > > are displayed in the browser.
> > > how can I avoid this?
> > > Is there a way I can check if the number of 
> error of the given property
> > > zero is or not before insertinh the Error Tag?
> > >
> > > Thanks for any hint
> > >
> > > Mohammed
> > >
> > >
> > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> >
> 
> > > For additional commands, e-mail:
> > 
> > >
> > > --
> > > To unsubscribe, e-mail:
> >
> 
> > > For additional commands, e-mail:
> > 
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:
> 
> > For additional commands, e-mail:
> 
> >
> > --
> > To unsubscribe, e-mail:
> 
> > For additional commands, e-mail:
> 
> >
> 
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 


__
Do You Yahoo!?
Send your FREE holiday greetings online!
http://greetings.yahoo.com

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Automation options between ActionForm and Value Object?

2001-12-03 Thread David Winterfeldt

Here are two code generators that are out there if you
haven't seen them already (listed on
http://www.husted.com/struts/resources.htm).  Ravi has
worked on his a lot more than I have.

Struts CodeMaker by Ravindran Ramaiah
Generate Struts application by reading configuration
file or JSP files.
http://www.husted.com/struts/resources/codemaker.htm

Struts Generator by David Winterfeldt
Based on the generator.xml and a table/query an xml
file is generated. Based on the generated xml file a
primary key class, data bean class, jdbc class, and an
ActionForm (Struts) can be generated.
http://home.earthlink.net/~dwinterfeldt/generator/

David

--- Matt Raible <[EMAIL PROTECTED]> wrote:
> I've used Jon's suggestion below and it works very
> nicely.  In my applications,
> I create a BaseFormBean that has an action property.
>  Then in my FormBean's
> that extend this class, I have a getter/setter for
> the VO.  Works really slick.
>  In my Edit Action classes, I populate the VO from
> an EJB and then set it on
> the form, and display.  In my Save Action classes, I
> get the VO from the form
> and persist it to an EJB.
> 
> There might be an easier way, but this has worked
> nicely for me.
> 
> Matt
> 
> --- "Jon.Ridgway" <[EMAIL PROTECTED]> wrote:
> > Hi Allen,
> > 
> > Probably the easiest approach would be to use the
> utility provided by Struts
> > (now in the commons project):
> > 
> > org.apache.commons.beanutils.PropertyUtils.
> > 
> > Search the latest source of Struts and you will
> find several examples of its
> > use. Another useful tip is to reference your vo -
> via you struts form
> > directly on you JSP, eg:
> > 
> > 
> > 
> > So with a vo called personVO, which has a
> firstname property and associated
> > getter and is accssed via the getPersonVO method
> on our form bean you could
> > use:
> > 
> > 
> > 
> > This works with all Struts tags that have a
> property attribute.
> > 
> > Jon.
> > 
> > -Original Message-
> > From: Allen M. Servedio
> [mailto:[EMAIL PROTECTED]] 
> > Sent: 03 December 2001 13:43
> > To: [EMAIL PROTECTED]
> > Subject: Automation options between ActionForm and
> Value Object?
> > 
> > Hi All,
> > 
> > Though I still have much existing material to read
> in the STRUTS mailing 
> > lists (thanks again for your help Jon!), I have
> come across three 
> > interesting solutions to dealing with automating
> or centralizing the 
> > translation of data from Action Forms
> (presentation layer) to Value Objects 
> > (business layer) and back again. Here are the
> three approaches:
> > 
> > Translation Pattern: 
> >
>
http://www-106.ibm.com/developerworks/library/j-jsppatt/?dwzone=java&dwzone=
> > ibm
> > 
> > Using Property Editors: 
> >
>
http://www.onjava.com/pub/a/onjava/2001/11/07/jsp12.html?page=2
> > 
> > Using Code Generation: 
> >
>
http://www.javaworld.com/javaworld/jw-11-2001/jw-1102-codegen.html
> > 
> > The current one that I have seen referred to in
> the mailing lists is using 
> > Reflection (which still may easily solve this in
> most cases) or some type 
> > of mapper driven by XML setup info. Here are the
> mailing list threads that 
> > I have found on it so far:
> >
>
http://www.mail-archive.com/struts-user@jakarta.apache.org/msg18315.html
> >
>
http://www.mail-archive.com/struts-user@jakarta.apache.org/msg18373.html
> 
> > (an answer from Ted related to msg18315)
> >
>
http://archive.covalent.net/jakarta/struts-dev/2000/10/0135.xml
> >
>
http://www.mail-archive.com/struts-user@jakarta.apache.org/msg05437.html
> > 
> > Two other related patterns that I have found are
> the:
> > View Helper: 
> >
>
http://developer.java.sun.com/developer/restricted/patterns/ViewHelper.html
> > Dynamic Value Object: 
> >
>
http://www.theserverside.com/patterns/thread.jsp?thread_id=2722
> > 
> > I was curious what people thought of these
> solutions and what other 
> > solutions they had come up with.
> > 
> > This is an area that I really want to automate and
> that I really want to 
> > have a couple of solutions for (since it could
> generate a great deal of 
> > code that I REALLY don't want to have to rework if
> I find that the solution 
> > is no good).
> > 
> > Thanks for your thoughts and comments!
> > Allen
> > 
> > 
> > --
> > To unsubscribe, e-mail:
> >
> <mailto:[EMAIL PROTECTED]>
> > F

Re: and struts:erros>

2001-12-03 Thread David Winterfeldt

You can still use the ones from the validator package
if you need to, but if you are using more recent
nightly builds all the functionality for the
deprecated validator tags have been moved to struts.

html:messages logic:messagesPresent, and
logic:messagesNotPresent


   



David

--- Mohammed <[EMAIL PROTECTED]> wrote:
> Hi,
> I just read the online Doc of the validator package
> of David Wenterfield. I
> read that the ErrosTag class is deprecated.
> 
> Any other hint?
> 
> Mohammed
> 
> - Original Message -
> From: "Hani Hamandi" <[EMAIL PROTECTED]>
> To: "'Struts Users Mailing List'"
> <[EMAIL PROTECTED]>
> Sent: Monday, December 03, 2001 1:41 PM
> Subject: RE:  and struts:erros>
> 
> 
> > Go to the struts home page:
> http://jakarta.apache.org/struts
> > Click on "Resources" under "Welcome" on the left.
> > The package is called "Struts Validator" and it's
> under the "Contributor
> > Extensions" section.
> >
> > I could have simply given you the link to the
> package. But I wanted to
> show
> > you how to get to it and to other packages later.
> >
> > -Original Message-
> > From: Mohammed [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, December 03, 2001 7:36 AM
> > To: Struts Users Mailing List
> > Subject: Re:  and struts:erros>
> >
> >
> > Hi
> >
> > can you tell me where I can get the validator
> package from David
> > Winterfield?
> >
> > Thanks
> >
> > Mohammed
> > - Original Message -
> > From: "Alexander Jesse" <[EMAIL PROTECTED]>
> > To: "struts-user" <[EMAIL PROTECTED]>
> > Sent: Monday, December 03, 2001 1:15 PM
> > Subject: RE:  and struts:erros>
> >
> >
> > > Hi,
> > >
> > > get the validator-package from David Winterfeldt
> and use the validators
> > > error-tags. That did the trick for me.
> > >
> > > regards
> > > Alexander Jesse
> > >
> > > -Original Message-
> > > From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]]
> > > Sent: Monday, December 03, 2001 12:56 PM
> > > To: [EMAIL PROTECTED]
> > > Subject:  and struts:erros>
> > >
> > >
> > > Hello every body,
> > >
> > > in my action class I insert an error as follow:
> > >
> > > errors.add("registration", new
> ActionError("error.registration.failed");
> > > saveErrors(request,errors);
> > >
> > >
> > > in the jsp file :
> > >
> > >   //to get the errors displayed
> > > how can I get only the error for a given action?
> or a given key?
> > >
> > > I tried   //
> registration is the key
> > > under which I saved the error
> > > but it didn't work
> > >
> > >
> > > Thanks for any help
> > >
> > >
> > > Mohammed
> > >
> > >
> > >
> > > --
> > > To unsubscribe, e-mail:
> >
> <mailto:[EMAIL PROTECTED]>
> > > For additional commands, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> > >
> > > --
> > > To unsubscribe, e-mail:
> >
> <mailto:[EMAIL PROTECTED]>
> > > For additional commands, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> > >
> >
> >
> > --
> > To unsubscribe, e-mail:
> >
> <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
> > <mailto:[EMAIL PROTECTED]>
> >
> > --
> > To unsubscribe, e-mail:
> <mailto:[EMAIL PROTECTED]>
> > For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> >
> 
> 
> --
> To unsubscribe, e-mail:  
> <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail:
> <mailto:[EMAIL PROTECTED]>
> 


__
Do You Yahoo!?
Buy the perfect holiday gifts at Yahoo! Shopping.
http://shopping.yahoo.com

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




Re: Icons next to form elements with validation errors

2001-12-02 Thread David Winterfeldt

If you are using one of the more recent nightly builds
there is a logic tag you could use.


   // insert image here



David


--- Angela Saval <[EMAIL PROTECTED]> wrote:
> I would like to be able to place an icon next to
> each field in a form that
> did not validate correctly.  Is this integrated into
> the html input fields
> tags some how?  If so, I am not seeing this.  For
> example, I would like
> something like
> 
>  maxlength="100"
> erroricon="/images/error.jpg"/>
> 
> The only way that I see of doing something like this
> now is to extend each
> of the html tag definitions to include an error icon
> attribute since I see
> no way to extend a tag definition.
> 
> Any insight on how others have solved this problem
> would be appreciated.
> 
> Angela
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 


__
Do You Yahoo!?
Buy the perfect holiday gifts at Yahoo! Shopping.
http://shopping.yahoo.com

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: JDBCRealm

2001-11-27 Thread David Winterfeldt

To retrieve the user name once they are logged in.

request.getUserPrincipal().getName();

David

--- Scott Edwards <[EMAIL PROTECTED]> wrote:
> My understanding of the Tomcat 4 JDBC Realm is that
> you don't get to 
> access it from within your application. Only Tomcat
> gets to access it. 
> However, the servlet 2.3 spec provides APIs whereby
> you can get the 
> username that the user logged in under and then use
> that to find any 
> information you need about that user.
> 
> Not sure what you are trying to accomplish, but I
> hope that might help a 
> little.
> 
> -Scott
> 
> storck wrote:
> 
> >Hi,
> >
> >does someone know how i get acces to the
> (JDBC)Realm within struts ?
> >
> >
> >--
> >To unsubscribe, e-mail:  
> 
> >For additional commands, e-mail:
> 
> >
> >
> 
> 
> 
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 


__
Do You Yahoo!?
Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
http://geocities.yahoo.com/ps/info1

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: maxlength

2001-11-26 Thread David Winterfeldt

If you use the validation framework, there is a max
length validation.  It is the nightly build and also
posted at the link below.

http://home.earthlink.net/~dwinterfeldt

David

--- Leo Grove <[EMAIL PROTECTED]> wrote:
> try ezverify at ezverify.com. It's currently beta,
> but it will apply length
> restictions on textarea tags on the server-side.
> 
> Leo
> 
> -Original Message-
> From: Mahesh Agarwal [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, November 22, 2001 7:04 AM
> To: [EMAIL PROTECTED]
> Subject: maxlength
> 
> 
> hi all
> 
> we dont have any maxlength attribute for textArea in
> struts, can anyone tell
> me how to give a restriction on input characters on
> text area field
> 
> thanks a lot in advance
> mahesh
> 
> --
> To unsubscribe, e-mail:
> 
> For additional commands, e-mail:
> 
> 
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 


__
Do You Yahoo!?
Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
http://geocities.yahoo.com/ps/info1

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: David Winterfeldt's Validator Framework + Jbuilder 5.0 + Tomcat 3.2.1

2001-11-13 Thread David Winterfeldt

I wasn't using JBuilder, but I did have problems with
Tomcat 3.2.1 and Struts/Validator.  There were class
loading issues.  Even if you take out the validator, I
don't think you can get Struts running.  Is there any
way to upgrade to a newer version of Tomcat?  Sorry
this isn't more helpful to you problem, but I though I
would at least share what I know.  I'm currently using
Tomcat 4.0 with the nightly builds.

David

--- Tony Li <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> I'm having trouble getting the July release of the
> Validator framework
> working with Jbuilder and the included Tomcat 3.2.1.
>  After following
> the installation instructions, and  modifying one of
> my forms to test
> out the validation framework, it seems I'm having
> some classpath/.jar
> issues.
> 
> When I start tomcat through Jbuilder (by choosing
> Web Run), I see that
> the classpath used to startup tomcat does not having
> the struts.jar
> entry in it.  Even though I've added the struts.jar
> to the project, I
> *think* it's not there because of
> nostrutstomcat32.jar.  Therefore, I
> get noClassDefFound exceptions for things like the
> Digester, and
> FastHashMap.
> 
> If anyone has got this combination working, can you
> please send me your
> config info.  I've been struggling with this for
> some time now.
> 
> Thanks,
> 
> Tony
> 
> 
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 


__
Do You Yahoo!?
Find the one for you at Yahoo! Personals
http://personals.yahoo.com

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: JSP used to convert xml to html applying XSL

2001-11-12 Thread David Winterfeldt

There is a nice tag library you can use for
transformations.

http://jakarta.apache.org/taglibs/doc/xsl-doc/intro.html

Excerpt from Apply.jsp from the xsl-examples.war:
This version of the table was created by loading
the nested content with
an  action (simulating
asking a different
servlet or JSP page to render the desired XML data)
and using the same
external XSL stylesheet.


  



David

--- Frédéric_Houbie_-_ABSIS-GROUP
<[EMAIL PROTECTED]> wrote:
> Hi,
> 
> I would like to display HTML information from XML
> Data build on DB Access
> using XSL. I found how to use Xalan to define 2
> Source (XML & XSL), call
> transform et put it in response:
> 
> response.setContentType("text/html; charset=UTF-8");
> // Output goes in the response stream.
> PrintWriter out = response.getWriter();
> try
> {
>   TransformerFactory tFactory =
> TransformerFactory.newInstance();
>   // Get the XML input document and the stylesheet.
>   Source xmlSource = new StreamSource(new
>
URL("http://gateway:8080/Online/xml/CartedebaseJLL.xml";).openStream());
>   Source xslSource = new StreamSource(new
>
URL("http://gateway:8080/Online/xml/CartedebaseJLL.xsl";).openStream());
>   // Generate the transformer.
>   Transformer transformer =
> tFactory.newTransformer(xslSource);
>   // Perform the transformation, sending the output
> to the response.
>   transformer.transform(xmlSource, new
> StreamResult(out));
> }
> catch (Exception e)
> {
>   out.write(e.getMessage());
>   e.printStackTrace(out);
> }
> out.close();
> 
> return new ActionForward(null);
> 
> Now, my problem is to build the XML dynamically. I
> would like to create JSP
> pages that will build XML from collection object put
> in session by Struts
> Action bean. But, I don't know how to call the jsp
> so that xml will be
> created, how to get it as a stream and to put it in
> Xalan transformation.
> 
> Who can help me ?
> 
> Frederic
> 
> 
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 


__
Do You Yahoo!?
Find a job, post your resume.
http://careers.yahoo.com

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re:

2001-11-02 Thread David Winterfeldt

You have validate="true" in your action?  Or in your
Action if you are definitely getting back an
ActionErrors object with messages then you could use
the saveErrors method in the Action class to save it. 
Also, do you have errors.header and errors.footer
defined?  There is also an html:messages that tag
iterates through error messages if you are using a
recent nightly build.

David

--- Todd Fulton <[EMAIL PROTECTED]> wrote:
> 
> I just can't seem to get the  tag to
> display the errors passed
> through via my ActionForm object's validate()
> method.  I have confirmed that
> the validate() method is working correctly -- as I'm
> getting a forward to
> the input page as configured.  Simply nothing
> appears with:
> 
> 
> 
> 
> Read all the docs, but just can't figure this one
> out.  What am I missing in
> the struts-config, web.xml or what? Anyone?
> 
> 
> ToFu
> 
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 


__
Do You Yahoo!?
Find a job, post your resume.
http://careers.yahoo.com

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: ActionMessage classes

2001-11-02 Thread David Winterfeldt

There isn't a set schedule, but there are goals set. 
Below is a link to the To Do List.  There will be a
Struts 1.1 release when these things are done.
http://jakarta.apache.org/struts/todo-1.1.html

When is the next release coming out?
http://jakarta.apache.org/struts/userGuide/kickstart.html#release

David

--- John Nikolai <[EMAIL PROTECTED]> wrote:
> 
> 
> Hi all,
> 
> This may or may not be the proper place to ask this
> question. Please let me 
> know...
> 
> I noticed that the nightly builds contain new
> ActionMessage classes and 
> taglibs. Any idea when we might see these updates in
> a release build? 
> 
> Thanks much,
>  - John
> 
> --
> To unsubscribe, e-mail:  
> 
> For additional commands, e-mail:
> 
> 


__
Do You Yahoo!?
Find a job, post your resume.
http://careers.yahoo.com

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Struts-Validator problem: NoClassDefFoundError

2001-11-01 Thread David Winterfeldt

The ActionMessage class is in the more recent nightly
builds of Struts.  Are you using html:messages?  This
uses that class.  I'm not what else would be looking
for this in a JSP page though.  The validator tags
shouldn't be making a reference to this class.  

To check if the ValidatorResources are loading you can
see something print to the console window if the debug
for the ValidatorServlet is set to greater than 1.  I
would try to get the server side validation working
before testing the client side.  Once the server side
is working, the client side validation shouldn't be a
problem.

David

--- Sandeep Takhar <[EMAIL PROTECTED]> wrote:
> search the archives for more postings, but I have
> heard different approaches when I posted the same
> problem.
> 
> 1. Check to see that you are using the latest Struts
> nightly build.
> 
> 2. If not using hte latest nightly build, this may
> work if you use Tomcat 4.0
> 
> 3. Remove Jaxp, crimson and parser.jar files and add
> xerces.jar file.
> 
> The first one makes sense to me and the last two I
> am
> puzzled about.
> 
> The main thing is that ActionMessage is a new class
> to
> the nightly builds.  However this may be
> circumvented
> (the use of the ActionMessage) by changing the JSP
> to
> not use the new feature (at least this is what I
> have
> been told).
> 
> Sorry if I am confusing you, but as you can probably
> tell, i myself am confused, but since I do not have
> to
> do the work immediately, I have been holding off
> figuring out exactly what the problem is.
> 
> - Sandeep
> 
> --- Parvaze Suleman <[EMAIL PROTECTED]>
> wrote:
> > Hi 
> > I am trying to use Validator in my application and
> > can not get it to work. I
> > have a single test form that I would like to use
> the
> > Validator for
> > client-side and server-side validation. If I add
> the
> > following
> > 
> > <%@ taglib uri="/WEB-INF/struts-validator.tld"
> > prefix="validator" %>
> > 
> > reference to the taglib to the test form JSP page,
> > when I access this JSP
> > page after deploying the application, I get a
> > NoClassDefFoundError exception
> > thrown (see full message at the end of this
> email).
> > If I remove the taglib
> > reference, I don't get the error but the
> validation
> > rules don't get applied
> > either.
> > 
> > The latest version of the struts-validator.jar
> file
> > and the
> > struts-validator.tld files are in the WEB-INF/libs
> > directory.
> > 
> > Thanks in advance for any help received.
> > 
> >
>

> > 
> > 
> > My web.xml file is defined as follows:
> > 
> > .
> >
> >   validator
> >  
> >
>
com.wintecinc.struts.action.ValidatorServlet
> >   
> >  config
> > 
> > /WEB-INF/validation.xml
> >   
> >   
> >  debug
> >  2
> >   
> >   2
> >
> > 
> > 
> >
> >  
> >
> /tags/struts-validator.tld
> >  
> >
>
/WEB-INF/struts-validator.tld
> >   
> > 
> > 
> > 
> > My Validation.xml file is defined as below:
> > 
> > 
> >
> > 
> >> 
> >
>
classname="com.wintecinc.struts.validation.StrutsValidator"
> >  method="validateRequired"
> >  msg="error.required">
> >  
> >  
> >   
> >
> >
> >   
> >   >depends="required,mask">
> > 
> >  > key="prompt.personalDetailsForm.fname.maskmsg"/>
> > 
> > 
> >   mask
> >   ^[a-zA-Z]*$
> > 
> >  
> >   
> >
> > 
> > 
> > 
> > 
> > 
> > ERROR TEXT
> >
>
==
> > 
> > <01-Nov-01 11:37:51 GMT>  
> > <[WebAppServletContext(2791227,olympus,/olympus)]
> r
> > esolved taglib uri '/WEB-INF/struts-html.tld' to
> > taglib-location
> > /WEB-INF/struts-html.tld:
> > >
> > <01-Nov-01 11:37:52 GMT>  
> > <[WebAppServletContext(2791227,olympus,/olympus)]
> > Servlet failed with Exception
> > java.lang.NoClassDefFoundError:
> > org/apache/struts/action/ActionMessage
> > at java.lang.Class.getMethods0(Native
> > Method)
> > at
> >
> java.lang.Class.getDeclaredMethods(Class.java:1039)
> > at
> >
> java.beans.Introspector$1.run(Introspector.java:852)
> 
=== message truncated ===


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

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: Struts Validation question

2001-10-31 Thread David Winterfeldt

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

David

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


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

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Re: ActionErrors.add

2001-10-26 Thread David Winterfeldt

There are just multiple error messages for the login
property.  Nothing is lost.

David

--- "emmanuel.boudrant" <[EMAIL PROTECTED]> wrote:
> What's happen if...
> 
> 
> ActionErrors errors = new ...
> 
> (...)
> errors.add("login",new ActionError("error.login1"));
> (...)
> errors.add("login",new ActionError("error.login2"));
> 
> Is the first errors is overloaded by the second
> error
> ?
> 
> 
>
___
> Do You Yahoo!? -- Une adresse @yahoo.fr gratuite et
> en français !
> Yahoo! Courrier : http://courrier.yahoo.fr


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



Re: Messages like Errors...

2001-10-25 Thread David Winterfeldt

Are you talking about a general message or an error
message?  The below works with nightly builds or the
Validator project (in the Struts nightly source
contrib/validator directory or
http://home.earthlink.net/~dwinterfeldt) has tags to
do this if you aren't using nightly builds.


   
  
 
  
   


or

ActionMessages messages = new ActionMessages();
messages.add(ActionMessages.GLOBAL_MESSAGE, new
ActionMessage("save.msg"));
saveMessages(request, messages);



   
   
  
   



David

--- "Strichartz, Beth" <[EMAIL PROTECTED]>
wrote:
> I thought I read somewhere that I can add to the
> message bean
> and then in a jsp see if this message bean exists
> and output it kind
> of like errors???
> 
> errors.add(ActionErrors.GLOBAL_ERROR,
>new
> ActionError("error.database.missing"));
> 
> Can anyone point me in the right direction/...
> 
> 
> This message contains information which may be
> confidential and privileged.
> Unless you are the addressee  (or authorized to
> receive for the addressee),
> you may not use, copy or disclose to anyone the
> message or any information
> contained in the message.  If you have received the
> message in error, please
> advise the sender by reply e-mail, and delete or
> destroy the message. 
> 
> Thank you.
> 


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



Re: Validator Nightly builds and Struts 1.0

2001-10-25 Thread David Winterfeldt

The first error sounds like a class loading issue. 
I'm using Tomcat 4.0, but I saw something like this on
Tomcat 3.2.1 for the latest Struts and Validator
builds.  Maybe someone else will comment about that.

The latest source of the Validator is using some
Struts tags that are in the nightly build so the
example won't run with Struts 1.0 without
modifications.

David

--- Sandeep Takhar <[EMAIL PROTECTED]> wrote:
> I get the following error message:
> 
> classnotfoundexception:
> com.wintecinc.struts.validation.Constant
> 
> on startup
> 
> When I run the example I get the following error:
> 
> NoClassDefFoundError:
> org/apache/struts/action/ActionMessages
> 
> Even though the code that causes it is compatible
> with
> version 1.0:
> 
> 
> 
>
>
>
>   
>
>
> 
> 
> -Sandeep
> 
> __
> Do You Yahoo!?
> Make a great connection at Yahoo! Personals.
> http://personals.yahoo.com


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



Re: Validator and Struts 1.0

2001-10-24 Thread David Winterfeldt


--- Sandeep Takhar <[EMAIL PROTECTED]> wrote:
> sorry David, but I accidentally deleted the thread
> that was started from my mail.
> 
> I think that having a final release of validator for
> release 1.0 of struts is a great idea.
> 
> One thing that you mentioned is that using bCancel
> as
> a javascript variable is optional.  How to do this
> using the 7/2/2001 release?
Optional means don't reference bCancle in the onlick
attribute.

> The code in JavaScriptValidatorTag.java in the
> getJavascriptBegin method adds this variable:
> 
>sb.append(" that you can make this compatible with the current
> nightly builds as well.  
I don't know what you mean.  The bCancel var was added
in June and hasn't been changed.

> 
> In the 7/2/2001 release one defines the buttons as
> follows:
> 
>  onclick="bCancel=false;">
>  
>   
>    
>   
>  
>   
>    
>   
>  
>   
> 
> whereas in the nightly builds it seems like you need
> to define a separate function to handle the variable
> that you define:
> 
> 
> 
> 
> 
> and then define the buttons as follows:
> 
>  value="0">
onclick="this.form.validate.value='1';">ENTER 
onclick="this.form.validate.value='0';">CANCEL

I don't know where you are seeing this in the
Validator examples.

David

> 
> Are my assumptions wrong?
> 
> You seem to have indicated that they are.  How can I
> get these two to be compatible with each other.
> 
> thanks for taking the time
> 
> - Sandeep
> 
> __
> Do You Yahoo!?
> Make a great connection at Yahoo! Personals.
> http://personals.yahoo.com


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



Re: Validator and Backwards Compatibility

2001-10-23 Thread David Winterfeldt

I started upgrading the example to use some JSP tags
(logic:messagesPresent & html:messages) in the Struts
nightly build, but if you take out those references it
should probably work.  

David

--- Sandeep Takhar <[EMAIL PROTECTED]> wrote:
> thanks for the reply,
> 
> I just tried the 9/25/2001 release and used the
> validator.war file as a starting point.  All I did
> after that was delete the struts.jar and replace
> with
> struts1-0.jar.  This does not work.  Maybe I am
> doing
> something wrong?  The error is about ActionMessages
> which is in the nightly build but not the struts1-0
> release.
> 
> - sandeep
> --- David Winterfeldt <[EMAIL PROTECTED]>
> wrote:
> > 
> > --- Sandeep Takhar <[EMAIL PROTECTED]>
> wrote:
> > > Outside of what is defined as differences in the
> > > revisions.html file -- what are the backwards
> > > compatibility issues.  This is really an effort
> to
> > > understand what will be required when Struts1-1
> > goes
> > > final and what changes will be required.
> > I don't know when Struts 1.1 will go final so it
> is
> > hard to say what features will be added between
> now
> > and then.
> > 
> > > 
> > > so...
> > > 
> > > What are the backwards compatibility issues
> > between
> > > the nightly builds of the validator and the
> > 7/2/2001
> > > build for struts1-0?
> > The revision notes cover most things.  I'm aware
> of
> > at
> > least one person running a nightly build release
> of
> > the Validator with Struts 1.0.  The commons
> packages
> > (beans, collections, digester) are being used so
> > they
> > would need to be added.  Otherwise a nightly build
> > of
> > the Validator should work OK with Struts 1.0, but
> I
> > haven't tested this.
> > 
> > > 
> > > From a glance at the sample applications there
> > seems
> > > to be a javascript difference.  In the 7/2/2001
> > > version the javascript requires a certain
> variable
> > > to
> > > be set "bCancel", whereas the latest build
> allows
> > > you
> > > to code this, but a simple function is
> necessary:
> > This shouldn't be required.  You don't need to add
> > this javascript.  It just gives you a way to turn
> > off
> > the javascript validations for the cancel button
> (or
> > any other button you don't want validation run
> on).
> > 
> > > 
> > > 
> > > <!--
> > > function submitForm(form) {
> > >   if (form.validate.value == "0") {
> > > return true;
> > >   }
> > >   if (validateSimpleForm(form)) {
> > > form.submit.value=" ..."; 
> > > return true;
> > >   } 
> > >   else return false;
> > > };
> > > // -->
> > > 
> > > 
> > > What are the new validators that have been
> added? 
> > > Can
> > > these be used in the strut1-0 compliant version
> or
> > > will it not work?  What javascript additional
> > > functionality has been added for the old
> > validators
> > > as
> > > well?  Basically what is a list of all changes
> to
> > > the
> > > validation.xml validators and which of these can
> I
> > > copy and paste into the struts1-0 compliant
> > version?
> > The revision list covers most changes.  The new
> min
> > and max length validators could be cut and paste
> > into
> > the 7/2/2001 release.  I'm thinking about making a
> > few
> > updates (min/max and any bug fixes) to the
> 7/2/2001
> > release and making it a version 1.0 release.
> > 
> > > 
> > > When defining a msg parameter does the name
> > > attribute
> > > have to be defined?
> > Yes.
> > 
> > > 
> > > The alternative format for variables i.e.
> > > 
> > > var name="" value=""
> > > 
> > > does not work for struts1-0 compliant version?
> > I don't remember if you can still use this format
> or
> > not, but you should really use the nested element
> > structure.  This was changed so you could use
> cdata
> > tags around a regular expression and not have to
> > escape anything out.
> > 
> > David
> > 
> > > 
> > > 
> > > - sandeep
> > > 
> > > 
> > >
> __
> > > Do You Yahoo!?
> > > Make a great connection at Yahoo! Personals.
> > > http://personals.yahoo.com
> > 
> > 
> > __
> > Do You Yahoo!?
> > Make a great connection at Yahoo! Personals.
> > http://personals.yahoo.com
> 
> 
> __
> Do You Yahoo!?
> Make a great connection at Yahoo! Personals.
> http://personals.yahoo.com


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



Re: Validator and Backwards Compatibility

2001-10-23 Thread David Winterfeldt


--- Sandeep Takhar <[EMAIL PROTECTED]> wrote:
> Outside of what is defined as differences in the
> revisions.html file -- what are the backwards
> compatibility issues.  This is really an effort to
> understand what will be required when Struts1-1 goes
> final and what changes will be required.
I don't know when Struts 1.1 will go final so it is
hard to say what features will be added between now
and then.

> 
> so...
> 
> What are the backwards compatibility issues between
> the nightly builds of the validator and the 7/2/2001
> build for struts1-0?
The revision notes cover most things.  I'm aware of at
least one person running a nightly build release of
the Validator with Struts 1.0.  The commons packages
(beans, collections, digester) are being used so they
would need to be added.  Otherwise a nightly build of
the Validator should work OK with Struts 1.0, but I
haven't tested this.

> 
> From a glance at the sample applications there seems
> to be a javascript difference.  In the 7/2/2001
> version the javascript requires a certain variable
> to
> be set "bCancel", whereas the latest build allows
> you
> to code this, but a simple function is necessary:
This shouldn't be required.  You don't need to add
this javascript.  It just gives you a way to turn off
the javascript validations for the cancel button (or
any other button you don't want validation run on).

> 
> 
> 
> 
> 
> What are the new validators that have been added? 
> Can
> these be used in the strut1-0 compliant version or
> will it not work?  What javascript additional
> functionality has been added for the old validators
> as
> well?  Basically what is a list of all changes to
> the
> validation.xml validators and which of these can I
> copy and paste into the struts1-0 compliant version?
The revision list covers most changes.  The new min
and max length validators could be cut and paste into
the 7/2/2001 release.  I'm thinking about making a few
updates (min/max and any bug fixes) to the 7/2/2001
release and making it a version 1.0 release.

> 
> When defining a msg parameter does the name
> attribute
> have to be defined?
Yes.

> 
> The alternative format for variables i.e.
> 
> var name="" value=""
> 
> does not work for struts1-0 compliant version?
I don't remember if you can still use this format or
not, but you should really use the nested element
structure.  This was changed so you could use cdata
tags around a regular expression and not have to
escape anything out.

David

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


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



Re: Auto-generating ActionForms

2001-10-22 Thread David Winterfeldt


--- Stephen Hood <[EMAIL PROTECTED]> wrote:
> My last message didn't get any hits, so I'll try
> again with a low-verbosity
> filter.  :)
> 
> 1.  Has anyone had any success using JAXB, Castor,
> or any other XML data
> binding technology to auto-generate their Struts
> ActionForm beans from DTDs
> or XML Schemas (not from XML instance data or JSPs,
> like CodeMaker, etc.
> does) ?
I've looked at Castor and it seems nice.  I didn't end
up using it for my project though or using it to
generate ActionForms.

> 
> 2.  Has anyone had any experience dealing with
> complex ActionForms, such as
> those derived from a XML Schema?  It seems like the
> Struts taglibs are more
> about handling relatively flat documents; can anyone
> suggest other
> approaches for doing things like generating and
> handling forms with optional
> repeating groups, etc.?
You can have nested properties if you aren't aware of
that.  So for a property you could have "address.name"
and this would be the equivalent of
getAddress().getName().  ("address[2].name" ->
retrieve object from array and then call getName()) 
So this can let you have different beans nested inside
each other.

Dave Hays has added the functionality of indexed
functionality for tags.  This lets you reference
anything the logic:iterator tag can loop through and
generate the correct indexed property name
dynamically.  It is in the nightly builds or you can
download it here. 
http://www.husted.com/struts/resources/indexed-tags.htm




   



public List getListElementList();
public Object getListElement(int index);
public void setListElement(int index, Object value);

David

> 
> I can elaborate if anyone is interested in further
> discussion...
> 
> many thanks,
> --Steve
> 
> 


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



RE: Questions About Struts Validator

2001-10-22 Thread David Winterfeldt

The validator is in the Struts nightly source
downloads in the contrib/validator directory.  I also
keep the documentation and some downloads posted at
this url.  The most current will always be in the
nightly downloads.

http://home.earthlink.net/~dwinterfeldt/

The most recent release has the min/max length
validations.  The 7/2/2001 release was the last one
made with Struts v1.0.  It doesn't have the min/max
length, but you can make a 'mask2' validator (as you
can in most releases).

David

--- "Trieu, Danny" <[EMAIL PROTECTED]> wrote:
> I guess I am already behind...:) can you give me
> links to where I can read
> more
> about these validator framework and where I can
> download the sample and
> distribution?
> 
> Thanks,
> 
> --danny
> 
> -Original Message-
> From: David Winterfeldt
> [mailto:[EMAIL PROTECTED]]
> Sent: Monday, October 22, 2001 10:43 AM
> To: [EMAIL PROTECTED]
> Subject: RE: Questions About Struts Validator
> 
> 
> What feature are you referring to?  the min/max
> validators or defining a second mask validator as
> 'mask2'?  Also, this would depend on the validator
> version you are using.  Are you asking if the latest
> release will work with Struts 1.0?  It should. 
> Someone said they were using a more current release
> of
> the validator with the Struts 1.0 release.  It uses
> the commons packages (bean, digester, and
> collections)
> though so you would need to add them to your
> WEB-INF/lib directory.
> 
> David
> 
> --- "Trieu, Danny" <[EMAIL PROTECTED]> wrote:
> > is this feature available in Struts 1.0?
> > 
> > -Original Message-
> > From: David Winterfeldt
> > [mailto:[EMAIL PROTECTED]]
> > Sent: Sunday, October 21, 2001 1:04 PM
> > To: [EMAIL PROTECTED]
> > Subject: RE: Questions About Struts Validator
> > 
> > 
> > That isn't possible with the default mask
> validator.
> > 
> > I've recently added a min and max length
> validation
> > to
> > nightly builds though.  Or you could either write
> > your
> > own mask validation method that accepts multiple
> > inputs or you can define the mask validator again
> > under a different name like mask2.
> > 
> >  > 
> >
>
classname="com.wintecinc.struts.validation.StrutsValidator"
> >  method="validateMask"
> >  depends="required"
> >  msg="errors.invalid">
> > 
> > 
> >   >depends="required,mask,mask2">
> >   > key="registrationForm.lastname.maskmsg"/>
> >   > key="registrationForm.lastname.mask2msg"/>
> >   > key="registrationForm.lastname.displayname"/>
> >   key="${var:maxlength}"
> > resource="false"/>
> >  
> >mask
> >^[a-z]*$
> >  
> >  
> >mask2
> >^[A-Z]*$
> >  
> >  
> >maxlength
> >16
> >  
> >  
> > 
> > 
> > David
> > 
> > --- Paul Darling <[EMAIL PROTECTED]>
> > wrote:
> > > Is is possible to use multiple 'mask' validators
> > > that apply different
> > > expressions?  
> > > 
> > > For instance, in addition to checking that a
> > string
> > > contains only a-z or A-Z
> > > characters, you might want to validate the
> string
> > > length.  It's possible to
> > > use an expression that combines the types of
> > > validation (e.g.
> > > ^[a-zA-Z0-9]{,16}$), but then it's not possible
> to
> > > use an error message that
> > > is specific to whether the validation failed due
> > to
> > > the character content or
> > > the length.
> > > 
> > > Paul 
> > > 
> > > -Original Message-
> > > From: David Winterfeldt
> > > [mailto:[EMAIL PROTECTED]]
> > > Sent: Thursday, October 11, 2001 1:17 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: RE: Questions About Struts Validator
> > > 
> > > 
> > > This is what you were asking about though? 
> > > Everything
> > > makes sense now?
> > > 
> > > David
> > > 
> > > --- Vaughan Jackson
> > <[EMAIL PROTECTED]>
> > > wr

Re: Form properties reset ?

2001-10-22 Thread David Winterfeldt

--- Ted Husted <[EMAIL PROTECTED]> wrote:
> You can also be more careful about which properties
> are reset when. Both
> the mapping and the request are passed to reset,
> giving you the
> opportunity to look ahead.
> 
> The default reset does nothing. The properties are
> only affected if
> you've overridden this class and specified what
> happens to the
> properties before the form is populated from the
> request.
> 
> If you forward to another Action, any properties you
> changed in a
> previous Action will revert to the original, since
> these are populated
> from the request again. But if you are only setting
> additional
> properties, then this won't be a problem.

Unless you have a checkbox on your form and you have
validation.  Then in the case that a checkbox that was
checked and the page fails validation. The user is
then returned to the form to fix their input and
unchecks the checkbox.  Nothing will be submitted for
the checkbox (this is an html form issue) so the
property with your checkbox will still be checked.  So
any checkbox fields need to be in the reset method
(other fields don't have to be). 

David

> 
> -- Ted Husted, Husted dot Com, Fairport NY USA.
> -- Custom Software ~ Technical Services.
> -- Tel +1 716 737-3463
> -- http://www.husted.com/struts/
> 
> [EMAIL PROTECTED] wrote:
> > 
> > Yes, I would expect this. Any properties you set
> in the form bean from the
> > first action will be cleared when the form bean is
> reset prior to
> > populating it for the second action.
> > 
> > If you need to add additional parameters to the
> request, you'll need to do
> > it by adding them to the URL used to invoke the
> second action.
> > Alternatively, you could avoid the use of
> parameters, and pass them as
> > request attributes instead.
> > 
> > --
> > Martin Cooper
> > 
> > At 08:56 AM 10/19/01, Tom Klaasen (TeleRelay)
> wrote:
> > >Hi all,
> > >
> > >I noticed the following:
> > >
> > >I have a jsp with a corresponding form. When I
> press "submit", it gets
> > >forwarded to an Action which sets some additional
> properties on the
> > >form. Then I forward to another Action. When I
> read the additional
> > >properties of the form, they have disappeared. Is
> this normal behaviour?
> > >And if so, why?
> > >
> > >thanks,
> > >tomK


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



RE: Questions About Struts Validator

2001-10-22 Thread David Winterfeldt

What feature are you referring to?  the min/max
validators or defining a second mask validator as
'mask2'?  Also, this would depend on the validator
version you are using.  Are you asking if the latest
release will work with Struts 1.0?  It should. 
Someone said they were using a more current release of
the validator with the Struts 1.0 release.  It uses
the commons packages (bean, digester, and collections)
though so you would need to add them to your
WEB-INF/lib directory.

David

--- "Trieu, Danny" <[EMAIL PROTECTED]> wrote:
> is this feature available in Struts 1.0?
> 
> -Original Message-
> From: David Winterfeldt
> [mailto:[EMAIL PROTECTED]]
> Sent: Sunday, October 21, 2001 1:04 PM
> To: [EMAIL PROTECTED]
> Subject: RE: Questions About Struts Validator
> 
> 
> That isn't possible with the default mask validator.
> 
> I've recently added a min and max length validation
> to
> nightly builds though.  Or you could either write
> your
> own mask validation method that accepts multiple
> inputs or you can define the mask validator again
> under a different name like mask2.
> 
>  
>
classname="com.wintecinc.struts.validation.StrutsValidator"
>  method="validateMask"
>  depends="required"
>  msg="errors.invalid">
> 
> 
>depends="required,mask,mask2">
> key="registrationForm.lastname.maskmsg"/>
> key="registrationForm.lastname.mask2msg"/>
> key="registrationForm.lastname.displayname"/>
> resource="false"/>
>  
>mask
>^[a-z]*$
>
>  
>mask2
>^[A-Z]*$
>
>  
>maxlength
>16
>  
>  
> 
> 
> David
> 
> --- Paul Darling <[EMAIL PROTECTED]>
> wrote:
> > Is is possible to use multiple 'mask' validators
> > that apply different
> > expressions?  
> > 
> > For instance, in addition to checking that a
> string
> > contains only a-z or A-Z
> > characters, you might want to validate the string
> > length.  It's possible to
> > use an expression that combines the types of
> > validation (e.g.
> > ^[a-zA-Z0-9]{,16}$), but then it's not possible to
> > use an error message that
> > is specific to whether the validation failed due
> to
> > the character content or
> > the length.
> > 
> > Paul 
> > 
> > -Original Message-
> > From: David Winterfeldt
> > [mailto:[EMAIL PROTECTED]]
> > Sent: Thursday, October 11, 2001 1:17 PM
> > To: [EMAIL PROTECTED]
> > Subject: RE: Questions About Struts Validator
> > 
> > 
> > This is what you were asking about though? 
> > Everything
> > makes sense now?
> > 
> > David
> > 
> > --- Vaughan Jackson
> <[EMAIL PROTECTED]>
> > wrote:
> > > David,
> > > 
> > > I am sorry, I hadn't understood this before.
> > > 
> > > Thanks again,
> > > Vaughan.
> > > 
> > > > -Original Message-
> > > > From: David Winterfeldt
> > > [mailto:[EMAIL PROTECTED]]
> > > > Sent: Thursday, October 11, 2001 12:17 PM
> > > > To: [EMAIL PROTECTED]
> > > > Subject: RE: Questions About Struts Validator
> > > > 
> > > > 
> > > > For Q2:
> > > > You can override the default validator's error
> > > message
> > > > by specifying a msg element or you can change
> > the
> > > > defult of course.
> > > > 
> > > >   > > >depends="required,mask">
> > > >   > > > key="registrationForm.lastname.maskmsg"/>
> > > >   > > > key="registrationForm.lastname.displayname"/>
> > > >  
> > > >mask
> > > >   
> > ^[a-zA-Z]*$
> > > >  
> > > >  
> > > > 
> > > > You can also specify different arguments to go
> > > with
> > > > different errors.
> > > > 
> > > >   > > >depends="required,integer,range">
> > > >   > key="typeForm.integer.displayname"/>
>

RE: Questions About Struts Validator

2001-10-21 Thread David Winterfeldt

That isn't possible with the default mask validator. 
I've recently added a min and max length validation to
nightly builds though.  Or you could either write your
own mask validation method that accepts multiple
inputs or you can define the mask validator again
under a different name like mask2.




 
 
 
 
 
 
   mask
   ^[a-z]*$
 
 
   mask2
   ^[A-Z]*$
 
 
   maxlength
   16
 
 


David

--- Paul Darling <[EMAIL PROTECTED]> wrote:
> Is is possible to use multiple 'mask' validators
> that apply different
> expressions?  
> 
> For instance, in addition to checking that a string
> contains only a-z or A-Z
> characters, you might want to validate the string
> length.  It's possible to
> use an expression that combines the types of
> validation (e.g.
> ^[a-zA-Z0-9]{,16}$), but then it's not possible to
> use an error message that
> is specific to whether the validation failed due to
> the character content or
> the length.
> 
> Paul 
> 
> -Original Message-
> From: David Winterfeldt
> [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, October 11, 2001 1:17 PM
> To: [EMAIL PROTECTED]
> Subject: RE: Questions About Struts Validator
> 
> 
> This is what you were asking about though? 
> Everything
> makes sense now?
> 
> David
> 
> --- Vaughan Jackson <[EMAIL PROTECTED]>
> wrote:
> > David,
> > 
> > I am sorry, I hadn't understood this before.
> > 
> > Thanks again,
> > Vaughan.
> > 
> > > -Original Message-
> > > From: David Winterfeldt
> > [mailto:[EMAIL PROTECTED]]
> > > Sent: Thursday, October 11, 2001 12:17 PM
> > > To: [EMAIL PROTECTED]
> > > Subject: RE: Questions About Struts Validator
> > > 
> > > 
> > > For Q2:
> > > You can override the default validator's error
> > message
> > > by specifying a msg element or you can change
> the
> > > defult of course.
> > > 
> > >   > >  depends="required,mask">
> > > > > key="registrationForm.lastname.maskmsg"/>
> > > > > key="registrationForm.lastname.displayname"/>
> > >  
> > >mask
> > >   
> ^[a-zA-Z]*$
> > >
> > >  
> > > 
> > > You can also specify different arguments to go
> > with
> > > different errors.
> > > 
> > >   > >  depends="required,integer,range">
> > > key="typeForm.integer.displayname"/>
> > > > > resource="false"/>
> > > > > resource="false"/>
> > >  
> > >min
> > >10
> > >
> > >  
> > >    max
> > >20
> > >
> > >  
> > > 
> > > David
> > > 
> > > 
> > > --- Vaughan Jackson
> > <[EMAIL PROTECTED]>
> > > wrote:
> > > > David,
> > > > 
> > > > Thanks for your feedback. 
> > > > 
> > > > I will try out the technique you describe for
> > Q1. 
> > > > 
> > > > I could have phrased Q2 better: "... and have
> a
> > > > different 
> > > > error message resulting according to which
> > rule(s)
> > > > is/are
> > > > broken?".
> > > > 
> > > > Yes, you have told me what I wanted to know
> for
> > Q3.
> > > > 
> > > > Vaughan.
> > > > 
> > > > > -Original Message-
> > > > > From: David Winterfeldt
> > > > [mailto:[EMAIL PROTECTED]]
> > > > > Sent: Thursday, October 11, 2001 10:36 AM
> > > > > To: [EMAIL PROTECTED]
> > > > > Subject: Re: Questions About Struts
> Validator
> > > > > 
> > > > > 
> > > > > 
> > > > > --- Vaughan Jackson
> > > > <[EMAIL PROTECTED]>
> > > > > wrote:
> > > > > > Hi,
> > > > > > 
> > > > > > Three questions in fact. Some variants on
>

Re: DB Connection Pooling

2001-10-19 Thread David Winterfeldt

Thanks.  This looks nice, but I'll probably just stick
with the Struts one for now since the connection can
refresh and I have a lot of other things to do on my
project.

David

--- Andy Noble <[EMAIL PROTECTED]> wrote:
> David,
> 
> One that appears popular here, and I'm also using is
> Poolman. It can be
> found at http://www.codestudio.com
> 
> Andy
> ----- Original Message -
> From: David Winterfeldt <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Friday, October 19, 2001 4:07 PM
> Subject: DB Connection Pooling
> 
> 
> > What would someone recommend for using as a
> connection
> > pool besides the Struts one?  Basically I'm
> looking
> > for a similiar product, but I want it to be able
> to
> > check if a connection has been lost or gone bad
> and
> > create a new one to replace the bad one.  I see
> that
> > there is a pool project in jakarta-commons, but it
> > doesn't seem like it is ready yet for production
> use.
> >
> > David
> >
> > __
> > Do You Yahoo!?
> > Make a great connection at Yahoo! Personals.
> > http://personals.yahoo.com
> >
> 


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



Re: DB Connection Pooling

2001-10-19 Thread David Winterfeldt

Sorry.  Never mind.  I just saw that there was support
added for refreshing the built in Struts Connection
Pool, but I didn't know about it.  You can add on of
these lines in a data-source element.



or




David

--- David Winterfeldt <[EMAIL PROTECTED]> wrote:
> What would someone recommend for using as a
> connection
> pool besides the Struts one?  Basically I'm looking
> for a similiar product, but I want it to be able to
> check if a connection has been lost or gone bad and
> create a new one to replace the bad one.  I see that
> there is a pool project in jakarta-commons, but it
> doesn't seem like it is ready yet for production
> use.
> 
> David
> 
> __
> Do You Yahoo!?
> Make a great connection at Yahoo! Personals.
> http://personals.yahoo.com


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



DB Connection Pooling

2001-10-19 Thread David Winterfeldt

What would someone recommend for using as a connection
pool besides the Struts one?  Basically I'm looking
for a similiar product, but I want it to be able to
check if a connection has been lost or gone bad and
create a new one to replace the bad one.  I see that
there is a pool project in jakarta-commons, but it
doesn't seem like it is ready yet for production use.

David

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



Re: html:errors

2001-10-19 Thread David Winterfeldt

I thought I would send this modified from what
Jonathan sent so it was clear how to add an error. 
The first parameter adding an error to ActionErrors is
the key it is filed under.  So typically you use the
property name of the field so it can be retrieved next
to the field if you need to.

ActionErrors errors = new ActionErrors();
errors.add(ActionErrors.GLOBAL_ERROR,
   new
ActionError("error.password.mismatch"));
errors.add("username",
   new ActionError("error.username"));

IN YOUR RESULTING JSP PAGE


Or if you are using a recent nightly build you can
iterate through your error messages helping to keep
html out of your message resources.


   
  
 
  
   


David

--- Jonathan Asbell <[EMAIL PROTECTED]> wrote:
> IN YOUR ACTION
> ActionErrors errors = new ActionErrors();
> if (myBoolean){errors.add(ActionErrors.GLOBAL_ERROR,
> new
> ActionError("error.password.mismatch"));
> 
> IN YOUR RESULTING JSP PAGE
> 
> 
> 
> - Original Message -
> From: "storck" <[EMAIL PROTECTED]>
> To: "User Struts (E-Mail)"
> <[EMAIL PROTECTED]>
> Sent: Friday, October 19, 2001 7:10 AM
> Subject: html:errors
> 
> 
> > Hi,
> >
> > COULD you help me!
> > Is there a possibility to write the ONLY the error
> for a CERTAIN property
> of
> > a FormBean out at a possition where I want it?
> > I have something in mind where I have a form with
> different inputfields
> and
> > if a field has a wrong value than I have a message
> under that field wich
> > tells me what is wrong!
> > Does someone has a (complete) example how I can
> mannage that? I think I
> saw
> > that some time ago but I dont know where anymore
> and for what I should
> > search for!
> >
> > MANY thanks!
> >
> 


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



Re: where should validation happen?

2001-10-18 Thread David Winterfeldt

I wanted to mention that the Validator validation
framework has some basic validations that tie
Javascript to the server side validations together. 
So you don't have to worry about the Javascript being
run because the server side validation will always
happen.  The validation framework is in the
contrib/validator directory of the nightly source and
it is also posted here:
http://home.earthlink.net/~dwinterfeldt

David

--- Francisco Hernandez <[EMAIL PROTECTED]> wrote:
> ActionErrors validate(ActionForm
> form,HttpServletRequest request)
> 
> in perform():
>  ActionErrors errors =
> validate(addressForm,request);
> if(!errors.empty()) {
> saveErrors(request, errors);
> forward = "editAddress";
> } else {
> // continue action..
> }
> 
> following your method ive done something like the
> following..
> I was thinking about the validation using Javascript
> but ive decided against
> it, since one can turn off javascript on the
> browser..
> - Original Message -
> From: "Robert Parker" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Thursday, October 18, 2001 4:07 PM
> Subject: Re: where should validation happen?
> 
> 
> > Essentially correct. Thus javascript on the
> browser ensures that a date is
> a
> > date, a number a number etc. I like this approach
> as I can hook the
> > validation code into the onchange event of the
> form fields and hence the
> > user gets immediate error feedback.
> >
> > In my action classes, they assemble the request
> data back into generic
> > non-web specific beans. These beans then get
> passed to methods of the
> > business logic classes. Now my action classes are
> coded to trap two types
> of
> > errors - application errors and system errors. A
> system error would be
> > things like the database going down. An
> application error would be
> something
> > like a dealer going over his dealing limit etc.
> These errors get added to
> > the response with the saveerrors() method call...
> >
> > regards
> >
> > Rob
> > - Original Message -
> > From: "Francisco Hernandez" <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Friday, October 19, 2001 7:55 AM
> > Subject: Re: where should validation happen?
> >
> >
> > > so basically i take it as if you dont do
> anything in your form beans
> > > validate method?
> > >
> > > and you handle all errors in your actions
> perform method and
> saveErrors()
> > > and forward back to the input screen?
> > >
> > >
> > >
> > > - Original Message -
> > > From: "Robert Parker"
> <[EMAIL PROTECTED]>
> > > To: <[EMAIL PROTECTED]>
> > > Sent: Wednesday, October 17, 2001 9:35 PM
> > > Subject: Re: where should validation happen?
> > >
> > >
> > > > From my experience there are some subtle
> details when using the
> > validate()
> > > > method of the form bean...
> > > >
> > > > The validate method is called unless you set
> the validate attribute in
> > the
> > > > struts config to false.
> > > >
> > > > If an error is found by your validate method,
> struts seems to delegate
> > > back
> > > > to the input (jsp) as specified in the config,
> hence your action
> > handlers
> > > > perform method is not called.
> > > >
> > > > My preference is to perform basic field/type
> validation in the browser
> > > using
> > > > javascript, and business type validation I
> handle via beans called
> from
> > my
> > > > action handler class.
> > > >
> > > > Letting struts call the validate() method for
> me has given me
> problems -
> > > as
> > > > I often have my action handlers populate say
> collections of lookup
> > values
> > > > for selection lists etc. Hence if struts does
> not call my perform
> > method,
> > > my
> > > > selection lists will be empty. Note I
> discovered this after I had
> > designed
> > > > my action handlers this way...
> > > >
> > > > regards
> > > >
> > > > Rob
> > > > - Original Message -
> > > > From: "Francisco Hernandez"
> <[EMAIL PROTECTED]>
> > > > To: <[EMAIL PROTECTED]>
> > > > Sent: Thursday, October 18, 2001 10:06 AM
> > > > Subject: Re: where should validation happen?
> > > >
> > > >
> > > > > im sorry thats the SaveRegistrationAction
> not SaveSubscriptionAction
> > > > > - Original Message -
> > > > > From: "Francisco Hernandez"
> <[EMAIL PROTECTED]>
> > > > > To: <[EMAIL PROTECTED]>
> > > > > Sent: Wednesday, October 17, 2001 5:01 PM
> > > > > Subject: where should validation happen?
> > > > >
> > > > >
> > > > > > in the struts example that comes with the
> stable release of struts
> > 1.0
> > > > > there
> > > > > > is a SaveSubscribtionAction and it does
> some validation of the
> > > > > > SubscribtionForm but theres also
> validation in the validate()
> method
> > > of
> > > > > the
> > > > > > SubscribtionForm, so my question is, whats
> the difference between
> > > using
> > > > > the
> > > > > > forms validation() method and validating
> data in the Action?
> > > > > >
>

RE: bean:message with bean

2001-10-18 Thread David Winterfeldt

I made a mistake in what I sent. It should be.


  


David

--- Fabien Modoux <[EMAIL PROTECTED]> wrote:
> David,
> 
> Thanks for your help.
> I misinterpreted the docs and thought I could use
> either key or name to get resources from file. I'll
> try something else...
> 
> -Fabien
> 
> -
> Fabien Modoux,
> Voicemate - http://www.voicemate.com
> 
> -Original Message-
> From: David Winterfeldt
> [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, October 18, 2001 6:45 PM
> To: [EMAIL PROTECTED]
> Subject: Re: bean:message with bean
> 
> 
> If they are message keys from the resource file,
> like
> msg.hello=Hello, then it should be key not name.
> 
> 
>   
> 
> 
> 
> The tag bean:write uses the name attribute (as do
> most
> other tags in one way or another).
> 
> 
> David
> 
> --- Fabien Modoux <[EMAIL PROTECTED]> wrote:
> > Hello,
> >
> > I am using the bean:message and the logic:iterate
> > tags
> > to print a collection of messages (Vector of
> > String):
> >
> > 
> >   
> > 
> >
> > I get an exception at
> >
> >
>
org.apache.jasper.compiler.TagBeginGenerator.validate(TagBeginGenerator.java
> > :149)
> >
> > saying,
> >
> > "According to the TLD attribute key is mandatory
> for
> > tag message"
> >
> > In the tld file, it is indeed mandatory, but
> > according to the
> > Javadoc I thought I would be able to do that. Is
> it
> > the right
> > way to do it?
> >
> > Thanks,
> >
> > -Fabien
> >
> > -
> > Fabien Modoux,
> > Voicemate - http://www.voicemate.com
> >
> 
> 
> __
> Do You Yahoo!?
> Make a great connection at Yahoo! Personals.
> http://personals.yahoo.com
> 


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



Re: bean:message with bean

2001-10-18 Thread David Winterfeldt

If they are message keys from the resource file, like
msg.hello=Hello, then it should be key not name.


  



The tag bean:write uses the name attribute (as do most
other tags in one way or another).


David

--- Fabien Modoux <[EMAIL PROTECTED]> wrote:
> Hello,
> 
> I am using the bean:message and the logic:iterate
> tags
> to print a collection of messages (Vector of
> String):
> 
> 
>   
> 
> 
> I get an exception at
> 
>
org.apache.jasper.compiler.TagBeginGenerator.validate(TagBeginGenerator.java
> :149)
> 
> saying,
> 
> "According to the TLD attribute key is mandatory for
> tag message"
> 
> In the tld file, it is indeed mandatory, but
> according to the
> Javadoc I thought I would be able to do that. Is it
> the right
> way to do it?
> 
> Thanks,
> 
> -Fabien
> 
> -
> Fabien Modoux,
> Voicemate - http://www.voicemate.com
> 


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



  1   2   3   >