Re: Lost in beans

2003-02-05 Thread Matthew Meyer
I was actually looking for an easy way to do just this 
(nest Dynas) for 4 hours today..
The easiest hack(at least in my mind a hack) is to write a 
beanutils Converter to convert from a string to 
DynaActionFrom.
Then when DynaActionFormClass.newInstance() sets the 
inital property values have your converter registered, and 
make sure the inital property in the XML for you nested 
DynaForm it set to the DynaForm you want to use. Then just 
implement the converter to do

public Object convert(Class type, Object value){
   return 
DynaActionFormClass.getDynaActionFormClass((String)value).newInstance();

}

I have not tested this yet as I would like a better way 
but I would call it a decent 'HACK'.

Matt,

On Wed, 5 Feb 2003 15:32:03 -0600 
 Mike Ash [EMAIL PROTECTED] wrote:
Guess its time to look at contributing...geez more coding 
outside of
work...wife is going to love it

-Original Message-
From: J Beginner [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 05, 2003 3:31 PM
To: Struts Users Mailing List
Subject: RE: Lost in beans


Yes, I am back to extending ActionForm and
ValidatorForm.
I hope that nested DynaForms will be supported in the
near future.

--- Pani, Gourav [EMAIL PROTECTED]
wrote:
You can extend the ValidatorForm and use the
validator framework.

-Original Message-
From: Mike Ash [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 05, 2003 4:25 PM
To: 'Struts Users Mailing List'
Subject: RE: Lost in beans


So if your not using dynaforms are you back to
extending actionform?  If so
are you not using the validator framework either?

-Original Message-
From: J Beginner [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, February 05, 2003 3:19 PM
To: Struts Users Mailing List
Subject: Re: Lost in beans


This is exactly the same as to what I am trying to
do...no luck so far.
I reverted back to using no DynaForms.

--- Mike Ash [EMAIL PROTECTED] wrote:
 Is it possible or is there a better way to do
 something like
 
 
form-beans
   form-bean 
 name=User 



type=org.apache.struts.validator.DynaValidatorForm

  form-property name=fname
 type=java.lang.String /
  form-property name=lname
 type=java.lang.String /
 	form-bean
 	name=Addredd
 	   

type=org.apache.struts.validator.DynaValidatorForm
 
 	form-property name=street
 type=java.lang.String /
 	form-property name=city
 type=java.lang.String /
   	/form-bean
 /form-bean
form-beans
 
 
 Basically looking for a way to nest beans in the
 struts config and use them
 in forms/actions/validation.
 
 Thanks
 


__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up
now.
http://mailplus.yahoo.com


-

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



-

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




__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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


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




Re: Lost in beans

2003-02-05 Thread Matthew Meyer
I was thinking about this more on my way home from work.. :)  As far as
doing it as a hack I would simply implement and register the converter as
anonymous class.

form-bean
   name=NestedTestForm
   type=org.apache.struts.action.DynaActionForm
   form-property name=value type=java.lang.String /
/form-bean
form-bean
   name=TestForm
   type=org.apache.struts.action.DynaActionForm 
   form-property name=nested
type=org.apache.struts.action.DynaActionForm initial=NestedTestForm/
/form-bean

Then in your initServlet()...
import org.apache.commons.beanutils.ConvertUtils;
import org.apache.commons.beanutils.Converter;

ConvertUtils.register(new Converter(){
  public Object convert(Class type, Object value){
 return
DynaActionFormClass.getDynaActionFormClass((String)value).newInstance();
  }
   }, DynaActionForm.Class);

Then when the app initialized DynaActionFormClass.newInstance() is called
for a TestForm it looks for a converter for the class DynaActionForm to set
the initial value an passes it the name NestedTestForm.

Like I said before though didn't have time to test this today you might run
into other problems, and it would be much better if there was a permanent
solution..

Matt,



- Original Message -
From: Mike Ash [EMAIL PROTECTED]
To: 'Struts Users Mailing List' [EMAIL PROTECTED]
Sent: Wednesday, February 05, 2003 4:36 PM
Subject: RE: Lost in beans


 Now its getting interesting, I was starting to look at a converter
solution
 as well but didn't get anywhere, got some concrete example I could admire?

 -Original Message-
 From: Matthew Meyer [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, February 05, 2003 4:29 PM
 To: Struts Users Mailing List
 Subject: Re: Lost in beans


 I was actually looking for an easy way to do just this
 (nest Dynas) for 4 hours today..
 The easiest hack(at least in my mind a hack) is to write a
 beanutils Converter to convert from a string to
 DynaActionFrom.
 Then when DynaActionFormClass.newInstance() sets the
 inital property values have your converter registered, and
 make sure the inital property in the XML for you nested
 DynaForm it set to the DynaForm you want to use. Then just
 implement the converter to do

 public Object convert(Class type, Object value){
 return
 DynaActionFormClass.getDynaActionFormClass((String)value).newInstance();

 }

 I have not tested this yet as I would like a better way
 but I would call it a decent 'HACK'.

 Matt,

 On Wed, 5 Feb 2003 15:32:03 -0600
   Mike Ash [EMAIL PROTECTED] wrote:
 Guess its time to look at contributing...geez more coding
 outside of
 work...wife is going to love it
 
 -Original Message-
 From: J Beginner [mailto:[EMAIL PROTECTED]]
 Sent: Wednesday, February 05, 2003 3:31 PM
 To: Struts Users Mailing List
 Subject: RE: Lost in beans
 
 
 Yes, I am back to extending ActionForm and
 ValidatorForm.
 I hope that nested DynaForms will be supported in the
 near future.
 
 --- Pani, Gourav [EMAIL PROTECTED]
 wrote:
  You can extend the ValidatorForm and use the
  validator framework.
 
  -Original Message-
  From: Mike Ash [mailto:[EMAIL PROTECTED]]
  Sent: Wednesday, February 05, 2003 4:25 PM
  To: 'Struts Users Mailing List'
  Subject: RE: Lost in beans
 
 
  So if your not using dynaforms are you back to
  extending actionform?  If so
  are you not using the validator framework either?
 
  -Original Message-
  From: J Beginner [mailto:[EMAIL PROTECTED]]
  Sent: Wednesday, February 05, 2003 3:19 PM
  To: Struts Users Mailing List
  Subject: Re: Lost in beans
 
 
  This is exactly the same as to what I am trying to
  do...no luck so far.
  I reverted back to using no DynaForms.
 
  --- Mike Ash [EMAIL PROTECTED] wrote:
   Is it possible or is there a better way to do
   something like
  
  
  form-beans
 form-bean
   name=User
  
  
 
 type=org.apache.struts.validator.DynaValidatorForm
form-property name=fname
   type=java.lang.String /
form-property name=lname
   type=java.lang.String /
   form-bean
   name=Addredd
  
  
  type=org.apache.struts.validator.DynaValidatorForm
   
   form-property name=street
   type=java.lang.String /
   form-property name=city
   type=java.lang.String /
 /form-bean
   /form-bean
  form-beans
  
  
   Basically looking for a way to nest beans in the
   struts config and use them
   in forms/actions/validation.
  
   Thanks
  
 
 
  __
  Do you Yahoo!?
  Yahoo! Mail Plus - Powerful. Affordable. Sign up
  now.
  http://mailplus.yahoo.com
 
 
 -
  To unsubscribe, e-mail:
  [EMAIL PROTECTED]
  For additional commands, e-mail:
  [EMAIL PROTECTED]
 
 
 -
  To unsubscribe, e-mail:
  [EMAIL PROTECTED]
  For additional commands, e-mail:
  [EMAIL PROTECTED

Re: socket write error when using tiles

2003-02-04 Thread Matthew Meyer
On Tue, 4 Feb 2003 08:32:30 -0500 
 [EMAIL PROTECTED] wrote:


I have socket write error when using tiles.
I suppose it is because users click on other action 
before the last tile is
displayed. I have so many of these that I suspect this 
can cause performance
issues. Anyone can explain or knows how to correct this. 
The pages display
fine. I am using WSAD and WebSphere.

Thank you.
Stephan


I am having this same problem. I'm running 1.1b2 in WTE. 
I'm sure that all of that exception handeling is causing 
some performance problems. Is this fixed in b3 or is this 
something we are doing wrong as developers?

Matt,


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



Re: hashmaps and hash tables in JSPs

2003-02-03 Thread Matthew Meyer
You might looks at useing roles to acomplish this external 
to the JSP, AKA leave to logic out of the view, but 
otherwise a Hashmap can be checked as a map backed 
property like so..
logic:present name='permissionsHashMap' property='Manage 
Countires'

although I don't know how it will handle spaces in the 
property names..

On Mon, 3 Feb 2003 15:02:02 +0100
 Jordan Thomas [EMAIL PROTECTED] wrote:
HI,

I have a hastable or Hashmap of permissions that I want 
to use in my JSP
pages to determine what info is displayed to the user.



For instance I want to have the following logic

if permissionsHashMap has key Manage Countires
  then display this
if permissionsHashMap has key Manage Logins
  then display this

etc

Is there a way to do this with the struts logic tags?

thanks

Jordan


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



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




Re: hashmaps and hash tables in JSPs

2003-02-03 Thread Matthew Meyer
you can access hashmap values by name without the map(val) 
notation.. this helps alot if you don't want to wrap the 
mapback property in a bean. for example..

logic:present name='wraperBean' property='map(val)'
can be done with the same map but without the wrapper bean 
like..
logic:present name='map' property='val'

I'm not sure if it's suppoed to work with way but it does, 
at least in 1.1b2

Matt,
 
On Mon, 3 Feb 2003 09:34:30 -0500
 Jerome Jacobsen [EMAIL PROTECTED] 
wrote:
Woops, that logic:notEmpty example isn't right!  Not sure 
how you'd do it
with logic:notEmpty without the permissionsHashMap being 
a property of
another bean, say permissionsBean.  In that case it would 
look like this:

logic:notEmpty name=permissionsBean 
property=permissionsHashMap(Manage
Countries)
  ... User has the Manage Countries permission
/logic:notEmpty


-Original Message-
From: Jerome Jacobsen 
[mailto:[EMAIL PROTECTED]]
Sent: Monday, February 03, 2003 9:19 AM
To: Struts Users Mailing List
Subject: RE: hashmaps and hash tables in JSPs


logic:notEmpty name=session 
property=permissionsHashMap(Manage
Countries)
 ... User has the Manage Countries permission
/logic:notEmpty

Or with JSTL

c:if test=${permissionsHashMap['Manage Countries']}
 ... User has the Manage Countries permission
/c:if


 -Original Message-
 From: Jordan Thomas [mailto:[EMAIL PROTECTED]]
 Sent: Monday, February 03, 2003 9:02 AM
 To: Struts User List
 Subject: hashmaps and hash tables in JSPs


 HI,

 I have a hastable or Hashmap of permissions that I 
want to use in my JSP
 pages to determine what info is displayed to the user.



 For instance I want to have the following logic

 if permissionsHashMap has key Manage Countires
   then display this
 if permissionsHashMap has key Manage Logins
   then display this

 etc

 Is there a way to do this with the struts logic tags?

 thanks

 Jordan


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





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





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



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




Re: one desing question, Revisited

2003-01-31 Thread Matthew Meyer
What you will want to is make your commonFunctions an 
interface. Next write a class to implement all of your 
common functions. Then Write your action extending Action 
and implementing your commonFunctions interface. Make your 
common funtions an instance variable of your action and 
then simply delegate all the commonFunction messages your 
action recieves to your commonFunction instance variable 
like so:
public  method(..., ) {
   return commonFuntionInstance.method(, );
}
Hope this helps you out...

Matt,


On Fri, 31 Jan 2003 07:45:22 -0800 (PST)
 Ashish Kulkarni [EMAIL PROTECTED] wrote:
Hi,
I know java does not allow multiple inheritance, but I
gave that example so i can make it clear what i want
to do,
So i want to find out a work around to achieve what i
have explanned in the example
Ashish
--- Jacob Hookom [EMAIL PROTECTED] wrote:

I'm going to save you from getting flamed java
does not allow multiple
inheritance.  You can only extend from a single
Object.

-Jacob

| -Original Message-
| From: Ashish Kulkarni
[mailto:[EMAIL PROTECTED]]
| Sent: Friday, January 31, 2003 9:34 AM
| To: [EMAIL PROTECTED]
| Subject: one desing question, Revisited
| 
| Hi,
| 
| When i was thinking about my problem, I think what
i
| want to do in multiple inhereteance
| I want to define a class called CommonFunctions ,
this
| call will have methods which are common, (As name
| suggest)
| now i have to do some thing like
| public class MyAction extends Action,
CommonFuntions
| 
| and public class MyDisptachAction extends
| DispatchAction, CommonFuntions
| 
| By doing this i will be able to access all the
methods
| in the class which sybclasses MyAction or
| MyDispatchAction
| I know the code above is not possible to do, but i
| want to do some thing like that..
| So what are the ways of achieving it
| 
| =
| A$HI$H
| 
| __
| Do you Yahoo!?
| Yahoo! Mail Plus - Powerful. Affordable. Sign up
now.
| http://mailplus.yahoo.com
| 
|

-

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




-

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




=
A$HI$H

__
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

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



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




Re: one desing question, Revisited

2003-01-31 Thread Matthew Meyer
The interface provides both flexability in the 
delegation(aka different versions of the common funtions 
can exist), and it enforces an API.
Interfaces don't need to be logically functional objects. 
When was the last time you cast an object to Serializable 
and manipulated it?

Matt,


On Fri, 31 Jan 2003 17:23:29 +0100
 Malik Recoing [EMAIL PROTECTED] wrote:
I Ask : What the real apport of implementing 
CommonFunctionInterface in
each classes rather than just using common.aFunction() 
where you need it ?
(but maintaining more code).

Malik.

Friday, January 31, 2003 5:17 PM , Ashish Kulkarni
[EMAIL PROTECTED] a écrit :
Hi
Thanx for the all the mails, this is what i plan to do
public interface CommonFunctionInterface{
// all my common methods;
   public Connection getConnection();

}

public class CommonFunction implements
CommonFunctionInterface{

public Connection getConnection(){
// provide the implementation here

}
}

public class MyAction extends Action implements
CommonFunctionInterface{
private final CommonFunction common;

public MyAction(){
common = new CommonFunction();
}

public Connection getConnnection(){
return common.getConnection();
}

}

public MyClass extends MyAction{
// now you should inherit getConnection()
without problem }


Ashish


--- John Espey [EMAIL PROTECTED] wrote:
 sorry, the action wouldn't pass itself, it would
 pass its class.

 -Original Message-
 From: John Espey [mailto:[EMAIL PROTECTED]]
 Sent: Friday, January 31, 2003 10:10 AM
 To: Struts Users Mailing List
 Subject: RE: one desing question, Revisited


 You could create a CommonFunctionsFactory, with a
 method:

 CommonFunctions getCommonFunctionsByClass(Class)

 Your action could pass itself to this call to
 retrieve a CommonFunctions
 implementation, determined by the Factory, which
 could look up in a
 properties file which implementation to create for
 the specified class.  You
 wouldn't really need to have your action implement
 CommonFunctions.  If you
 needed to modify the behavior of your
 CommonFunctionsImpl for a given action
 class, you could extend CommonFunctionsImpl, and
 then map the action class
 to that new subclass.

 -Original Message-
 From: Matthew Meyer [mailto:[EMAIL PROTECTED]]
 Sent: Friday, January 31, 2003 10:00 AM
 To: Struts Users Mailing List
 Subject: Re: one desing question, Revisited


 What you will want to is make your commonFunctions
 an
 interface. Next write a class to implement all of
 your
 common functions. Then Write your action extending
 Action
 and implementing your commonFunctions interface.
 Make your
 common funtions an instance variable of your action
 and
 then simply delegate all the commonFunction messages
 your
 action recieves to your commonFunction instance
 variable
 like so:
  public  method(..., ) {
 return commonFuntionInstance.method(,
 );
  }
 Hope this helps you out...

 Matt,


 On Fri, 31 Jan 2003 07:45:22 -0800 (PST)
   Ashish Kulkarni [EMAIL PROTECTED]
 wrote:
  Hi,
  I know java does not allow multiple inheritance,
 but I
  gave that example so i can make it clear what i
 want
  to do,
  So i want to find out a work around to achieve what
 i
  have explanned in the example
  Ashish
  --- Jacob Hookom [EMAIL PROTECTED] wrote:
   I'm going to save you from getting flamed
 java
   does not allow multiple
   inheritance.  You can only extend from a single
   Object.
  
   -Jacob
  
-Original Message-
From: Ashish Kulkarni
   [mailto:[EMAIL PROTECTED]]
Sent: Friday, January 31, 2003 9:34 AM
To: [EMAIL PROTECTED]
Subject: one desing question, Revisited
   
Hi,
   
When i was thinking about my problem, I think
 what
   i
want to do in multiple inhereteance
I want to define a class called CommonFunctions
 ,
   this
call will have methods which are common, (As
 name
suggest)
now i have to do some thing like
public class MyAction extends Action,
   CommonFuntions
   
and public class MyDisptachAction extends
DispatchAction, CommonFuntions
   
By doing this i will be able to access all the
   methods
in the class which sybclasses MyAction or
MyDispatchAction
I know the code above is not possible to do,
 but i
want to do some thing like that..
So what are the ways of achieving it
   
=
A$HI$H
   
   
 __
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign
 up
   now.
http://mailplus.yahoo.com
   
   
  

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

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

Re: log4j problem

2003-01-30 Thread Matthew Meyer
I am having a simmilar problem. I'm useing Struts 1.1b2 
within WTE 3.5. The digester and requestProcessor refuse 
to quit logging not matter what I set the log levels at. 
I'm guessing I'm just not finding the correct 
configuration file, but it's really getting annoying. 

Matt,

On Thu, 30 Jan 2003 11:09:10 +0100
 De Cesco, Jonathan [EMAIL PROTECTED] wrote:
Hi all,
I was using Log4J with struts1.0 with no problem. When I 
updated to
struts1.1b3, messages from Struts like RequestProcessor 
Processing a POST
request for path url are logged using my webapp log4j 
configuration file.
The problem is I don't want struts to log these messages 
but it keeps using
my log4J configuration once it finds it.
anyone 

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


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




Re: How to instantiate a DynaValidatorForm

2003-01-30 Thread Matthew Meyer
Your Action gets passed a copy of the actionForm object 
that it is useing. So specify the name of your 
DynaValidatorForm in the name property of your action's 
definition. Then populate the actionForm oject in your 
action and forward to the JSP that expects a populated 
DynaValidatorForm..

Matt

}
On Thu, 30 Jan 2003 17:23:47 +0100
 Boris Folgmann [EMAIL PROTECTED] wrote:
I've defined a DynaValidatorForm in struts-config.xml 
without any classfile
in WEB-INF/classes. A JSP using this Form for data input 
and validation
works well. But how can I instantiate an object of this 
DynaValidatorForm?
I need to generate an array of form objects so that I can 
print them using
logic:iterate in a table.
Using new org.apache.struts.validator.DynaValidatorForm() 
is wrong, because
I need an object of the derived class and not the base 
class. So what's the
 class name of the Form?

Hope somebody can help.

tnx,
	boris


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


TEXTAREA NAME=Signature ROWS=4 COLS=60TEXTAREA 
NAME=Signature ROWS=4 COLS=60TEXTAREA 
NAME=Signature ROWS=4 COLS=60TEXTAREA 
NAME=Signature ROWS=4 COLS=60TEXTAREA 
NAME=Signature ROWS=4 COLS=60TEXTAREA 
NAME=Signature ROWS=4 COLS=60TEXTAREA 
NAME=Signature ROWS=4 COLS=60TEXTAREA 
NAME=Signature ROWS=4 COLS=60

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



Re: How to instantiate a DynaValidatorForm

2003-01-30 Thread Matthew Meyer
If you are useing the DynaForm to hold the list just make 
sure you put the array into the DynaForm, under a 
predifined property name that has the same type(Array, 
List, ..) Then:

logic:iterate name='dynaFormName' 
property='indexedProtertiesName' 
id='nameToUseForElements'
   bean:write name='nameToUseForElements' 
property='userName'/
   bean:write name='nameToUseForElements' 
property='email'/
/logic:iterate

or even better nested within approprite form tags:

nested:iterate property='indexedProtertiesName'
   nested:write property='userName'/
   nested:write property='email'/
/nested:iterate


On Thu, 30 Jan 2003 18:18:01 +0100
 Boris Folgmann [EMAIL PROTECTED] wrote:
Matthew Meyer wrote:

Your Action gets passed a copy of the actionForm object 
that it is useing. So specify the name of your 
DynaValidatorForm in the name property of your action's 
definition. Then populate the actionForm oject in your 
action and forward to the JSP that expects a populated 
DynaValidatorForm..

That seems to be the right method for e.g. editing one 
record in a
database. Tnx, that's what I need next.

But what should I use as the data source for 
logic:iterate, when I need
multiple objects? Here's how I did it with a simples 
ActionForm, a static
Function of the Form returning an array:

/** Query all users from db
 */
public static UserEditForm[] getUserList() throws 
SQLException
{
	UserEditForm[] users = null;
	...
	users = new UserEditForm[num_users];
	
	for (int i = 0; rs.next(); i++)
	{
		UserEditForm u = new UserEditForm();
		u.setUsername(rs.getString(username));
		u.setEmail(rs.getString(email));
		users[i] = u;
		...
	}
	...
	return users;
}

--
Dipl.-Inf. Boris Folgmann   mailto:[EMAIL PROTECTED]
Folgmann IT-Consulting  http://www.folgmann.de


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



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




Re: logic:empty AND logic:notEmpty Both executing?

2003-01-30 Thread Matthew Meyer
I saw this once and couldn't figure it out. Then I reaized 
that the taglibs weren't defined in the JSP and that they 
were being evaluated.. Do a view source from your browser, 
to verify this.. Hope This solves your problem, because 
it's nice when they are easy to fix.

Matt,


On Thu, 30 Jan 2003 13:41:17 -0500 (EST)
 Michael P. Jones [EMAIL PROTECTED] wrote:
Hello-

I have an object that is null (that is what the log says) 
however the 
logic:empty and logic:notEmpty tags are both executing 
the nested body.

JSP code:

logic:notEmpty name=pageBean 
property=tripReport.currentTripPage.currentImage/
NOT EMPTY
br
/logic:notEmpty

logic:empty name=pageBean 
 property=tripReport.currentTripPage.currentImage/
EMPTY
br
/logic:empty

I have a log message in my 
currentTripPage.getCurrentImage() method. The 
log message says that currentImage is null and that is 
what it is 
returning when the method is getting called.

I am running jakarta-struts-1.1-b3 and Apache 
Tomcat/4.0.6.

Any ideas?

Thanks in advance-
Michael



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



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




Nesting DynaValidatorForms

2003-01-30 Thread Matthew Meyer
I was wondering if there was a way to either nest 
DynaValidatorForms, or any other way to use more than one 
DynaValidatorForm in the same view/action?
The big gotcha if that I still need validation to 
function. Can I use nested property notation in the 
validation.xml?
Any help or experience on this would be apreciated..

Thanks,
Matt

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



Re: [VALIDATOR] requiredif ??

2003-01-30 Thread Matthew Meyer
Is there any reason that none of the books, or docs 
discuss writeing javascript pluggable validators. I wrote 
my own xorDependency pluggable javascript validator, one 
field or the other field required but not both. It takes 
one var named secondField that tells it the other field in 
the ValidatorForm to check.
I also wrote a andDependancy, that check to that a second 
and an optional third field are exist, if any one othe the 
three exist nice for things like optional three field 
phone numbers. Takes one var named secondField and an 
optional var thirdField.

On Thu, 30 Jan 2003 14:29:55 -0500
 Sri Sankaran [EMAIL PROTECTED] wrote:
Man, that looks convoluted.

Sri


-Original Message-
From: PILGRIM, Peter, FM [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, January 30, 2003 1:03 PM
To: 'Struts Users Mailing List'
Subject: RE: [VALIDATOR] requiredif ??


In the Struts User Guide there is a large example with 
indexed properties.

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

PS: I spend today resurrecting an old programmatical 
validation 
from a previous project. 
--
Peter Pilgrim,
Struts/J2EE Consultant, RBoS FM, Risk IT
Tel: +44 (0)207-375-4923


 -Original Message-
 From: Wendy Smoak [mailto:[EMAIL PROTECTED]]
 Sent: 30 January 2003 17:41
 To: 'Struts Users Mailing List'
 Subject: RE: [VALIDATOR] requiredif ??
 
 
 
 I'm Still struggling with requiredif... there doesn't 
seem to
 be a working
 example of it included with 1.1b3.  I've gone through 
the 
 documentation and
 come up with this.  I'm trying to say that address is 
required only if
   1. prospect is null
   2. prospectNameOrId is not null
   3. action is not equal to Add Prospect
 
 field property=address depends=requiredif
   arg0 key=label.prospect.address/
   var
 var-namefield[0]/var-name
 var-valueprospect/var-value
   /var
   var
 var-namefield-test[0]/var-name
 var-valueNULL/var-value
   /var
   var
 var-namefield[1]/var-name
 var-valueprospectNameOrId/var-value
   /var
   var
 var-namefield-test[1]/var-name
 var-valueNOTNULL/var-value
   /var
   var
 var-namefield[2]/var-name
 var-valueaction/var-value
   /var
   var
 var-namefield-test[2]/var-name
 var-valueNOTEQUAL/var-value
   /var
   var
 var-namefield-value[2]/var-name
 var-valueAdd Prospect/var-value
   /var
   var
 var-namefield-join/var-name
 var-valueAND/var-value
   /var
 /field
 
 Thanks,
 
 --
 Wendy Smoak
 Applications Systems Analyst, Sr.
 Arizona State University PA Information Resources 
Management
 



  Visit our Internet site at 
http://www.rbsmarkets.com

This e-mail is intended only for the addressee named 
above.
As this e-mail may contain confidential or privileged 
information,
if you are not the named addressee, you are not 
authorised to
retain, read, copy or disseminate this message or any 
part of it.
The Royal Bank of Scotland plc is registered in Scotland 
No 90312
Registered Office: 36 St Andrew Square, Edinburgh EH2 
2YB
Regulated by the Financial Services Authority


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



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



  validator name=andDependency
classname=org.glhec.fastadminas.util.StrutsValidator
   method=validateAndDependency
 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.andRequired

 javascript![CDATA[
function validateAndDependency(form) {
var bValid = true;
var focusField = null;
var i = 0;
var fields = new Array();
oDependant = new andDependency();
for (x in oDependant) {
if ((
((form[oDependant[x][0]].type == 'text' ||
  form[oDependant[x][0]].type == 'textarea' ||
  form[oDependant[x][0]].type == 'select-one' ||
  form[oDependant[x][0]].type == 'radio' ||
  form[oDependant[x][0]].type == 'password') 
  form[oDependant[x][0]].value != '') ||

((form[oDependant[x][2](secondField)].type == 'text' ||
  form[oDependant[x][2](secondField)].type == 'textarea' ||