struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From wbchm...@Ensign-BickfordInd.com
Subject RE: Validator problem (HELP ME PLS)
Date Fri, 21 Jun 2002 16:52:24 GMT

In an effort to get this resolved before I go home for the weekend, I 
have zipped up my application and posted it at the following URL

http://www.e-bind.com/plantsec.zip (2.5 mb)

I run everything here on Tomcat403.  There is a datasource defined in 
the struts-config, but you probably wont need to get that far to see 
what the problem is...  You should be able to drop this into your 
web-apps directory

The issue is not being able to get the error messages back from 
DynaFormValidator...
(Although something is in there)

You have my gratitude






-----Original Message-----
From: Chmura, William B. 
Sent: Friday, June 21, 2002 9:31 AM
To: struts-user
Subject: RE: Validator problem (or user problem... not sure which yet)



I did a logic:messagesPresent and it showed that there was some messages 

present.

Unfortunately neither

<html:errors/> 
or
<font color="Blue">
   <html:messages id="message" message="true" header="message.bullet">
        <bean:write name="message"/><BR>
   </html:messages>      
</font>

produces any output...



ARRRGGGGHHHHHHH.....

This is driving me absolutely insane...

If I can get this working before the weekend starts I will be ecstatic








-----Original Message-----
From: dwinterfeldt [mailto:dwinterfeldt@yahoo.com]
Sent: Thursday, June 20, 2002 5:01 PM
To: struts-user
Subject: RE: Validator problem (or user problem... not sure which yet)


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


--- wbchmura@Ensign-BickfordInd.com wrote:
> 
> the problem I was having was caused by the
> struts-config.xml file 
> defining the plug in like:
> 
> <plug-in
>
className="org.apache.struts.validator.ValidatorPlugIn">
>     <set-property property="pathnames" 
>
value="/WEB-INF/validator-rules.xml,/WEB-INF/validator.xml"/>
> </plug-in>
> 
> I took a look at the struts blank war and copied
> that syntax over which 
> is like this:
> 
> <plug-in
>
className="org.apache.struts.validator.ValidatorPlugIn">
>     <set-property property="pathname" 
> value="/WEB-INF/validator-rules.xml"/>
>     <set-property property="pathname"
> value="/WEB-INF/validator.xml"/>
> </plug-in>
> 
> 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
> 
>          <field property="employeeFirstName"
>              depends="required">
>                <arg0
> key="registrationForm.firstname.displayname"/>
>          </field>
> 
> -----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...
> 
> AAARRGGGGGHHHHHHH
> 
> -----Original Message-----
> From: Raffy.Lata [mailto:Raffy_Lata@ffic.com]
> 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 <form-bean> 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...
> 
> 
> 
> 
> 
> wbchmura@Ensign-BickfordInd.com on 06/19/2002
> 01:24:28 PM
> 
> Please respond to "Struts Users Mailing List"
>       <struts-user@jakarta.apache.org>
> 
> To:   struts-user@jakarta.apache.org
> cc:
> Subject:  RE: Validator problem (or user problem...
> not sure which yet)
> 
> 
> 
> Here is everything:
> 
> Thanks in advance for any solutions!
> 
> 
> Struts-config.xml
> ============================
> <?xml version="1.0" encoding="UTF-8"?>
> <!DOCTYPE struts-config PUBLIC "-//Apache Software
> Foundation//DTD
> Struts Configuration 1.1//EN"
>
"http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
> <struts-config>
> <data-sources><data-source key="MySql"><set-property
> property="autoCommit" value="false" /><set-property
> property="description" value="MySql" /><set-property
> property="driverClass"
> value="org.gjt.mm.mysql.Driver" /><set-property
> property="maxCount" value="4" /><set-property
> property="minCount"
> value="2" /><set-property property="password"
> value="vuud"
> /><set-property property="user" value="vuud"
> /><set-property
> property="url"
> value="jdbc:mysql://localhost/plantsecurity"
> /></data-source></data-sources>
> <form-beans>
> <form-bean name="formNewRequest"
> type="org.apache.struts.validator.DynaValidatorForm"
> dynamic="true">
> <form-property name="employeeFirstName"
> type="java.lang.String"
> initial="" />
> <form-property name="employeeLastName"
> type="java.lang.String"
> initial="" />
> <form-property name="contactInfo"
> type="java.lang.String" initial="" />
> <form-property name="vendorCompanyName"
> type="java.lang.String"
> initial="" />
> <form-property name="vendorEmployeeName"
> type="java.lang.String"
> initial="" />
> <form-property name="startDate"
> type="java.lang.String" initial="" />
> <form-property name="endDate"
> type="java.lang.String" initial="" />
> <form-property name="campus" type="java.lang.String"
> initial="Simsbury"
> />
> <form-property name="accessAreas"
> type="java.lang.String" initial="" />
> <form-property name="notes" type="java.lang.String"
> initial="" />
> </form-bean>
> 
> </form-beans>
> 
> <action-mappings>
> <action path="/index" parameter="" unknown="true"
> forward="plantsec.mainmenu"><forward name="success"
> path="plantsec.mainmenu" redirect="false"
> /></action>
> <action path="/todo" parameter=""
> forward="plantsec.todo" />
> 
> <action path="/createNew" parameter=""
> type="com.ebind.plantsec.create.actionCreateNew"
> name="formNewRequest"
> validate="true"
> input="plantsec.create.new"
> scope="request">
> 
> <forward name="continue" path="plantsec.create.new"
> redirect="false" />
> <forward name="success" path="plantsec.mainmenu"
> redirect="false" />
> </action>
> 
> <action path="/search" parameter=""
> type="com.ebind.plantsec.search.actionSearch" />
> <action path="/search1w" parameter="7"
> type="com.ebind.plantsec.search.actionSearch" />
> <action path="/search2w" parameter="14"
> type="com.ebind.plantsec.search.actionSearch" />
> <action path="/search4w" parameter="28"
> type="com.ebind.plantsec.search.actionSearch" />
> 
=== message truncated ===


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

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



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



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


Mime
View raw message