[Validator] - Strange behaviour and not validating

2002-11-21 Thread Axel Stahlhut
Hi.

I encounter a strange behaviour of the Struts-Validator (Struts 1.1b2):
In validator.xml I set up the following rules:

field property=glEmpId
depends=required,long
arg0 key=ab/
arg1 key=error.required/
/field
field property=name
depends=required
arg0 key=global.name/
arg1 key=error.required/
/field

Inside the form I've got the following:
html:select property=glEmpId
html:option value=xbean:message
key=global.yourSelection//html:option
/html:select

The Validator validates the field name correct. The field glEmpId is not
validated at all! It doesnt matter if I send the x or an empty String, in
both cases one of the Validators (required or long) should generate an
ActionError, shouldn't it? What am I doing wrong here?

By the way, does anybody know, why the validator example in the newest
Struts nightly builds (which iI don't use) is broken? Will it be fixed?

Thanks
Axel



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




[Validator] Not validating any more since update? - Urgent

2002-11-18 Thread Axel Stahlhut
Hi.

After updating struts and all common libs (including common-validator) from
nightly-build 2002-07-31 to nightly-build 2002-11-11 (and later on
nightly-build 2002-11-18, too), all our forms usually validated by the
Struts-Validator-Framework are not validated any more. It seems as if all
that validator methods are not called any more. After taking the old libs,
everything works out fine again.
We raised our debug-level to DEBUG for org.apache.struts.validator and
org.apache.commons.validator. The only thing i can find in the logfiles is
the loading of validator.xml and validator-rules.xml.

Any suggestions? Does anybody know what has happened here?

Thanks in advance.
Axel



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




DBCP borrowObject failed

2002-11-12 Thread Axel Stahlhut
Hi.
I'm having a problem with the Commons-Pool. Using Struts NightlyBuild from
2002-11-11, I have a DataSource configured in my struts-config:

 data-source type=org.apache.commons.dbcp.BasicDataSource
   key=org.apache.struts.action.DATA_SOURCE
   set-property property=defaultAutoCommit
 value=false/
   set-property property=defaultReadOnly 
 value=false/
   set-property property=driverClassName
 value=org.gjt.mm.mysql.Driver/
   set-property property=maxActive
 value=20/
   set-property property=maxIdle 
 value=10/
   set-property property=password
 value=/
   set-property property=url

value=jdbc:mysql://localhost:3306/videodb?autoReconnect=true/
   set-property property=username
 value=xxx/
  /data-source

I am able to access 3 times, update a result set. After that I get the
following exception:

java.lang.NullPointerException
   at com.mysql.jdbc.Connection.execSQL(Unknown Source)
   at com.mysql.jdbc.Connection.execSQL(Unknown Source)
   at com.mysql.jdbc.Connection.setAutoCommit(Unknown Source)
   at
org.apache.commons.dbcp.DelegatingConnection.setAutoCommit(DelegatingConnect
ion.java:237)
   at
org.apache.commons.dbcp.PoolableConnectionFactory.activateObject(PoolableCon
nectionFactory.java:273)
   at org.apache.commons.pool.impl.GenericObjectPool.borrowObject(Unknown
Source)
   at
org.apache.commons.dbcp.AbandonedObjectPool.borrowObject(AbandonedObjectPool
.java:117)
...

On the commandline i have the following output: DBCP borrowObject failed
Does anybody know, what is happening? Any help is appreciated.

Axel





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




Upload-Example problem, IllegalArgumentException

2002-11-08 Thread Axel Stahlhut
Hi.

I want to work with file uploads into DB or into the filesystem. After
installing the struts-upload-example, I tested it. If there is a file
selected in the form or there is some dummy-text in the hml:file - tag (no
path to an existant file), everything works fine.
If I submit the form without anything or just blanks in the hml:file - tag,
I'm getting an java.lang.IllegalArgumentException:

java.lang.IllegalArgumentException: argument type mismatch
at java.lang.reflect.Method.invoke(Native Method)
at
org.apache.commons.beanutils.PropertyUtils.setSimpleProperty(PropertyUtils.j
ava:1650)

What do I have to do to avoid this? In the application, i can not
force the user to fill this form, because it is just an optional element of
a much bigger form.
Any help is appreciated.
Axel



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




Re: Back Button Shown 'Page Expired' on IE ..... What really happens? ....

2002-09-11 Thread Axel Stahlhut

I encountered this problem/strange behaviour because simply the cache of IE
was full. Deleting the Temporary Internet Files solved it.
Maybe that helps.

Axel

- Original Message -
From: Trieu, Danny [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Sent: Tuesday, September 10, 2002 8:55 PM
Subject: RE: Back Button Shown 'Page Expired' on IE . What really
happens? 


 No, this has nothing to do with no-cache setting.  Even with Struts
setting
 for the controller setting to be no-cache, I still sometime see this
happens
 on form submittion.  Yes, I do understand that you can set no-cache on
 response header, or html meta data setting, but I don't understand why it
 happens sometime with form submittion, especially file upload.

 Thanks,

 danny

 -Original Message-
 From: Ashish Kulkarni [mailto:[EMAIL PROTECTED]]
 Sent: Tuesday, September 10, 2002 11:43 AM
 To: Struts Users Mailing List
 Subject: Re: Back Button Shown 'Page Expired' on IE . What really
 happens? 


 Hi,
 check if u have following lines in your html
 meta http-equiv=Pragma content=no-cache
 meta http-equiv=Cache-Control content=no-cache
 meta http-equiv=Expires content=-1
 or following code in your jsp
 %response.setHeader(Cache-Control,no-store);%
 if yes, then it tells the browser that is should not
 load the page from cache and load a fresh page , and
 so u get that message
 Ashish
 --- Trieu, Danny [EMAIL PROTECTED] wrote:
  Browser diplay messages saying the page has been
  expired when I hit the back
  button after I submitted a form.  Can someone point
  out what happens?
 
  Thanks,
 
  Danny.
 


 =
 A$HI$H

 __
 Yahoo! - We Remember
 9-11: A tribute to the more than 3,000 lives lost
 http://dir.remember.yahoo.com/tribute

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




[VALIDATOR] Validating Date with DynaValidator

2002-09-03 Thread Axel Stahlhut

Sorry for posting this one again, but its a bit urgent and maybe i have a chance 
marking it as a post concerning [Validator].

Validating a Date with the Struts-Validator Framework works fine, but if the field i 
want to validate is not a required field and may be empty, the validator always 
reports an error, even if if i remove the depends=required in the 
validation-rules.xml. 
Do i have to implement the Validator-class in a way that it doesnt validate empty 
dates or is there any declarative way to solve this?
Thanks for any help.

Axel

This is my validation-rules.xml:

  validator name=date
classname=org.apache.struts.util.StrutsValidator
   method=validateDate
 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.date
   jsFunctionName=DateValidations

and the validation.xml:

field property=beginEmployment depends=date
arg0 key=personal.data.beginEmployment /
var
var-namedatePattern/var-name
var-valuedd.MM./var-value
/var
/field





Problems using the date-Validator with non required attributes

2002-09-01 Thread Axel Stahlhut

With the Struts-Validator Framework i want to validate a Date. 
This works fine, but if the field i want to validate is not a required field and may 
be empty, the validator always reports an error, even if if i remove the 
depends=required. 
Do i have to implement the Validator-class in a way that it doesnt validate empty 
dates or is there any declarative way to solve this?
Thanks for any help.

Axel

This is my validation-rules.xml:

  validator name=date
classname=org.apache.struts.util.StrutsValidator
   method=validateDate
 methodParams=java.lang.Object,
   org.apache.commons.validator.ValidatorAction,
   org.apache.commons.validator.Field,
   org.apache.struts.action.ActionErrors,
   javax.servlet.http.HttpServletRequest
  depends=required
  msg=errors.date
   jsFunctionName=DateValidations

and the validation.xml:

field property=beginEmployment depends=date
arg0 key=personal.data.beginEmployment /
var
var-namedatePattern/var-name
var-valuedd.MM./var-value
/var
/field




Reminding selected Objects in Struts

2002-08-21 Thread Axel Stahlhut

Hi all,

we're developing a more or less complex application with a quite lot of actions (all 
of us quite new in Struts). Some of them concern about a selected Object (location), 
actions like edit, delete, create, addxxx, addyyy. We splitted the application into 
very fine-grained actions.

What is the best way in Struts to remember the selected objects? Writing them into the 
session is fine, but wehen exactly do i best remove the attributes then? Any other 
ideas?

Thanks for your help
Axel Stahlhut






Problem validating dynamic Form with Validator-Framework

2002-07-31 Thread Axel Stahlhut

Hi, I've gfot problems with the validation Framework. (Struts 1.1b)
If i try to validate a DynaValidatorForm I get the following error:
java.lang.NullPointerException
at 
org.apache.struts.action.DynaActionForm.getDynaProperty(DynaActionForm.java:539)
at org.apache.struts.action.DynaActionForm.set(DynaActionForm.java:357)
at org.apache.struts.action.DynaActionForm.reset(DynaActionForm.java:158)
at 
org.apache.struts.validator.DynaValidatorForm.reset(DynaValidatorForm.java:357)
at org.apache.struts.util.RequestUtils.createActionForm(RequestUtils.java:618)
at 
org.apache.struts.action.RequestProcessor.processActionForm(RequestProcessor.java:349)
at de.neusta.j2ee.struts.NeustaRequestProcessor.process(Unknown Source)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1109)
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:452)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at 
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
at 
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at 
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
at 
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at 
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)
at 
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at 
org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
at 
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2343)
at 
org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
at 
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at 
org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)
at 
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at 
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)
at 
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)
at 
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at 
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
at 
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)
at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)
at 
org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1012)
at 
org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1107)
at java.lang.Thread.run(Thread.java:484)

My struts-config (extracts):
  form-bean name=createStandortForm 
type=org.apache.struts.validator.DynaValidatorActionFormform-property name=name 
type=java.lang.String initial= /form-property name=street 
type=java.lang.String initial= /form-property name=city 
type=java.lang.String initial= /form-property name=zipCode 
type=java.lang.String initial= /form-property name=description 
type=java.lang.String initial= /form-property name=phone 
type=java.lang.String initial= /form-property name=fax type=java.lang.String 
initial= /form-property name=mobile type=java.lang.String initial= 
/form-property name=locType type=java.lang.String initial= 
//form-bean/form-beans
action path=/StandortErzeugen name=createStandortForm scope=session 
validate=true input=/StandortErzeugen 
type=de.neusta.fortuna.webapp.standort.CreateStandortAction  forward 
name=success path=/Standort/StandortErzeugen.jsp /  forward 
name=created path=/StandortVerwaltung.do /  /action
  plug-in className=org.apache.struts.validator.ValidatorPlugIn
set-property property=pathnamevalue=/WEB-INF/validator-rules.xml/
set-property property=pathname value=/WEB-INF/validator.xml/  
/plug-in/struts-config


DynaActionForm and reset method called always

2002-07-30 Thread Axel Stahlhut

Hi.

I switched to Struts1.1 beta now and I wonder if there is a way to avoid the framework 
from resetting the DynaActionForm on every request. This is because i reshow the view 
to the user to commit the data. The, in the second request, which is not send by a 
form, i wnat to insert the values inside the FormBean into the business tier. With the 
old FormBeans, everything worked out fine, because I didnt implement reset(...).

The DynaActionForms are always resetted. Is there a way to prevent this without 
deriving? If not, what is this DynaActionClass about? If i simply derive 
DynaActionForm and overwrite reset(...), i get a null pointer exception in here:
 sb.append(getDynaClass().getName());

Who or what sets the dynaClass-member?

Greets Axel