RE: version 1.2

2004-03-20 Thread Erez Efrati
Ted,

Thanks a lot for clearing this issue.

Erez

-Original Message-
From: Ted Husted [mailto:[EMAIL PROTECTED] 
Sent: Sunday, March 21, 2004 1:22 AM
To: Struts Users Mailing List
Subject: RE: version 1.2

As Joe mentioned, we no longer use the "beta-beta-beta-final" versioning
scheme.

We now use an "immutable" versioning scheme, like that used by the
Apache HTTPD project, Jakata Tomcat, and many others.

Each release is a "point" release, meaning it's a three part number:
major-minor-point. The most recent Struts point release is 1.2.0. The
next will be 1.2.1. Each number is an integer, so there can be any
number of point releases.

Each point release is created exactly once. After the release is
created, we vote as to whether to change its status from "alpha" to
"beta" and/or "general availability".

We may also vote to demote a release, if we discover problems later.

At this time, Struts 1.1 is the best available release. Struts 1.2.0 is
also available, but still considered "alpha" quality.

** We encourage everyone to try running your applications against 1.2.0
and report any problems.  **

Right now, there are a handful of problem tickets against 1.2.0. As soon
as those are resolved, we will issue 1.2.1. Hopefully, that release will
make "GA" status. Either way, the next 1.2.x release after 1.2.1 will be
1.2.2.

-Ted.

On Sat, 20 Mar 2004 23:20:39 +0200, Erez Efrati wrote:
> Yes, I here so much of this version so I wondered if it was
> released or the CVS head version is stable enough for production.
>
> Erez
>
>
> -Original Message-
> From: Zsolt Koppany [mailto:[EMAIL PROTECTED] Sent:
> Saturday, March 20, 2004 10:58 PM To: Struts Users Mailing List
> Subject: RE: version 1.2
>
> Hi,
>
>
> do you mean struts-1.2 final? I cannot find that at:
> http://jakarta.apache.org/site/binindex.cgi
>
> Zsolt
>
>
>> -Original Message-
>> From: Joe Germuska [mailto:[EMAIL PROTECTED]
>> Sent: Saturday, March 20, 2004 3:20 PM
>> To: Struts Users Mailing List
>> Subject: Re: version 1.2
>>
>>
>> At 1:14 PM +0200 3/20/04, Erez Efrati wrote:
>>> Hi, I am currently working with the 1.1, is there a good reason
>>> to
>>>
> move
>>> to 1.2? Is it going to be released sometime soon?
>>>
>>
>> Struts 1.2.0 was released a few weeks ago using the new Tomcat-
>> style version numbering.  That means that a numbered release may
>> or may not be considered a production quality release.  There has
>> not been a formal vote on the status of 1.2.0, but I think we'd
>> cut another release rather than vote 1.2.0 as production-quality.
>>
>> If you're satisfied with Struts 1.1, you may as well stick with
>> it. If you like to keep up with Struts while its evolving, you
>> might be just as well off building from CVS Head as using Struts
>> 1.2.0.  That way you'd roll in recent bug fixes and be in a
>> position to fix other bugs yourself if you find them (or just
>> update from CVS and apply fixes and changes as they come in.)
>>
>> There aren't anywhere near the number of structural changes
>> between 1.1 and 1.2 that there were between 1.0 and 1.1.  Many
>> deprecated members from 1.1 have been removed, so if you were
>> ignoring the deprecation warnings all this time, you'll finally
>> have to catch up. Also, if I recall correctly, there are some
>> changes in the JSP tag libraries that may be hard to find until
>> you compile the JSPs.
>>
>> Hope that helps,
>> Joe
>>
>>
>> --
>> Joe Germuska
>> [EMAIL PROTECTED]
>> http://blog.germuska.com
>> "Imagine if every Thursday your shoes exploded if you tied them
>> the usual way.  This happens to us all the time with computers,
>> and nobody thinks of complaining." -- Jef Raskin
>>
>> --
>> --- To unsubscribe, e-mail: struts-user-
>> [EMAIL PROTECTED] For additional commands, e-mail:
>> [EMAIL PROTECTED]
>
>
> 
> - To unsubscribe, e-mail: struts-user-
> [EMAIL PROTECTED] For additional commands, e-mail:
> [EMAIL PROTECTED]
>
>
> 
> - To unsubscribe, e-mail: struts-user-
> [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: version 1.2

2004-03-20 Thread Erez Efrati
Yes, I here so much of this version so I wondered if it was released or
the CVS head version is stable enough for production.

Erez

-Original Message-
From: Zsolt Koppany [mailto:[EMAIL PROTECTED] 
Sent: Saturday, March 20, 2004 10:58 PM
To: Struts Users Mailing List
Subject: RE: version 1.2

Hi,

do you mean struts-1.2 final? I cannot find that at:
http://jakarta.apache.org/site/binindex.cgi

Zsolt

> -Original Message-
> From: Joe Germuska [mailto:[EMAIL PROTECTED]
> Sent: Saturday, March 20, 2004 3:20 PM
> To: Struts Users Mailing List
> Subject: Re: version 1.2
>
>
> At 1:14 PM +0200 3/20/04, Erez Efrati wrote:
> >Hi, I am currently working with the 1.1, is there a good reason to
move
> >to 1.2? Is it going to be released sometime soon?
>
> Struts 1.2.0 was released a few weeks ago using the new Tomcat-style
> version numbering.  That means that a numbered release may or may not
> be considered a production quality release.  There has not been a
> formal vote on the status of 1.2.0, but I think we'd cut another
> release rather than vote 1.2.0 as production-quality.
>
> If you're satisfied with Struts 1.1, you may as well stick with it.
> If you like to keep up with Struts while its evolving, you might be
> just as well off building from CVS Head as using Struts 1.2.0.  That
> way you'd roll in recent bug fixes and be in a position to fix other
> bugs yourself if you find them (or just update from CVS and apply
> fixes and changes as they come in.)
>
> There aren't anywhere near the number of structural changes between
> 1.1 and 1.2 that there were between 1.0 and 1.1.  Many deprecated
> members from 1.1 have been removed, so if you were ignoring the
> deprecation warnings all this time, you'll finally have to catch up.
> Also, if I recall correctly, there are some changes in the JSP tag
> libraries that may be hard to find until you compile the JSPs.
>
> Hope that helps,
>   Joe
>
> --
> Joe Germuska
> [EMAIL PROTECTED]
> http://blog.germuska.com
>"Imagine if every Thursday your shoes exploded if you tied them
> the usual way.  This happens to us all the time with computers, and
> nobody thinks of complaining."
>  -- Jef Raskin
>
> -
> 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]



version 1.2

2004-03-20 Thread Erez Efrati
Hi, I am currently working with the 1.1, is there a good reason to move
to 1.2? Is it going to be released sometime soon? 
 
Thanks,
 
Erez


RE: best way to highlight error form fields

2004-03-13 Thread Erez Efrati
Sorry but this is quite new to me: how do you use this source code? How
I integrate it? Do I write a TLD file??

Erez

-Original Message-
From: Niall Pemberton [mailto:[EMAIL PROTECTED] 
Sent: Saturday, March 13, 2004 12:54 AM
To: Struts Users Mailing List
Subject: Re: best way to highlight error form fields

I have done this by extending the struts  tag and using the
stylesheets - its pretty straight forward.

I overrode the getStyleClass() method to do the following:

1) Retrieve the "ActionErrors" from the request
2) Check if there is an error message for the name/property
3) If there is an error - append a suffix to the StyleClass attribute
("Err"
by default")

So I have something like:

   

If "somethingOrOther" is VALID it generates:
   

If "somethingOrOther" is INVALID it generates:
   

All you have to do is set up two styles in your style sheet, the error
style
with an appropriate color.

I have put the source code on my web site:

http://www.niallp.pwp.blueyonder.co.uk

Niall


----- Original Message - 
From: "Erez Efrati" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Friday, March 12, 2004 9:48 PM
Subject: best way to highlight error form fields


> Hi all,
>
> I have a form and I am searching for the best way to do the following:
> 1. In case there were errors found in the form fields, highlight those
> fields (using background color of red for example).
> 2. If there are more than 4 fields with errors, show the user one
> compact error saying that he should enter the highlighted fields.
>
> One way I came up with is using  tag for each
> field and changing the style he's using thus highlighting it. Is there
a
> JSTL equivalent way to perform this?
>
> Thanks in advance,
>
> Erez E
>
>
>
>



-
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: best way to highlight error form fields

2004-03-13 Thread Erez Efrati
Thanks Niall, I will give it a try, it sounds good :) what about other
HTML input component? Is it doable the same way?

Erez

-Original Message-
From: Niall Pemberton [mailto:[EMAIL PROTECTED] 
Sent: Saturday, March 13, 2004 12:54 AM
To: Struts Users Mailing List
Subject: Re: best way to highlight error form fields

I have done this by extending the struts  tag and using the
stylesheets - its pretty straight forward.

I overrode the getStyleClass() method to do the following:

1) Retrieve the "ActionErrors" from the request
2) Check if there is an error message for the name/property
3) If there is an error - append a suffix to the StyleClass attribute
("Err"
by default")

So I have something like:

   

If "somethingOrOther" is VALID it generates:
   

If "somethingOrOther" is INVALID it generates:
   

All you have to do is set up two styles in your style sheet, the error
style
with an appropriate color.

I have put the source code on my web site:

http://www.niallp.pwp.blueyonder.co.uk

Niall


----- Original Message - 
From: "Erez Efrati" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Friday, March 12, 2004 9:48 PM
Subject: best way to highlight error form fields


> Hi all,
>
> I have a form and I am searching for the best way to do the following:
> 1. In case there were errors found in the form fields, highlight those
> fields (using background color of red for example).
> 2. If there are more than 4 fields with errors, show the user one
> compact error saying that he should enter the highlighted fields.
>
> One way I came up with is using  tag for each
> field and changing the style he's using thus highlighting it. Is there
a
> JSTL equivalent way to perform this?
>
> Thanks in advance,
>
> Erez E
>
>
>
>



-
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: best way to highlight error form fields

2004-03-12 Thread Erez Efrati
I totally agree with you, and I am pretty sure I am not the first one to
bump into these issues.


Erez E

-Original Message-
From: Joe Germuska [mailto:[EMAIL PROTECTED] 
Sent: Saturday, March 13, 2004 12:15 AM
To: Struts Users Mailing List
Subject: Re: best way to highlight error form fields

At 11:48 PM +0200 3/12/04, Erez Efrati wrote:
>Hi all,
>
>I have a form and I am searching for the best way to do the following:
>1. In case there were errors found in the form fields, highlight those
>fields (using background color of red for example).
>2. If there are more than 4 fields with errors, show the user one
>compact error saying that he should enter the highlighted fields.
>
>One way I came up with is using  tag for each
>field and changing the style he's using thus highlighting it. Is there
a
>JSTL equivalent way to perform this?

there's no particularly clean way to do that in the JSTL while also 
including the 'property' attribute feature which evaluates not simply 
whether there are  any messages, but whether any of the messages 
apply to a specific property.

I'd say this is just one of those cases where the Struts JSP tags 
aren't obsoleted by the JSTL.

Wasn't there someone a while ago talking about an "html:label" JSP 
tag that was kind of smart about messages and could apply styles 
accordingly?  That seems like it could be pretty handy...

Joe

-- 
Joe Germuska
[EMAIL PROTECTED]  
http://blog.germuska.com
   "Imagine if every Thursday your shoes exploded if you tied them 
the usual way.  This happens to us all the time with computers, and 
nobody thinks of complaining."
 -- Jef Raskin

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



best way to highlight error form fields

2004-03-12 Thread Erez Efrati
Hi all, 
 
I have a form and I am searching for the best way to do the following:
1. In case there were errors found in the form fields, highlight those
fields (using background color of red for example).
2. If there are more than 4 fields with errors, show the user one
compact error saying that he should enter the highlighted fields.
 
One way I came up with is using  tag for each
field and changing the style he's using thus highlighting it. Is there a
JSTL equivalent way to perform this?
 
Thanks in advance,
 
Erez E
 
 
 


RE: Populating form Elements from another object.

2004-03-10 Thread Erez Efrati
It looks cool, still thereĀ“s a problem of being open to small nasty
attacks.
Since the set() method adds fields dynamically, it would do it also upon
properties population. So, when a request comes loaded with fields that
never should have been sent, the lazyDynaBean would add them, thus
creating a small hole of security. What do you think?

Erez

-Original Message-
From: Niall Pemberton [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, March 10, 2004 5:20 PM
To: Struts Users Mailing List
Subject: Re: Populating form Elements from another object.

Thats it exactly. I have updated my web page with examples for LazyBean
and
LazyValidatorActionForm processing:

http://www.niallp.pwp.blueyonder.co.uk

Niall

- Original Message - 
From: "Mark Lowe" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Wednesday, March 10, 2004 8:16 AM
Subject: Re: Populating form Elements from another object.


> Again I haven't used Niall's classes but I'd hazard a guess that as
> they extend DynaBean that you use the map like interface for accessing
> these properties. In fact I imagine you can cast them as a DynaBean
> like you can with the DynaActionForms
>
> DynaBean myForm = (DynaBean) form;
> String foo = myForm.get("foo").toString();
>
>
>
> On 9 Mar 2004, at 20:27, Metin Carl wrote:
>
> > This is really good. An example of processing this form in Action
> > classes
> > would be very useful too as the way Shanmugam needs.
> >
> >
> > "Niall Pemberton" <[EMAIL PROTECTED]> wrote in
message
> > news:[EMAIL PROTECTED]
> >> Yup, thats it - plus dynamic="true"
> >>
> >>   >> type="lib.framework.struts.LazyValidatorActionForm" dynamic="true"
/>
> >>   >> type="lib.framework.struts.LazyValidatorActionForm" dynamic="true"
/>
> >>   >> type="lib.framework.struts.LazyValidatorActionForm" dynamic="true"
/>
> >>   >> type="lib.framework.struts.LazyValidatorActionForm" dynamic="true"
/>
> >>
> >> Oh, I noticed an error in LazyValidatorForm, its declared as
> >> "abstract" -
> >> which it shouldn't be - I don't use it directly, I use
> >> LazyValidatorActionForm which extends it.
> >>
> >> Niall
> >>
> >>
> >> - Original Message -
> >> From: "Mark Lowe" <[EMAIL PROTECTED]>
> >> To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
> >> Sent: Tuesday, March 09, 2004 8:53 AM
> >> Subject: Re: Populating form Elements from another object.
> >>
> >>
> >>> I haven't seen the code but if what i understand of what Niall has
> >>> been
> >>> saying you'd  use them instead of DynaActionForm.
> >>>
> >>>  >>> />
> >>>
> >>> of course you'll need to call the package and class name to
something
> >>> appropriate.
> >>>
> >>> On 9 Mar 2004, at 09:47, shanmugampl wrote:
> >>>
>  Hi,
> 
> I saw your code. I have one doubt. How do you plugin your own
>  DynaBean implementation into the struts framework.
> 
>  Shanmugam PL
> 
>  Niall Pemberton wrote:
> 
> > I wrote these
> >
> > http://www.niallp.pwp.blueyonder.co.uk
> >
> > Niall
> >
> > - Original Message - From: "shanmugampl"
> > <[EMAIL PROTECTED]>
> > To: <[EMAIL PROTECTED]>
> > Sent: Wednesday, February 25, 2004 7:00 AM
> > Subject: Populating form Elements from another object.
> >
> >
> >
> >> Hi,
> >>
> >>  I have a requirement where i need to populate the values
of a
> >> form from another object, and then again transform the contents
of
> >> the form back to the object once the form is submitted. i.e
Say,
> >> when i click a button, i do some functionalities and have a
> >> Properties object as an output. The keys in the Properties
object
> >> are not static. These values need to be shown in a form. As the
> >> keys
> >> retrieved for the current operation is not known, i cant define
> >> the
> >> values in the struts-config.xml for the dynaactionclass.
> >>
> >>   Is it possible to extend the dynaactionclass, and during
its
> >> init or something, iterate the properties object and populate
the
> >> form.  Are there any other way of doing it.
> >>
> >> Thanks
> >> Shanmugam PL
> >>
> >>
> >>>
> 
 
>  -
> >> 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 u

RE: what version of Struts to use?

2004-02-13 Thread Erez Efrati
Good advice, thanks,

Erez

-Original Message-
From: Niall Pemberton [mailto:[EMAIL PROTECTED] 
Sent: Friday, February 13, 2004 11:42 PM
To: Struts Users Mailing List
Subject: Re: what version of Struts to use?

I'd stick with 1.1 for now.

1.2 is not released yet - last posting I saw about 1.2 in the
development
list was this

http://www.mail-archive.com/struts-dev%40jakarta.apache.org/msg21358.htm
l

- Original Message - 
From: "Erez Efrati" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Friday, February 13, 2004 9:21 PM
Subject: what version of Struts to use?


> I am currently using the released version of 1.1, should I move to
1.2?
> is it released yet? If not, when is it going to be and is it stable?
>
> Thanks a lot,
>
> Erez
>



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



what version of Struts to use?

2004-02-13 Thread Erez Efrati
I am currently using the released version of 1.1, should I move to 1.2?
is it released yet? If not, when is it going to be and is it stable?
 
Thanks a lot,
 
Erez


Struts 1.2

2003-10-15 Thread Erez Efrati
As I really wish to put my hands on the validwhen validator I understand
that I need to have Struts 1.2 from the nightly builds.

Is there some sort of beta for 1.2? Is anyone working with it right now?
Do I need to download any other packages like commons-validator or is it
all bundled in Struts?

Also, does validwhen has a client side javascript as well?


Thanks in advance,


Erez



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



RE: Required checkbox field & Validator

2003-10-15 Thread Erez Efrati
Forgive me for abusing this thread but... by the way how do you insert a
'-' and  chars into a validator mask regular expression?

Erez

-Original Message-
From: Adam Hardy [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, October 15, 2003 3:55 PM
To: Struts Users Mailing List
Subject: Re: Required checkbox field & Validator

If I think you mean what you mean, I think it's done so that any depends

validation that fails returns and no more validations on that field are 
done. But I've seen all fields getting validated in my client-side
stuff.

On 10/15/2003 03:19 PM Erez Efrati wrote:
> One thing else I don't get is why does the checkups in the client side
> validations are not done field by field, where on each field run all
the
> checks it depends on? Am I so special and unique to be doing it this
> way?
> 
> Erez
> 
> -Original Message-
> From: Adam Hardy [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, October 15, 2003 3:02 PM
> To: Struts Users Mailing List
> Subject: Re: Required checkbox field & Validator
> 
> On 10/15/2003 02:23 PM Erez Efrati wrote:
> 
>>I have a DynaActionForm with a boolean field representing a checkbox
>>field which must be checked before processing the form. I've tried
>>marking him as depending on 'required' but that didn't do it and the
>>server side FieldChecks.validateRequired () of Struts just let it
> 
> pass. 
> 
>>Going into the code I saw that the field already have a value of
> 
> 'false'
> 
>>thus it passes the check of not being null or blank.
>>
>>Now, I can put the code into my Action or into the derived form class
>>validate() method but I think that was not the idea of having an
>>infrastructure of validations. 
>>
>>How can this be done? Have I missed anything?
> 
> 
> This might be a kludge, but have you tried a validate mask = 'true'?
> 
> Otherwise I think it's not do-able with the standard validations.
> 
> Adam
> 


-- 
struts 1.1 + tomcat 5.0.12 + java 1.4.2
Linux 2.4.20 RH9


-
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: Required checkbox field & Validator

2003-10-15 Thread Erez Efrati
One thing else I don't get is why does the checkups in the client side
validations are not done field by field, where on each field run all the
checks it depends on? Am I so special and unique to be doing it this
way?

Erez

-Original Message-
From: Adam Hardy [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, October 15, 2003 3:02 PM
To: Struts Users Mailing List
Subject: Re: Required checkbox field & Validator

On 10/15/2003 02:23 PM Erez Efrati wrote:
> I have a DynaActionForm with a boolean field representing a checkbox
> field which must be checked before processing the form. I've tried
> marking him as depending on 'required' but that didn't do it and the
> server side FieldChecks.validateRequired () of Struts just let it
pass. 
> Going into the code I saw that the field already have a value of
'false'
> thus it passes the check of not being null or blank.
> 
> Now, I can put the code into my Action or into the derived form class
> validate() method but I think that was not the idea of having an
> infrastructure of validations. 
> 
> How can this be done? Have I missed anything?

This might be a kludge, but have you tried a validate mask = 'true'?

Otherwise I think it's not do-able with the standard validations.

Adam

-- 
struts 1.1 + tomcat 5.0.12 + java 1.4.2
Linux 2.4.20 RH9


-
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: Required checkbox field & Validator

2003-10-15 Thread Erez Efrati
Do you mean putting a mask with value of 'true'? In that case, I haven't
but I will do it. Is it a valid mask value?

If this doesn't work I guess I'd have to write one of my own.

Erez



-Original Message-
From: Adam Hardy [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, October 15, 2003 3:02 PM
To: Struts Users Mailing List
Subject: Re: Required checkbox field & Validator

On 10/15/2003 02:23 PM Erez Efrati wrote:
> I have a DynaActionForm with a boolean field representing a checkbox
> field which must be checked before processing the form. I've tried
> marking him as depending on 'required' but that didn't do it and the
> server side FieldChecks.validateRequired () of Struts just let it
pass. 
> Going into the code I saw that the field already have a value of
'false'
> thus it passes the check of not being null or blank.
> 
> Now, I can put the code into my Action or into the derived form class
> validate() method but I think that was not the idea of having an
> infrastructure of validations. 
> 
> How can this be done? Have I missed anything?

This might be a kludge, but have you tried a validate mask = 'true'?

Otherwise I think it's not do-able with the standard validations.

Adam

-- 
struts 1.1 + tomcat 5.0.12 + java 1.4.2
Linux 2.4.20 RH9


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



Required checkbox field & Validator

2003-10-15 Thread Erez Efrati
Hi, 

I have a DynaActionForm with a boolean field representing a checkbox
field which must be checked before processing the form. I've tried
marking him as depending on 'required' but that didn't do it and the
server side FieldChecks.validateRequired () of Struts just let it pass. 
Going into the code I saw that the field already have a value of 'false'
thus it passes the check of not being null or blank.

Now, I can put the code into my Action or into the derived form class
validate() method but I think that was not the idea of having an
infrastructure of validations. 

How can this be done? Have I missed anything?

I am using Struts 1.1 (the released version).

TIA,

Erez



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



RE: requiredif validator

2003-10-15 Thread Erez Efrati
Oops, sorry, what I wanted to know is about 'requiredWhen'.

Erez

-Original Message-----
From: Erez Efrati [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, October 15, 2003 11:12 AM
To: 'Struts Users Mailing List'
Subject: requiredif validator

Hi,

I am using the validator 1.02 that came with Struts 1.1. 
How do I get the 'requiredif' validator to work? Or is it not included?

Thanks,


Erez



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



requiredif validator

2003-10-15 Thread Erez Efrati
Hi,

I am using the validator 1.02 that came with Struts 1.1. 
How do I get the 'requiredif' validator to work? Or is it not included?

Thanks,


Erez



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



multiple forms in one jsp

2003-09-28 Thread Erez Efrati
I have a page with two forms. For one an action gets called so I can
initialize the first form easily. But for the second form in the same
page, how can it be initialized? 

Thanks in advance,
Erez



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



DynaActionForm Boolean properties

2003-09-22 Thread Erez Efrati
It appears that DynaActionForm Boolean properties that were not
specified with an initial value and that were not set by the request
(checkbox left unchecked) are returned as null from form.get (), why? Is
it a must to specify an initial value?

Thanks,
Erez



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



RE: Wizard pages in Struts design question

2003-09-21 Thread Erez Efrati
About your suggestion of avoiding repopulating... I guess this cannot be
done using DynaActionForms, or am missing something?

I agree that the step code should be part of the logic but still the
action should activate it somehow, by calling it. 

I can't see how chaining actions has to be an indication of logic code
creeping into the action code - It see how it can indicate but IMMO it's
not always the case. In the wizard example, I can't see why not having
each step in its own Struts action. Clicking next on the page1,
activates the submit on that step action, which may call some business
logic delegate to perform whatever is necessary, and then directing to
the next step dispatching its init method. After page2 step init()
method is done, it directs to something like 'viewForm' and next step is
displayed populated as required.

Erez

-Original Message-
From: Ted Husted [mailto:[EMAIL PROTECTED] 
Sent: Sunday, September 21, 2003 5:00 PM
To: Struts Users Mailing List
Subject: Re: Wizard pages in Struts design question

To prevent repopulation of an ActionForm's properties, you just need to 
provide a property that observes that status of another property that 
indicates whether the form is readonly or not. So, instead of just doing

this.property = property

you have

if (mutable) this.property = property

Or do something more sophisticated, like have it look at the page number

and then decide whether to set itself or not.

Though, IMHO, the behavior for a step is so complicated that you want to

put it in its own action, it should probably be outside of Struts all 
together, and part of the business logic layer.

(This is why chaining is frowned upon. It's a red flag that indicates 
business logic is creeping into your Action classes. When the business 
logic is sufficiently fine-grained, you should just be able to whatever 
you need to do from whatever Action you happen to be in. As work 
progresses on Commons Chain, I think this will provide a solution many 
people will prefer to chaining Struts Action).

I haven't had a chance to abstract it into a standard class, but here's 
a wizard Action that I'm working with now. It submits back to the same 
class, but uses a dispatch action so that if a step needs more behavior 
it can be encapsulated that way.

http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/wqdata/wqdata/src/java/ap
ps/cpu/us_ok_deq_wqdata/cpu/WizardAction.java

The steps are laid out as ActionForwards to the instant ActionMapping, 
making it very easy to rewrite.

-Ted.

Erez Efrati wrote:
> I read the HowTo write a wizard on the Struts web-site but I wasn't
> really happy with the solution, and I am looking for a better one. I
> came up with another way and I would appreciate your comments. 
> 
> The design consists of: 
> - The 'form' is a session scope form
> - WizardAction class (a DispatchAction based) with following methods:
>   * init () - starting the wizard and redirect to the first page
>   * finish () - (or save()) finish the wizard and save the
> information in the form using some business logic
> delegate.
>   
> - Each Page or step in the wizard is a separate Action class,
extending
> a WizrardBaseAction (a DispatchAction based) which contains some
> sharedmethods.
> 
>   For example: Page1Action extends WizardBaseAction {
> 
>   // initializes the page (done only on first
> encounter)
>   ActionForward init (mapping,...) throws
> Exception;
>   ActionForward back (mapping,...) throws
> Exception;
>   ActionForward next (mapping,...) throws
> Exception;ActionForward finish
> (mapping,...) throws Exception;
>   }   
> 
> - Each page/step has a separate action-mapping item in the
configuration
> with local forwards for : 'back' (if not the first page), 'next',
> 'finish' (if allowed from that page).
> 
>  I apologize for not sketching the whole idea down to the last bit but
I
> hope you get the picture. 
> 
> Only problem is that this design touches the question of chaining
> actions verses forward redirection (not just dispatching). 
> 
> For example the Page1Action.next() does the following:
>   1. validate the page
>   2. perform whatever processing required
>   3. return the next action to forward to (redirect or chain with
> all   its illness..)
> 
> In my opinion (humble one of course :) having such a separation
keeping
> each step in its own class is better and clearer design than having
them
> all in the same Action class. 
> 
> Isn't there a way to prevent the reset + pre-population of the form
done
> while chaining actions? Furtherm

RE: Wizard pages in Struts design question

2003-09-21 Thread Erez Efrati
Ted,

>From reading your WizardAction code it seems that in a way it maintains
an internal mechanism of redirection between the submitting of the
current step and preparation of the next step sub-actions, while keeping
Struts out of it. So in the end - not exposing the internal redirection
avoids the famous Struts action chaining issue.

Erez

-Original Message-
From: Ted Husted [mailto:[EMAIL PROTECTED] 
Sent: Sunday, September 21, 2003 5:00 PM
To: Struts Users Mailing List
Subject: Re: Wizard pages in Struts design question

To prevent repopulation of an ActionForm's properties, you just need to 
provide a property that observes that status of another property that 
indicates whether the form is readonly or not. So, instead of just doing

this.property = property

you have

if (mutable) this.property = property

Or do something more sophisticated, like have it look at the page number

and then decide whether to set itself or not.

Though, IMHO, the behavior for a step is so complicated that you want to

put it in its own action, it should probably be outside of Struts all 
together, and part of the business logic layer.

(This is why chaining is frowned upon. It's a red flag that indicates 
business logic is creeping into your Action classes. When the business 
logic is sufficiently fine-grained, you should just be able to whatever 
you need to do from whatever Action you happen to be in. As work 
progresses on Commons Chain, I think this will provide a solution many 
people will prefer to chaining Struts Action).

I haven't had a chance to abstract it into a standard class, but here's 
a wizard Action that I'm working with now. It submits back to the same 
class, but uses a dispatch action so that if a step needs more behavior 
it can be encapsulated that way.

http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/wqdata/wqdata/src/java/ap
ps/cpu/us_ok_deq_wqdata/cpu/WizardAction.java

The steps are laid out as ActionForwards to the instant ActionMapping, 
making it very easy to rewrite.

-Ted.

Erez Efrati wrote:
> I read the HowTo write a wizard on the Struts web-site but I wasn't
> really happy with the solution, and I am looking for a better one. I
> came up with another way and I would appreciate your comments. 
> 
> The design consists of: 
> - The 'form' is a session scope form
> - WizardAction class (a DispatchAction based) with following methods:
>   * init () - starting the wizard and redirect to the first page
>   * finish () - (or save()) finish the wizard and save the
> information in the form using some business logic
> delegate.
>   
> - Each Page or step in the wizard is a separate Action class,
extending
> a WizrardBaseAction (a DispatchAction based) which contains some
> sharedmethods.
> 
>   For example: Page1Action extends WizardBaseAction {
> 
>   // initializes the page (done only on first
> encounter)
>   ActionForward init (mapping,...) throws
> Exception;
>   ActionForward back (mapping,...) throws
> Exception;
>   ActionForward next (mapping,...) throws
> Exception;ActionForward finish
> (mapping,...) throws Exception;
>   }   
> 
> - Each page/step has a separate action-mapping item in the
configuration
> with local forwards for : 'back' (if not the first page), 'next',
> 'finish' (if allowed from that page).
> 
>  I apologize for not sketching the whole idea down to the last bit but
I
> hope you get the picture. 
> 
> Only problem is that this design touches the question of chaining
> actions verses forward redirection (not just dispatching). 
> 
> For example the Page1Action.next() does the following:
>   1. validate the page
>   2. perform whatever processing required
>   3. return the next action to forward to (redirect or chain with
> all   its illness..)
> 
> In my opinion (humble one of course :) having such a separation
keeping
> each step in its own class is better and clearer design than having
them
> all in the same Action class. 
> 
> Isn't there a way to prevent the reset + pre-population of the form
done
> while chaining actions? Furthermore, is it so bad to redirect between
> actions? 
> 
> Thanks in advance,
> Erez
> 
> 
> 
> 
> 
> 
>  
> 
> 
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 

-- 
Ted Husted,
   Junit in Action  - <http://www.manning.com/massol/>,
   Struts in Action - <http://husted.com/struts/book.html>,

Wizard pages in Struts design question

2003-09-21 Thread Erez Efrati

I read the HowTo write a wizard on the Struts web-site but I wasn't
really happy with the solution, and I am looking for a better one. I
came up with another way and I would appreciate your comments. 

The design consists of: 
- The 'form' is a session scope form
- WizardAction class (a DispatchAction based) with following methods:
* init () - starting the wizard and redirect to the first page
* finish () - (or save()) finish the wizard and save the
information   in the form using some business logic
delegate.

- Each Page or step in the wizard is a separate Action class, extending
a   WizrardBaseAction (a DispatchAction based) which contains some
shared  methods.

For example: Page1Action extends WizardBaseAction {

// initializes the page (done only on first
encounter)
ActionForward init (mapping,...) throws
Exception;
ActionForward back (mapping,...) throws
Exception;
ActionForward next (mapping,...) throws
Exception;  ActionForward finish
(mapping,...) throws Exception;
}   

- Each page/step has a separate action-mapping item in the configuration
with local forwards for : 'back' (if not the first page), 'next',
'finish' (if allowed from that page).

 I apologize for not sketching the whole idea down to the last bit but I
hope you get the picture. 

Only problem is that this design touches the question of chaining
actions verses forward redirection (not just dispatching). 

For example the Page1Action.next() does the following:
1. validate the page
2. perform whatever processing required
3. return the next action to forward to (redirect or chain with
all its illness..)

In my opinion (humble one of course :) having such a separation keeping
each step in its own class is better and clearer design than having them
all in the same Action class. 

Isn't there a way to prevent the reset + pre-population of the form done
while chaining actions? Furthermore, is it so bad to redirect between
actions? 

Thanks in advance,
Erez






 



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



RE: DynaValidatorForm and Multi-page validation

2003-09-15 Thread Erez Efrati
I use it in my application and I added to my DynaValidationForm
configuration a 'page' property of type java.lang.Integer, and it works.

Erez

-Original Message-
From: Natalie D Rassmann [mailto:[EMAIL PROTECTED] 
Sent: Monday, September 15, 2003 3:11 PM
To: Struts Users Mailing List
Subject: DynaValidatorForm and Multi-page validation

Hi -

I am having trouble with my DynaValidatorForm and Multi-page
validation.  It does not seem to utilize the page property.
I tried putting in a page property but I get Struts errors.  When I add
the page property to the struts-config file for that form, and I add the
page property as an integer, I get a Null pointer exception.  When I put
the page property as a string, I get a ClassCastException.  No matter
what I do, I can't get the page validation to work.  Does anyone have a
clue?  Can anyone help me??

Thanks in advance,

Natalie




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



RE: [OT] JSTL question

2003-09-11 Thread Erez Efrati
You need to put loop.COUNT : 

 

Erez

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 11, 2003 9:50 PM
To: Struts Users Mailing List
Subject: [OT] JSTL question

Ok, i have a map named selectBox that contains a number of ArrayLists
keyed by strings.

When I try to iterate over it, nothing happens!

  
Shows something of the order [ java.com.blah.bean, java.com.blah.bean,
java.com.blah.bean]


shows something like: java.com.blah.bean


shows the value stored in the bean under the property key.


However when i try to do this:



 
 


nothing shows.

I am really confused.  What am I doing wrong?

Thanks.

Denis



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



RE: Mapped properties call setter method twice?

2003-09-11 Thread Erez Efrati
tMappedWriteMethod() == null) {
if (log.isDebugEnabled()) {
log.debug("Skipping read-only property");
}
return; // Read-only, skip this property setter
}
type = ((MappedPropertyDescriptor) descriptor).
getMappedPropertyType();
} else if (descriptor instanceof IndexedPropertyDescriptor) {
if (((IndexedPropertyDescriptor) descriptor).getIndexedWriteMethod() == null) {
if (log.isDebugEnabled()) {
log.debug("Skipping read-only property");
}
return; // Read-only, skip this property setter
}
type = ((IndexedPropertyDescriptor) descriptor).
getIndexedPropertyType();
} else {
if (descriptor.getWriteMethod() == null) {
if (log.isDebugEnabled()) {
log.debug("Skipping read-only property");
}
return; // Read-only, skip this property setter
}
type = descriptor.getPropertyType();
}
}

// Convert the specified value to the required type
Object newValue = null;
if (type.isArray() && (index < 0)) { // Scalar value into array
if (value == null) {
String values[] = new String[1];
values[0] = (String) value;
newValue = ConvertUtils.convert((String[]) values, type);
} else if (value instanceof String) {
String values[] = new String[1];
values[0] = (String) value;
newValue = ConvertUtils.convert((String[]) values, type);
} else if (value instanceof String[]) {
    newValue = ConvertUtils.convert((String[]) value, type);
} else {
newValue = value;
}
} else if (type.isArray()) { // Indexed value into array
if (value instanceof String) {
newValue = ConvertUtils.convert((String) value,
type.getComponentType());
} else if (value instanceof String[]) {
newValue = ConvertUtils.convert(((String[]) value)[0],
type.getComponentType());
} else {
newValue = value;
}
} /* PATCH BEGIN: by Erez Efrati (24-May-2003) */
		else if (type == Object.class) {
			newValue = value;
		} /* PATCH END: by Erez Efrati */
		else { // Value into scalar
if ((value instanceof String) || (value == null)) {
newValue = ConvertUtils.convert((String) value, type);
} else if (value instanceof String[]) {
newValue = ConvertUtils.convert(((String[]) value)[0],
type);
} else if (ConvertUtils.lookup(value.getClass()) != null) {
newValue = ConvertUtils.convert(value.toString(), type);
} else {
newValue = value;
}
}

// Invoke the setter method
try {
if (index >= 0) {
PropertyUtils.setIndexedProperty(target, propName,
 index, newValue);
} else if (key != null) {
PropertyUtils.setMappedProperty(target, propName,
key, newValue);
} else {
PropertyUtils.setProperty(target, propName, newValue);
}
} catch (NoSuchMethodException e) {
throw new InvocationTargetException
(e, "Cannot set " + propName);
}

}


}

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

RE: jsp -> java naming issue

2003-09-11 Thread Erez Efrati
Some code snippets would shed some light here... :)

Regards,
Erez

-Original Message-
From: Gregory F. March [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 11, 2003 6:07 PM
To: [EMAIL PROTECTED]
Subject: jsp -> java naming issue


Back to coding...  I've been struggling with an issue for the past two
days that I just cannot solve.  There is a bunch of stuff going on, but
I believe I have narrowed it down to the following.

Here are the cast of characters:

Vector v1 of data that contains an element that is another Vector v2.
A jsp that iterates through both vectors
Class c1 that contains the data for v1 with appropriate getters and
setters
Class c2 that contains the data for v2 with appropriate getters and
setters
An adapter that populates the Vector v1 and v2 using the above two
classes

What happens:

jsp does a logic:iterate id=item name=v1
jsp does a bean:write name=item property=v2

I get a servlet exception saying there is no getter method for property
v1 of bean item.

Here is where it gets weird.  It is convoluted, so bear with me...

If I create a dummy getter (getXyzzy) and setter (setXyzzy) in c1 that
simply call the original getters and setters (getV2, setV2), and have
the jsp do a bean:write name=item property=xyzzy, it works (no
exception).

If I leave the jsp alone (bean:write name=item property=v2), but change
the adapter to call setXyzzy instead of setV2, it works too!

In other words, the following table occurs:

jsp adapter works
-
property=v2 setV2   No
property=xyzzy  setV2   Yes
property=v2 setXyzzyYes

I am totally stumped as to why this is occurring.  Now, keep in mind
that other bean:write's on item are working fine.

Any help would be really, really appreciated.  I've had two other people
look at it and they are stumped too.

If I didn't make myself clear, let me know and I'll try my best to
explain it better.

Thanks...

/greg

--
Gregory F. March-=-http://www.gfm.net:81/~march-=-
AIM:GfmNet

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



Extending DynaActionForm

2003-09-11 Thread Erez Efrati
Hi,

Using DynaActionForm and DispatchAction it would have been helpful ift
there was a way to create a BaseForm extending the DynaActionForm, which
always adds the 'method' property to the DynaForm. Is this possible?

Thanks,
Erez



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



DynaActionForm properties

2003-09-09 Thread Erez Efrati
Hi,

I have declared a property in a DynaActionForm of type of class of my
own.
My question is how can initialize it or pass a parameter to its
constructor? My impression was that it cannot be done, but maybe one of
you guys knows how to do this. Thing is I have this property which is an
instance of a class which receives a category name in his constructor.
And it would nice if I could just specify the 'myclass' class and the
category name, instead of having to derive a different class for each
different category I have, and use this derived class in the
DynaActionForm configuration.

Thanks in advance,
Erez 



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



RE: Primitive Types in DynaActionForm

2003-09-06 Thread Erez Efrati
Thanks Craig, First I didn't know about the new enhancement in JDK 1.5
so thanks. Secondly, I was just curious about all this cause I read the
code of DynaActionForm and saw some code dealing with the primitive
types.

Erez

-Original Message-
From: Craig R. McClanahan [mailto:[EMAIL PROTECTED] 
Sent: Saturday, September 06, 2003 7:16 PM
To: Struts Users Mailing List
Subject: Re: Primitive Types in DynaActionForm

On Sat, 6 Sep 2003, Erez Efrati wrote:

> Date: Sat, 06 Sep 2003 12:26:55 +0200
> From: Erez Efrati <[EMAIL PROTECTED]>
> Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> To: 'Struts Users Mailing List' <[EMAIL PROTECTED]>
> Subject: Primitive Types in DynaActionForm
>
> Hi,
>
> Can someone please explain me what is the deal with primitive types in
a
> DynaActionForm? Has someone used it?
>

You have to use the corresponding "wrapper" objects instead of
primitives.
For example, if you want to store an int property with a value of 123,
you'd do:

  dynabean.set("value", new Integer(123));
  int value = ((Integer) dynabean.get("value")).intValue();

In JDK 1.5 the need to do this will go away, because the compiler will
automatically box and unbox primitive values for you, but for now you
have
to do it yourself.

> Thanks in advance,
> Erez
>

Craig

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



Primitive Types in DynaActionForm

2003-09-06 Thread Erez Efrati
Hi,

Can someone please explain me what is the deal with primitive types in a
DynaActionForm? Has someone used it?

Thanks in advance,
Erez



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



RE: Copying DynaActionForm to Map DTO

2003-09-04 Thread Erez Efrati
True, but using the getMap() I will get also properties that do not
belong to the logic, like 'method' used for the DispatchAction, 'page'
etc.

Erez

-Original Message-
From: Paananen, Tero [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 04, 2003 6:47 PM
To: 'Struts Users Mailing List'
Subject: RE: Copying DynaActionForm to Map DTO

> I am using both DynaActionForm and a DTO that is implemented
> as a HashMap.
> What is the best way to copy or transfer the properties from the
> DynaActionForm to the HashMap DTO?

I would imagine that would require entirely on your
requirements...

The JavaDoc for DynaActionForm, btw, is very useful.
Might want to check it, especially where it documents
the getMap() method.

-TPP

-
This email may contain confidential and privileged material for the sole
use of the intended recipient(s). Any review, use, retention,
distribution or disclosure by others is strictly prohibited. If you are
not the intended recipient (or authorized to receive for the recipient),
please contact the sender by reply email and delete all copies of this
message.  Also, email is susceptible to data corruption, interception,
tampering, unauthorized amendment and viruses. We only send and receive
emails on the basis that we are not liable for any such corruption,
interception, tampering, amendment or viruses or any consequence
thereof.


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



Copying DynaActionForm to Map DTO

2003-09-04 Thread Erez Efrati
Hi all,

I am using both DynaActionForm and a DTO that is implemented as a
HashMap.
What is the best way to copy or transfer the properties from the
DynaActionForm to the HashMap DTO?

Thanks in advance,
Erez



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



RE: Commons Versions bundled with Struts 1.1

2003-09-02 Thread Erez Efrati
At least by the struts srcs build.properties it's 2.0.6 and later
HTH,

Erez

-Original Message-
From: Andrew Hill [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 02, 2003 3:41 PM
To: Struts Users Mailing List
Subject: RE: Commons Versions bundled with Struts 1.1

btw: Anyone have a clue as to the version for the "jakarta-oro" jar?
(Its manifest doesnt say)

-Original Message-
From: Andrew Hill [mailto:[EMAIL PROTECTED]
Sent: Tuesday, 2 September 2003 21:31
To: Struts
Subject: Commons Versions bundled with Struts 1.1


Ive been trying to find out the versions of the commons libraries
bundled
with Struts 1.1 Final, but haven't found where its definitively
documented
(links welcome please!)

I went through the various manifest files and got this, but Im not sure
how
up to date the manifests are:

struts 1.1 (Yeh. Ok. Im pretty confident about this one... ;->)
commons-beanutils 1.6
commons-collections 2.1
commons-digester 1.5
commons-fileupload 1.0
commons-lang 1.0
commons-logging 1.0.3
commons-validator 1.0.2

Is this correct?


-
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: Commons Versions bundled with Struts 1.1

2003-09-02 Thread Erez Efrati
At least by the struts srcs build.properties it's 2.0.6 and later
HTH,

Erez

-Original Message-
From: Andrew Hill [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 02, 2003 3:41 PM
To: Struts Users Mailing List
Subject: RE: Commons Versions bundled with Struts 1.1

btw: Anyone have a clue as to the version for the "jakarta-oro" jar?
(Its manifest doesnt say)

-Original Message-
From: Andrew Hill [mailto:[EMAIL PROTECTED]
Sent: Tuesday, 2 September 2003 21:31
To: Struts
Subject: Commons Versions bundled with Struts 1.1


Ive been trying to find out the versions of the commons libraries
bundled
with Struts 1.1 Final, but haven't found where its definitively
documented
(links welcome please!)

I went through the various manifest files and got this, but Im not sure
how
up to date the manifests are:

struts 1.1 (Yeh. Ok. Im pretty confident about this one... ;->)
commons-beanutils 1.6
commons-collections 2.1
commons-digester 1.5
commons-fileupload 1.0
commons-lang 1.0
commons-logging 1.0.3
commons-validator 1.0.2

Is this correct?


-
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: page field on DynaValidatorForm class

2003-09-02 Thread Erez Efrati
Hi Noam,

I have looked into the code of Struts, and turns out that if you don't
specify a 'page' property in the struts-config.xml the page property
will no get set and will be left as 0 in the DynaValidateForm. As a
rule, any parameter on the request that does not exist in the
configuration of a DynaActionForm and derived, will be ignored, skipped
and no warning gets printed - a bit sad but true.

Erez



-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, September 02, 2003 10:48 AM
To: [EMAIL PROTECTED]
Subject: RE: page field on DynaValidatorForm class

Hi,

You need not define the page field on your DynaValidatorForm
declaration. It
is defined in the org.apache...DynaValidatorForm  class.
Embedding  in the form does the
work.

Noam

-Original Message-----
From: Erez Efrati [mailto:[EMAIL PROTECTED]
Sent: Sunday, August 31, 2003 7:57 PM
To: 'Struts Users Mailing List'
Subject: page field on DynaValidatorForm class


Hi,

Do I need to include the declaration of a 
 in a form of type DynaValidatorForm in
the struts-config.xml?

Thanks in advance,
Erez



-
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: Question about DynaActionForm

2003-09-01 Thread Erez Efrati
Ok, I fount what was causing the problem. Turns out that I was missing a

'public' modifier on the Person constructor class which prevented the
Struts FormPropertyConfig class to call create a new instance of Person.
In MHO it should have printed something to the log instead of swallowing
the error.

I still would be happy to hear your opinion on my second question - how
to add properties in a DynaActionForm derived class.

Thanks,
Erez

-Original Message-----
From: Erez Efrati [mailto:[EMAIL PROTECTED] 
Sent: Monday, September 01, 2003 10:20 PM
To: 'Struts Users Mailing List'
Subject: Question about DynaActionForm


I am trying to do the following test form:


  




In my Action I get the person member = NULL.

1) Is it forbidden to use normal Objects embedded inside a DynaForm?
2) Is it possible to extend a DyaActionForm and have the Derived class
insert new properties on the fly, things like 'method' 'page' etc..?

Thanks in advance,
Erez



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



Question about DynaActionForm

2003-09-01 Thread Erez Efrati

I am trying to do the following test form:


  




In my Action I get the person member = NULL.

1) Is it forbidden to use normal Objects embedded inside a DynaForm?
2) Is it possible to extend a DyaActionForm and have the Derived class
insert new properties on the fly, things like 'method' 'page' etc..?

Thanks in advance,
Erez



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



page field on DynaValidatorForm class

2003-08-31 Thread Erez Efrati
Hi,

Do I need to include the declaration of a 
 in a form of type DynaValidatorForm in
the struts-config.xml?

Thanks in advance,
Erez



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



RE: Nested Tags

2003-08-26 Thread Erez Efrati
Thank you all, I just wanted to see if there are going to be phased out
in favor of something else... like in the case of  and 
tags in favor of JSTL ones.

Thanks again,
Erez

-Original Message-
From: Andrew Hill [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 26, 2003 3:43 PM
To: Struts Users Mailing List
Subject: RE: Nested Tags

The power of nested tags cannot be understated. Id advise you to use
them
(where applicable) for they are really useful, they make simple a lot of
things that would otherwise be a nightmare to implement.

-Original Message-
From: Erez Efrati [mailto:[EMAIL PROTECTED]
Sent: Tuesday, 26 August 2003 22:12
To: 'Struts Users Mailing List'
Subject: Nested Tags


Hi all,

What is the status with  tags? Should I use them or should I
avoid using them?

Thanks,
Erez



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



[OT] A better way to find JSP compile errors..

2003-08-26 Thread Erez Efrati
Hi all,

I have had with searching with my eyes over and over inside the JSP to
locate where there is an 'unterminated tag' as JSP compiler put it.
Is there a tool/way/what-ever way to find and correct these errors in a
more simply friendlier way?

Thanks,
Erez



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



nested tags

2003-08-26 Thread Erez Efrati
Hi all, 

What is the status with  tags? Should I use them or should I
avoid using them?

Thanks,
Erez



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



Nested Tags

2003-08-26 Thread Erez Efrati
Hi all, 

What is the status with  tags? Should I use them or should I
avoid using them?

Thanks,
Erez



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



RE: bean:message to fmt:message

2003-08-24 Thread Erez Efrati
Hi Adam,

I found what was the problem but was a bit ashamed of telling :)
I was missing the locale settings in my web.xml. 

  
javax.servlet.jsp.jstl.fmt.locale
iw
  

Now it all works just fine,

Erez

-Original Message-
From: Adam Hardy [mailto:[EMAIL PROTECTED] 
Sent: Sunday, August 24, 2003 12:50 PM
To: Struts Users Mailing List
Subject: Re: bean:message to fmt:message

Hi Erez,

had similar problems myself. Specifying the application resources in 
web.xml didn't work for me for hours because I'd spelt it wrong - 
perhaps you should check you have it spelt correctly (is that really a 
small r for resources.application, and with a dot? could it be 
resourceApplication.properties?) I think tomcat looks for a class with 
the extension .properties

Plus the param-name looks a bit messed up, although that's probably just

a cut & paste slip-up.

Try seeing if the fmt:message tag can find it by placing the bundle 
attribute on the tag itself.



On 08/24/2003 01:28 PM Erez Efrati wrote:
> Oops, sorry I mixed up key with value, 
> 
> I still get ???MyForm.title??? on 
> 
> In my web.xml I put as documented in JSTL specs:
> 
>   
> javax.servlet.jsp.jstl.fmt.localizationContext
> a
> resources.application
>   
> 
> This all works with bean:message. 
> Any ideas why?
> 
> Erez
> 
> -Original Message-
> From: Erez Efrati [mailto:[EMAIL PROTECTED] 
> Sent: Sunday, August 24, 2003 1:20 PM
> To: 'Struts Users Mailing List'
> Subject: bean:message to fmt:message
> 
> 
> In my resource properties file I have key in the following format:
> 
> button.next="xxx"
> ..
> 
> I am trying to move from  which
works
> just fine, to 
> 
> And I get the following error:
> 
> "Attribute value invalid according to the specified TLD' "
> 
> Why? Can't fmt:message accept these kind of keys (with a dot char)?
> 
> Thanks,
> Erez
> 
> 
> 
> -
> 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]
> 
> 

-- 
struts 1.1 + tomcat 4.1.27 + java 1.4.2
Linux 2.4.20 RH9


-
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: bean:message to fmt:message

2003-08-24 Thread Erez Efrati
Oops, sorry I mixed up key with value, 

I still get ???MyForm.title??? on 

In my web.xml I put as documented in JSTL specs:

  
javax.servlet.jsp.jstl.fmt.localizationContext
a
resources.application
  

This all works with bean:message. 
Any ideas why?

Erez

-Original Message-
From: Erez Efrati [mailto:[EMAIL PROTECTED] 
Sent: Sunday, August 24, 2003 1:20 PM
To: 'Struts Users Mailing List'
Subject: bean:message to fmt:message


In my resource properties file I have key in the following format:

button.next="xxx"
..

I am trying to move from  which works
just fine, to 

And I get the following error:

"Attribute value invalid according to the specified TLD' "

Why? Can't fmt:message accept these kind of keys (with a dot char)?

Thanks,
Erez



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



bean:message to fmt:message

2003-08-24 Thread Erez Efrati

In my resource properties file I have key in the following format:

button.next="xxx"
..

I am trying to move from  which works
just fine, to 

And I get the following error:

"Attribute value invalid according to the specified TLD' "

Why? Can't fmt:message accept these kind of keys (with a dot char)?

Thanks,
Erez



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



Struts Action or EJB session bean

2003-08-22 Thread Erez Efrati
My EJB/Web application lets users upload files to the system and later
serve them those files when needed. My question is:
Who should or recommended to handle the saving of the uploaded file? The
EJB session bean or the struts UploadAction?

Thanks in advance,
Erez






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



RE: File Upload error

2003-08-21 Thread Erez Efrati
Alex, 

I found it!! It was a beta version of the FileUpload in the
JBoss/Tomcat-4.1.24. I just replaced it with the FileUpload 1.0 that
came with Struts and it works now, thank god :)

Erez

-Original Message-
From: Alex Shneyderman [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 21, 2003 4:48 PM
To: 'Struts Users Mailing List'
Subject: RE: File Upload error

Make sure you do not have another file upload jar in your classpath.

Where are you hosting your app, what OS?

Alex.

> -Original Message-
> From: Erez Efrati [mailto:[EMAIL PROTECTED]
> Sent: Thursday, August 21, 2003 11:14 AM
> To: 'Struts Users Mailing List'
> Subject: File Upload error
> 
> Hi,
> 
> I am trying to do file uploading of several files and I keep getting
the
> following error:
> 
> java.lang.NoSuchMethodError:
>
org.apache.commons.fileupload.MultipartStream.setHeaderEncoding(Ljava/la
> ng/String;)V
> 
> I am using JBoss/Tomcat 4.1.24. The upload struts sample works just
fine
> under 4.1.27 - I haven't tried it under 4.1.24.
> 
> Does anyone have a clue?
> 
> Thanks,
> Erez
> 
> 
> 
> -
> 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]



File Upload error

2003-08-21 Thread Erez Efrati
Hi,

I am trying to do file uploading of several files and I keep getting the
following error:

java.lang.NoSuchMethodError:
org.apache.commons.fileupload.MultipartStream.setHeaderEncoding(Ljava/la
ng/String;)V

I am using JBoss/Tomcat 4.1.24. The upload struts sample works just fine
under 4.1.27 - I haven't tried it under 4.1.24.

Does anyone have a clue?

Thanks,
Erez



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



RE: file upload problem

2003-08-20 Thread Erez Efrati
Hi Brian, 

Thanks for replying. I really need help here, cause this is my first
time I am dealing with this.

All I wanted to know is how should and can I handle uploads of files
which are then being accessed intensively. 

Up to now I've seen two ways to do this:
(1) Store the uploaded files in the database and have a Struts Action
serve those files from the DB.
Pros: - The action has an ultimate control on who access what
- The files are better secured
 
Cons: - might turn up slow, even too slow to not acceptable

(2) Store those uploaded files under a file system directory and have
the JSP pages access these files through an Action or direct access,
like any normal image, logo, etc.
* Using an action - again, gaining control over the access, but might be
slower then direct access.
* Using direct access - probably faster (don't know how much more,
though), but losing control over pages access, less secured.

To do this I thought also of using Apache as the front door, using the
"alias" directive + JK2 module, which I guess you are familiar with.

Of course using Apache as the front door led me to the question of: "do
I need it really, is it that important to have the Apache just for the
files".
Many people argue that using Apache is best for static files, and I
guess images, photos, etc. *are* static in nature, so why not.

Still I did find that the configuration is a bit awkward, however it can
work. 

Do you use Apache for that as well? Or just Tomcat?

True, first I wanted to go along and delay my decision of how to access
those files and just have a file system directory. But I saw that JBoss
deletes those directories upon packed deployment. 

In your solution I have to deploy in an unpacked manner even in
production. Otherwise the whole directory will get lost. Do you see any
problems with your way?

It's really sad that there is not way to declare in JBoss/Tomcat a
directory with characteristics similar to the alias 
 in Apache. I don't see why it is not there, am I the only one
to deal with this kind of requirement? I guess not :) 

Regards,
Erez



-Original Message-
From: Brian McSweeney [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 20, 2003 11:59 AM
To: 'Struts Users Mailing List'
Subject: RE: file upload problem


Hi Erez,

Just wondering if you figured this out. I've found what I think could 
be a solution.

If you deploy your jboss ear in an exploded way:

[
>How can a war file be deployed in a exploded way .. 

just create a directory named foo.ear and in the deploy
directory,
and unpack your EAR file in foo.ear.
Then unpack the WAR file in a directory named foo.war in
foo.ear.
]

then you can write the uploaded files to a folder that the tomcat server

will be able to serve!

This works for me. Email me for more details.
Brian



-Original Message-
From: Erez Efrati [mailto:[EMAIL PROTECTED] 
Sent: 18 August 2003 15:53
To: 'Struts Users Mailing List'
Subject: RE: file upload problem

I am dealing as well with the file upload issue:

1) To where should I save those files. For one I haven't done this, so
this is all new. Also, I am using JBoss and I saw that no matter which
directory I choose under my application context directory, this
directory will be deleted and recreated upon redeployment so I guess
there is a convention that I am not aware of. If I go and save my files
in a "c:\files" how could links from JSP access those files. Lost in the
wilderness :) How is it done?

2) I could always store those files in the database but then I would
have to access them through an action, is this wise?

Thanks a bunch,
Erez

-Original Message-
From: Brian McSweeney [mailto:[EMAIL PROTECTED] 
Sent: Monday, August 18, 2003 3:46 PM
To: 'Struts Users Mailing List'
Subject: RE: file upload problem

Shane,

You are a star! That fixed it!

Thanks very much,
Brian

-Original Message-
From: Witbeck, Shane [mailto:[EMAIL PROTECTED] 
Sent: 18 August 2003 14:17
To: [EMAIL PROTECTED]
Subject: RE: file upload problem

I had a similar problem until I realized that you must specify a file
and
not a folder for the upload path (i.e. /tmp/upload/upload.txt not
/tmp/upload). 

HTH,

Shane

-Original Message-
From: Brian McSweeney [mailto:[EMAIL PROTECTED]
Sent: Monday, August 18, 2003 7:24 AM
To: 'Struts Users Mailing List'
Subject: RE: file upload problem


Thanks Prashanth,
But I don't think that's the problem.
Thanks anyway though,
Brian

-Original Message-
From: Prashanth.S [mailto:[EMAIL PROTECTED] 
Sent: 18 August 2003 11:44
To: Struts Users Mailing List
Subject: Re: file upload problem

hi brian,
try changing the folder permission from read-only??Its just a guess
Thanks
Prashanth


Brian McSweeney <[EMAIL PROTECTED]> wrote:
Hi all,

I'm trying to do a file upload action based on the example
st

RE: file upload problem

2003-08-18 Thread Erez Efrati
Thing is I do need a very high downloading of files, so I guess the
directory option is more appropriate.

What do you mean by  "a directory served by your web server"? I am
working with JBoss/Tomact and each time I am redeploy the any directory
under the context is deleted. So is there a trick here that I missed ?

Thanks,
Erez

-Original Message-
From: Evan Schnell [mailto:[EMAIL PROTECTED] 
Sent: Monday, August 18, 2003 4:24 PM
To: Struts Users Mailing List
Subject: Re: file upload problem

Erez Efrati wrote:

>I am dealing as well with the file upload issue:
>
>
>
>2) I could always store those files in the database but then I would
>have to access them through an action, is this wise?
>  
>
Yes.

I'm a strong proponent of storage in a database.  Not only is a BLOB the

ultimate quarantine but it saves you the headache of keeping meta-data 
and and the file content in synch.  Most RDBMs implement BLOBs as files 
so there is very little performance hit when you perform the upload.  
When users perform the download you will need an action to 'proxy' the 
bytes from the database to the response.  If you write good java.io 
code, set the content type on the response and return null from the 
execute method this is pretty straightforward and fast enough for most 
applications. 

Downloads will be a little slower this way but it's rare for system 
requirements to necessitate repeated file download.  If _each_ file is 
going to be downloaded more than a few hundred times/day you might want 
to write it to directory served by your _web_ server.  

Don't forget virus protection.  If users can upload and download MS 
Office documents you will need to virus check them after they are 
uploaded but before anyone else can download them.  

Regards, Evan.

-- 
Evan Schnell, Project Lead
nVISIA, Twin Cities  "Enterprise Architecture and Construction"
http://www.nvisia.com
7701 France Ave. S, Edina, MN 55435
Voice: 952.837.2577 -- Fax: 952.837.2578 




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



RE: file upload problem

2003-08-18 Thread Erez Efrati
I am dealing as well with the file upload issue:

1) To where should I save those files. For one I haven't done this, so
this is all new. Also, I am using JBoss and I saw that no matter which
directory I choose under my application context directory, this
directory will be deleted and recreated upon redeployment so I guess
there is a convention that I am not aware of. If I go and save my files
in a "c:\files" how could links from JSP access those files. Lost in the
wilderness :) How is it done?

2) I could always store those files in the database but then I would
have to access them through an action, is this wise?

Thanks a bunch,
Erez

-Original Message-
From: Brian McSweeney [mailto:[EMAIL PROTECTED] 
Sent: Monday, August 18, 2003 3:46 PM
To: 'Struts Users Mailing List'
Subject: RE: file upload problem

Shane,

You are a star! That fixed it!

Thanks very much,
Brian

-Original Message-
From: Witbeck, Shane [mailto:[EMAIL PROTECTED] 
Sent: 18 August 2003 14:17
To: [EMAIL PROTECTED]
Subject: RE: file upload problem

I had a similar problem until I realized that you must specify a file
and
not a folder for the upload path (i.e. /tmp/upload/upload.txt not
/tmp/upload). 

HTH,

Shane

-Original Message-
From: Brian McSweeney [mailto:[EMAIL PROTECTED]
Sent: Monday, August 18, 2003 7:24 AM
To: 'Struts Users Mailing List'
Subject: RE: file upload problem


Thanks Prashanth,
But I don't think that's the problem.
Thanks anyway though,
Brian

-Original Message-
From: Prashanth.S [mailto:[EMAIL PROTECTED] 
Sent: 18 August 2003 11:44
To: Struts Users Mailing List
Subject: Re: file upload problem

hi brian,
try changing the folder permission from read-only??Its just a guess
Thanks
Prashanth


Brian McSweeney <[EMAIL PROTECTED]> wrote:
Hi all,

I'm trying to do a file upload action based on the example
struts-upload.war.

I want to save the uploaded file to a folder on disk. However when I try
to run 
the action I get an error saying I don't have access to the folder. I've
tried 
changing the folder access and also using a different folder. 

I still get a file not found exception which says 

java.io.FileNotFoundException: .. (Access is denied)

I'm using JBoss 3.2.1_tomcat4.1.24. 
Perhaps JBoss restricts folder access?

The code that runs the struts action is:-


AddProductForm frm = (AddProductForm) form;

//retrieve the file representation
FormFile file = frm.getTheFile();

//retrieve the file name
String fileName= file.getFileName();

//retrieve the content type
String contentType = file.getContentType();

//retrieve the file size
String size = (file.getFileSize() + " bytes");

log.info("File details - name: "+fileName);
log.info("File details - contentType: "+contentType);
log.info("File details - size: "+size);


// this is where I get the folder path to save the image into.

String imageStorePath = Init.getImageStorePath();
log.info("the value of imageStorePath is: "+imageStorePath);

try {
//retrieve the file data
ByteArrayOutputStream baos = new ByteArrayOutputStream();
InputStream stream = file.getInputStream();

//write the file to the file specified
OutputStream bos = new FileOutputStream(imageStorePath);
int bytesRead = 0;
byte[] buffer = new byte[8192];
while ((bytesRead = stream.read(buffer, 0, 8192)) != -1) {
bos.write(buffer, 0, bytesRead);
}
bos.close();
log.info("The file has been written to \"" + imageStorePath
+ "\"");
//close the stream
stream.close();
}

catch (FileNotFoundException fnfe) {
log.error("Couldn't find the file: "+ fnfe.toString());
}
catch (IOException ioe) {
log.error("io exception: "+ ioe.toString()); 
}
finally{
//destroy the temporary file created
file.destroy();
return mapping.findForward( WebConstants.SUCCESS );
}
}


Any help would be greatly appreciated.
Cheers,
Brian



-
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software


-
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: Bean:message to fmt:message

2003-08-17 Thread Erez Efrati
A big relief.. thanks, just to think about converting them all...

Erez

-Original Message-
From: Dan Tran [mailto:[EMAIL PROTECTED] 
Sent: Sunday, August 17, 2003 6:08 PM
To: Struts Users Mailing List
Subject: Re: Bean:message to fmt:message

Yes it does.

- Original Message - 
From: "Erez Efrati" <[EMAIL PROTECTED]>
Newsgroups: Struts
Sent: Sunday, August 17, 2003 9:57 AM
Subject: Bean:message to fmt:message


> I have a very small question: I have message keys that uses '.' like
for
> instance 'myform.hello'. I read something but I am not sure, does
>  support this kind of keys or do I have to remove those
'.'
> from my keys?
> 
> Thanks,
> Erez

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



Bean:message to fmt:message

2003-08-17 Thread Erez Efrati
I have a very small question: I have message keys that uses '.' like for
instance 'myform.hello'. I read something but I am not sure, does
 support this kind of keys or do I have to remove those '.'
from my keys?

Thanks,
Erez



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



static javascript

2003-08-16 Thread Erez Efrati
I am doing the following: but I don't get the static script in my pages.
What am I doing wrong?

JSP:






The staticJavascript.jsp: (copied from Struts example)
---
<%@ 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="/tags/struts-html" prefix="html" %>




Thanks,
Erez



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



RE: How to work with DispatchAction ? (please help)

2003-08-16 Thread Erez Efrati
Yes I see how it helps avoid extra parameter. I am using EJB and I don't
think there will be any problem with checking the "record" id. I will
try it and see how goes.

Just for the sake of it I must say that Wizard is a real pain.
Especially when you try to reuse those pages for updating - it's a
killer. What bothers me also is that since the wizard uses the form on
session scope, the update uses this scope too. If the user goes into
update a certain part of its registration (one of the wizard pages) and
then regrets and goes to another place in the application, it leaves me
with the form on the session. I am sure there are ways to clean it but I
haven't got to it yet.

Thanks,
Erez

-Original Message-
From: Sgarlata Matt [mailto:[EMAIL PROTECTED] 
Sent: Saturday, August 16, 2003 9:36 PM
To: Struts Users Mailing List
Subject: Re: How to work with DispatchAction ? (please help)

Erez Efrati wrote:
> Matt, thanks for replying, I almost though I'd never see one.. :-)
> 
> I've really ran into a wall but somehow got out of it, still I am not
> really happy with the solution which is by the way close to what you
> described.
> 
> I still would appreciate your help here:
> 
> I have the 'method' field on my RegForm class, and I guess this is
> normal. 
> On the RegAction DispatchAction I have 'create' 'edit' and 'update'
> methods.
> I use also a 'action' parameter to distinguish between two different
> workflows, can I avoid it? 

I think you can avoid it, but I haven't worked on any wizards using 
Struts yet, so I may be wrong.  Let me describe the approach that I use 
for saving a record where all data is specified on a single screen. 
This approach will work for you if you are saving the record to the 
database on the last step of your wizard rather than saving to the 
database after each step.

Instead of having both a "create" and "update" method I just have a save

method, so in my form I can always have .  In the save method I can distinguish between whether I 
am creating or updating based on whether or not the record already has 
an ID.  If the record does have an ID, I am updating and if it doesn't 
then I am creating.  I think you could do a test like this both in the 
action class that does the saving and in your JSP in place of testing 
against action.

Will this approach work for you?

Matt

> Here is the JSP (parts of it):
> 
> ...
> 
> 
> <!--
>   // sets the 'method' param
>   function setMethod(method) { 
>   document.forms[0].method.value = method; 
>   }
> 
> //-->
> 
> 
> 
>   
>   
>   
> 
>   ...
>   
> 
>   
>   
>   
>   
>key="button.next"/>
>   
>   
>   
>   
>onclick="setMethod('update');">
>key="button.save"/>
>   
>   
>
> 
> 
>
> If RegAction.update() finds validation errors it needs to go back to
the
> editing form, and restore the 'method' value to 'edit' or 'create' but
> it cannot know that once the value has changed to 'update'. That is
why
> I keep an 'action' parameter on the side to differ between the two. Is
> there a better way - I hope there is :)
> 
> Erez
> 
> 
> -Original Message-
> From: Sgarlata Matt [mailto:[EMAIL PROTECTED] 
> Sent: Saturday, August 16, 2003 7:26 PM
> To: Struts Users Mailing List
> Subject: Re: How to work with DispatchAction ?
> 
> Erez Efrati wrote:
> 
> 
>>I am trying to work with the DispatchAction that everybody is saying
> 
> is
> 
>>such a good type of action. Say I have a 'RegAction' sub-classing
>>DispatchAction with the following methods: edit, create, and save.
>>
>>I use  mapping is that it can only use a single form bean definition.  I
guess 
> theoretically you could have a dispatch action with multiple 
> action-mappings that each used different form beans, but I'm getting 
> confused just thinking about it ;)  My general rule is that one
dispatch
> 
> action has one action-mapping and one form bean definition.
> 
> 
>>2) In RegAction.save(), after I've validated the form and found
> 
> errors.
> 
>>I need to forward back to the input page, but I need to somehow 

RE: How to work with DispatchAction ? (please help)

2003-08-16 Thread Erez Efrati
Matt, thanks for replying, I almost though I'd never see one.. :-)

I've really ran into a wall but somehow got out of it, still I am not
really happy with the solution which is by the way close to what you
described.

I still would appreciate your help here:

I have the 'method' field on my RegForm class, and I guess this is
normal. 
On the RegAction DispatchAction I have 'create' 'edit' and 'update'
methods.
I use also a 'action' parameter to distinguish between two different
workflows, can I avoid it? 
Here is the JSP (parts of it):

...


<!--
// sets the 'method' param
function setMethod(method) { 
document.forms[0].method.value = method; 
}

//-->







...















 


   
If RegAction.update() finds validation errors it needs to go back to the
editing form, and restore the 'method' value to 'edit' or 'create' but
it cannot know that once the value has changed to 'update'. That is why
I keep an 'action' parameter on the side to differ between the two. Is
there a better way - I hope there is :)

Erez


-Original Message-
From: Sgarlata Matt [mailto:[EMAIL PROTECTED] 
Sent: Saturday, August 16, 2003 7:26 PM
To: Struts Users Mailing List
Subject: Re: How to work with DispatchAction ?

Erez Efrati wrote:

> I am trying to work with the DispatchAction that everybody is saying
is
> such a good type of action. Say I have a 'RegAction' sub-classing
> DispatchAction with the following methods: edit, create, and save.
> 
> I use  2) In RegAction.save(), after I've validated the form and found
errors.
> I need to forward back to the input page, but I need to somehow add
the
> 'edit' method. How do you recommend doing that? Do I append it to the
> action-forwards path with '?method=edit' in the action-mapping
> configuration?

Your dispatch actions sound very similar to mine: I have an add method, 
an edit method, and a save method.  I also define two forwards: one to 
the form view () and one to the "detail" view 
(), which is the view the user sees after a 
successful save.  If you find errors, shouldn't you just be able to do 
mapping.findForward("viewForm")?  The form bean will still be populates 
with the values the user entered even if you are using a session-scoped 
bean :)

> Please help,
> Erez

Matt


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



How to use DispatchAction ? (cont.)

2003-08-15 Thread Erez Efrati
To make it clearer, if I have the following methods:

create - just displays the form with empty fields.
edit   - reads registration data from db and displays the form
save   - save registration data to/back to the db

The RegAction (a DispatchAction) implements all three methods. In the
JSP I have 





Since in my form I need to distinguish between 'create' and 'edit' when
RegAction.save() finds a validation error it needs to forward back to
the input page and add the '?method=edit' part, I guess?

Could someone shed some light here, I am bit lost.
Thanks,
Erez



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



How to work with DispatchAction ?

2003-08-15 Thread Erez Efrati
I am trying to work with the DispatchAction that everybody is saying is
such a good type of action. Say I have a 'RegAction' sub-classing
DispatchAction with the following methods: edit, create, and save.

I use 

RE: Action mapping 'inputForward'

2003-08-15 Thread Erez Efrati
Lately I've been posting some messages regarding writing Wizards using
Struts and asked a lot of question, to which none of them I got any
answer... sad but true. I solved it but still I would like to hear what
is your point of view. 

In my case I have a Registration wizard using a form on a session scope
since I don't want to carry all the fields as hidden. Each page has a
page number and method hidden parameter for controlling to sequence.

Then I got to write the Editing of the registration information. I
wanted to reuse my pages. Now comes the tricky part (I think). I wanted
the Edit action to use the same form *but* on the request scope.
Therefore, I couldn't just use the same 
tag but had to change based on the 'method' = 'create' or 'edit'. If
method=create I use the action=/Signup.do, and in 'edit' I do
action="/EditSignup.do".

In both the EditSignup and Signup action-mapping I use the same form but
different scope, and both going to the same SignupAction.

All that is a lot of pain :) I hope there's a lot better way that I
missed...

As to the DispatchAction, one thing that bothers me is what happens if I
want to differ between 'method' = create or edit in terms of security
roles. Currently this is not possible using configuration but only in
code.

I would appreciate your comments,

Erez




-Original Message-
From: Craig R. McClanahan [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 15, 2003 6:06 PM
To: Struts Users Mailing List
Subject: Re: Action mapping 'inputForward'

On Fri, 15 Aug 2003, Erez Efrati wrote:

> Date: Fri, 15 Aug 2003 18:49:25 +0200
> From: Erez Efrati <[EMAIL PROTECTED]>
> Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> To: 'Struts Users Mailing List' <[EMAIL PROTECTED]>
> Subject: Action mapping 'inputForward'
>
> Hi all,
>
> Is it recommended to use the 'inputForward'=true in the 
> configuration?
>

I do that all the time now.  Among other things, it makes life much
easier
when you want to use multiple modules, or play with settings like
forwardPattern and pagePatetrn.

Finally, it's more consistent with the use of forwards everywhere else
in
Struts, and I sort of wish I'd made "input" take the name of a forward
from the very beginning :-).

> Thanks,
> Erez

Craig

-
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: No getter method -- Please HELP!

2003-08-15 Thread Erez Efrati
Yep, it is case sensivite..  in your JSP it's orgid.. not orgId as
should be.

Erez

-Original Message-
From: David Graham [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 15, 2003 6:06 PM
To: Struts Users Mailing List
Subject: Re: No getter method -- Please HELP!

You need to use the property name "orgId" in your JSP because your
getter
method is getOrgId().

David


--- Mitesh Kapadia <[EMAIL PROTECTED]> wrote:
> Hello.
> 
> I have been having some problems when trying to render
> my jsp.  I get the following error message:
> 
> org.apache.jasper.JasperException: No getter method
> for property orgid of bean
> org.apache.struts.taglib.html.BEAN
> 
> My web.xml file has the following entry for
> servlet-mapping:
> 
>  
>   
> action
> /do/*
>   
> 
> My struts-configm.xml file:
>"-//Apache Software Foundation//DTD Struts
> Configuration 1.1//EN"
>  
> "http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd";
> >
> 
> 
> 
>  type="net.reumann.OrgIdActionForm"/> 
> 
> 
> 
>  forward="/employeeForm.jsp"/>
> 
>  type="net.reumann.OrgIdAction"
> name="orgidActionForm"
> scope="request"
> validate="true"
> >
>  name="success"
> path="/confirmation.jsp"/>
> 
> 
> 
>  parameter="ApplicationResources"
> null="false" />
> 
> 
> Here is the code from my index.jsp page:
> <%@ taglib uri="struts/bean-el" prefix="bean" %>
> <%@ taglib uri="struts/html-el" prefix="html" %>
> 
> 
> "
> rel="stylesheet" type="text/css">
> STRUTS Benchmark
> 
> 
> 
> 
> 
> 
> 
> 
>   
> 
>   :
> 
> 
>maxlength="18"/>
> 
>   
> 
>   
> 
>   :
> 
> 
>maxlength="18"/>
> 
>   
> 
>   
> 
>   
> 
> 
>   
> 
>   
> 
> 
> 
> 
> 
> 
> 
> 
> Here is the code from my OrgIdActionForm:
> package net.reumann;
> 
> import org.apache.struts.action.*;
> import org.apache.struts.actions.*;
> import org.apache.struts.action.ActionForm;
> import org.apache.struts.action.ActionMapping;
> 
> import javax.servlet.http.HttpServletRequest;
> 
> public class OrgIdActionForm extends ActionForm  {
> 
> private String orgid;
> private String facilid;
> 
> public void setOrgId(String orgid) {
> this.orgid = orgid;
> }
> public void setFacilId(String facilid) {
> this.facilid= facilid;
> }
> public String getOrgId() {
> return orgid;
> }
> public String getFacilId() {
> return facilid;
> }
> 
> public void reset(ActionMapping mapping,
> HttpServletRequest request) {
> this.orgid= null;
> this.facilid= null;
> }
> 
>   public ActionErrors validate(ActionMapping mapping,
> HttpServletRequest request) {
>   String errorKey = "OrgIdActionErrors";
>   ActionErrors errors = new ActionErrors();
> 
>   // orgid
>   if (this.orgid.length() < 4){
>   errors.add(errorKey, new
> ActionError("error.OrgIdActionForm.orgid.length"));
>   errors.add("orgid", new
> ActionError("error.generic"));
>   }
> 
> 
>   // facilid
>   else if(this.facilid.length() < 6)  {
>   errors.add(errorKey, new
> ActionError("error.OrgIdActionForm.facilid.length"));
>   errors.add("facilid", new
> ActionError("error.generic"));
>   }
> 
>   return errors;
>   }
> }
> 
> __
> Do you Yahoo!?
> Yahoo! SiteBuilder - Free, easy-to-use web site design software
> http://sitebuilder.yahoo.com
> 
> -
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


__
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.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]



Action mapping 'inputForward'

2003-08-15 Thread Erez Efrati
Hi all,

Is it recommended to use the 'inputForward'=true in the 
configuration? 

Thanks,
Erez



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



RE: c:choose and html:form

2003-08-14 Thread Erez Efrati
I did that and it works, thanks,
Erez

-Original Message-
From: Jason Lea [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 15, 2003 4:09 AM
To: Struts Users Mailing List
Subject: Re: c:choose and html:form

Erez Efrati wrote:
> Is this legal?
> 
> 
>   
>   
>   
>   
>   
>   
> 
> 
> Thanks,
> Erez

I think this would cause a problem because the JSP compiler would 
complain that the  tag is not being closed.  It would want 
the  tag to be nested at the same level as the opening tag.

An option might be to use the html-el tags which should mean you can do 
something like


   
 
   
   
 
   





-- 
Jason Lea


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



c:choose and html:form

2003-08-14 Thread Erez Efrati
Is this legal?










Thanks,
Erez



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



RE: Struts Validator Javascript

2003-08-14 Thread Erez Efrati
Didn't know about the bug list, but excuse me for not knowing that, can
you drop me the link for the bug-list please. 

Just for those of you who don't have faith in it, it does work, but
needs a little or more fixing and improvement. Overall, I'd say it's a
good pretty good infrastructure still needing more care and attention.
Currently the only solution I have for myself is coding it myself and
hoping to see what comes around in the future releases.

And yes, I am special :) my mother told me so.

Erez

-Original Message-
From: Reinhard [mailto:[EMAIL PROTECTED] 
Sent: Sunday, August 10, 2003 5:40 PM
To: Struts Users Mailing List
Subject: Re: Struts Validator Javascript

> ... Am I so special :)  

;-)

If I remember it well, it's an open issue in the bug-list.

cheers Reinhard

-
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 bCancel=false;

2003-08-14 Thread Erez Efrati
I saw that javascript generated contains a 
{ var bCancel = false; ... }

So does it mean that we are free of doing bCancel=false in 

Signup Wizard and Edit mode

2003-08-14 Thread Erez Efrati
I have a user signup wizard running through several pages. After the
signed up process is done I let the users update their registration
information. I have an action named 'SignupAction'. Since I already
wrote those pages I want to reuse them in the Edit actions. How can I do
it?

One way I thought of, since those pages already have their , I will pass the SignupAction a hidden
parameter with the mode or action = "Edit" and category="BasicInfo".
That way it would that it is running in edit mode, and the category is
the basic info (what was entered in the page #1 in wizard mode).

1) Can this work?
2) Is there a better way to do that? 
3) How can I add arguments to the ? can someone give an example here?

Many thanks,
Erez




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



RE: forEach & html-el:text - it's not working

2003-08-14 Thread Erez Efrati
David, 

As far as I can tell you, this cannot work. The population from the
request to a new fresh form will fail due to the fact that the form
doesn't have a setQty() setter method.

Erez

-Original Message-
From: David Thielen [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 12, 2003 11:03 PM
To: Struts-Users
Subject: c:forEach & html-el:text - it's not working

Hi;

I am trying to use html-el:text inside a c:forEach and according to
everything I have read - this should work. But it doesn't. Any ideas?

thanks - dave

my jsp
...






Where OrderForm.java has:
...
public OrderFormItem [] getItems() { return items; }
public OrderFormItem getItem( int ind ){ return items[ind]; }
public void setItem( int ind, OrderFormItem ofi ){ items[ind] = ofi;
}
...

and OrderFormItem has:
...
public String getQty() { return Integer.toString(qty); }
public void setQty( String num){ qty = Integer.parseInt(num);}
...



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



RE: forEach & html-el:text - it's not working

2003-08-14 Thread Erez Efrati
In order to make it work you should try something like



Hope this helps,
Erez

-Original Message-
From: David Thielen [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, August 12, 2003 11:03 PM
To: Struts-Users
Subject: c:forEach & html-el:text - it's not working

Hi;

I am trying to use html-el:text inside a c:forEach and according to
everything I have read - this should work. But it doesn't. Any ideas?

thanks - dave

my jsp
...






Where OrderForm.java has:
...
public OrderFormItem [] getItems() { return items; }
public OrderFormItem getItem( int ind ){ return items[ind]; }
public void setItem( int ind, OrderFormItem ofi ){ items[ind] = ofi;
}
...

and OrderFormItem has:
...
public String getQty() { return Integer.toString(qty); }
public void setQty( String num){ qty = Integer.parseInt(num);}
...



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



RE: One form multiple Action mapping

2003-08-14 Thread Erez Efrati
Come to think of it more, since I want the submitted form to use
different action mappings, I thought of using something like Scanfold's
RelayAction which dispatches to different action mappings based on the
parameter (in my case 'method'). On each action mapping I could set my
required roles etc. and then have them all forwarded to the
RegistrationAction for processing.
This way I can distinguish between them and still process them in a
single point (Action).
What do you think?

Erez


-Original Message-
From: Bailey, Shane C. [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 13, 2003 4:03 PM
To: 'Struts Users Mailing List'
Subject: RE: One form multiple Action mapping



What about:





 







-Original Message-
From: Erez Efrati [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 13, 2003 11:04 AM
To: 'Struts Users Mailing List'
Subject: One form multiple Action mapping

I have a registration form (RegForm) which based on the method/mode I
want to direct it to a different action mapping in order to assign
different roles or security restrictions. I have a single RegAction
extending the DispatchAction class, with parameter 'method' as the
dispatch parameter. 

I thought of maybe put a  and based on the 'method' put the
correct  one. But then again maybe this will harm the
javascript validation, cause the name of the form will be different.

How can this be done? 

Registration.jsp:

 
...



Thanks,
Erez



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



Registration and action mappings

2003-08-14 Thread Erez Efrati
I have a registration wizard. In each JSP member of this wizard I have a
. 


  
  
  


Note that the scope is "session". Now I want to write the part of
editing these pages separately. Thing is I want to use the same
SignupAction (subclass of DispatchAction), but I can't use the same
action-mapping cause I need it now to be scope="request". Also, in terms
of security & roles, I need the editing and wizard-creation mode action
mappings to be different in order to set different security settings.
The signup creation is open to all, while the editing is only for logged
on users (role=User).

I don't know if it would work (I will try it) is having two  for wizard creation mode, and
 Or use javascript
to change these dynamically with onclick on the buttons.

I would really appreciate any comment here,
Erez






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



One form multiple Action mapping

2003-08-14 Thread Erez Efrati
I have a registration form (RegForm) which based on the method/mode I
want to direct it to a different action mapping in order to assign
different roles or security restrictions. I have a single RegAction
extending the DispatchAction class, with parameter 'method' as the
dispatch parameter. 

I thought of maybe put a  and based on the 'method' put the
correct  one. But then again maybe this will harm the
javascript validation, cause the name of the form will be different.

How can this be done? 

Registration.jsp:

 
...



Thanks,
Erez



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



Signup Wizard and Edit mode (repost)

2003-08-14 Thread Erez Efrati
I have a user signup wizard running through several pages. After the
signed up process is done I let the users update their registration
information. I have an action named 'SignupAction'. Since I already
wrote those pages I want to reuse them in the Edit actions. How can I do
it?

One way I thought of, since those pages already have their , I will pass the SignupAction a hidden
parameter with the mode or action = "Edit" and category="BasicInfo".
That way it would that it is running in edit mode, and the category is
the basic info (what was entered in the page #1 in wizard mode).

1) Can this work?
2) Is there a better way to do that? 
3) How can I add arguments to the ? can someone give an example here?

Many thanks,
Erez




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



message localization

2003-08-14 Thread Erez Efrati
All this talking on JSP 2.0, JSTL and Struts-el brought me to ask if 
I should avoid using the following: 



Could someone tell me what is the equivalent in JSTL?

Erez





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



Relay Actions

2003-08-14 Thread Erez Efrati
Is this true that when you relay actions, meaning have one action
forward to another action, the form gets populated twice, and moreover
needs to be specified in both action mappings, (both the RelayAction and
the RealAction )?

Erez



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



RE: Struts with JBuilder

2003-08-14 Thread Erez Efrati
Hi Jack, 

I am too working with JB8 EE and all I did is put the resource property
file in the my src/resources directory under the name
'application.properties'.
And it took it. By the way, if you use other languages you need to run
native2ascii on your own, JB8 will not do it.

HTH,
Erez

-Original Message-
From: Jian Dai [mailto:[EMAIL PROTECTED] 
Sent: Sunday, August 10, 2003 11:03 AM
To: [EMAIL PROTECTED]
Subject: Struts with JBuilder

Hi, all:

I am trying to use Jbuilder 8.0 to build a struts project
on Tomcat 4.1 server. But I have a problem with Message Sources.
I cannot make the the properties file for Message sources to be 
included in .WAR package when I use Jbuilder's build function to 
build that package. 

I will very appreciate if anybody here can give me a clue why this 
happens and how I overcome this problem. 

Many thanks in advance for the nice help. 

Jack


-
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: validating a html:select box

2003-08-14 Thread Erez Efrati
I guess I'd have to change the msg key to something else than the
default message telling the value is out of range. 
What happens with html:radio? Is this also the way also to validate
radio options? If no radio is selected (and I know this is off topic,
well a bit) would the browser send a value?

Thanks,
Erez

-Original Message-
From: David G. Friedman [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 06, 2003 4:59 PM
To: Struts Users Mailing List
Subject: Re: validating a html:select box

Erez,

The Struts Validator has an intRange function.  It's in the Validator
User Guide: 
http://jakarta.apache.org/struts/userGuide/dev_validator.html

Here's an example from that page so you can set your min & max as 1 & 12
to prevent the zero (label "month"?) from being submitted:






min
10


max
20




---Original Message---
From: Erez Efrati <[EMAIL PROTECTED]>
Sent: 08/06/03 02:41 PM
To: 'Struts Users Mailing List' <[EMAIL PROTECTED]>
Subject: validating a html:select box

> 
> I have a selection box with options where the first is valued 0 (=not
selected) with some label saying: "month". How can I use the Struts
validator to validate the user has actually chosen a value other than 0?
Do I have to write one of my own? I wish the validwhen was around...

By the way the 'birthMonth' is an int (not a string).

Here is a snip of my page:















Thanks a lot,
Erez



-
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: Struts Problem!!!!Urgent

2003-08-14 Thread Erez Efrati
The reason this is not working for you is that "Element" bean name is
not around there when the request is populated back to your form. It is
there only when the JSP is populated from the action inside the
iteration.

To do what you want to do:



using the html-el taglib of Struts-EL.

Haven't tested it but I think it should work.

HTH,
Erez



-Original Message-
From: Sridhar Kotagiri [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 07, 2003 6:16 PM
To: Struts Users Mailing List
Subject: Struts ProblemUrgent

Hi,
   I have a HashMap in my ActionForm bean.I am able to display the
data.Butwhen I submit this form
   I am unable to carry the data.can anyone help me regarding this.



  









   







Action Form

public class EditAdvancedForm extends ValidatorForm {
//~ Instance fields


private String domain_Id;
private Map ip;

public EditAdvancedForm(){
ip=new HashMap();

}
public void setIps(String key,String value) {
ip.put(key,value);
}
public Object getIps(String key)
{
return ip.get(key);
}
public Map getIp() {
return ip;
}

/**
 * @param map
 */
public void setIp(Map map) {
ip = map;
}

}


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



Required vaidator javascript

2003-08-14 Thread Erez Efrati
I am sure that this is a simple question to you all HTML gurus... I Hope
:)

I am using the 'required' validator and I have fields of type
'select-one' and 'radio' for both of them the required doesn't bring up
the pop.

The required works very simply by looking if there is a value or not.
But for selection-box this is not enough, in my opinion. Currently I
have the "empty" value = 0  so for in the
eyes of the required validator the value is not empty. Of course I can
refine the javascript for dealing with these situations of 0 as an empty
value by convention or even take that NONE value from an extra variable.

As for the radio buttons I still have to figure out why? They are both
not selected and still.. no respond from Mr. required.

Small simple HTTP/HTML question. What value (if any) is sent after
submitting for a selection with empty value="" ? And the same for radio?

Thanks,
Erez



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



RE: Struts Problem

2003-08-14 Thread Erez Efrati
Sridhar,

Doing 
 is illegal in your
case cause this would generate the following call :
getIps() and setIps(String key, Object value) with the
result of Element.value as the 'key' and the new value as the value. But
your HashMap doesn't contain any element by this key.

If you're trying to update the values of elements in the map stored by
their keys then you just need the first  element. I hope I understand your what
you're trying to achieve here.

HTH,
Erez

-Original Message-
From: Sridhar Kotagiri [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 07, 2003 8:03 PM
To: Struts Users Mailing List
Subject: RE: Struts Problem

Hi Erez,
when Im using html-el tags its throwing an exception


  



   
 



   






org/apache/taglibs/standard/lang/support/ExpressionEvaluatorManager'
javax.servlet.ServletException:
org/apache/taglibs/standard/lang/support/ExpressionEvaluatorManager at
org.apache.jasper.runtime.PageContextImpl.handlePageException



Thanks!
Sridhar

-----Original Message-
From: Erez Efrati [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 07, 2003 1:26 PM
To: 'Struts Users Mailing List'
Subject: RE: Struts ProblemUrgent


The reason this is not working for you is that "Element" bean name is
not around there when the request is populated back to your form. It is
there only when the JSP is populated from the action inside the
iteration.

To do what you want to do:



using the html-el taglib of Struts-EL.

Haven't tested it but I think it should work.

HTH,
Erez



-Original Message-
From: Sridhar Kotagiri [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 07, 2003 6:16 PM
To: Struts Users Mailing List
Subject: Struts ProblemUrgent

Hi,
   I have a HashMap in my ActionForm bean.I am able to display the
data.Butwhen I submit this form
   I am unable to carry the data.can anyone help me regarding this.



  









   







Action Form

public class EditAdvancedForm extends ValidatorForm {
//~ Instance fields


private String domain_Id;
private Map ip;

public EditAdvancedForm(){
ip=new HashMap();

}
public void setIps(String key,String value) {
ip.put(key,value);
}
public Object getIps(String key)
{
return ip.get(key);
}
public Map getIp() {
return ip;
}

/**
 * @param map
 */
public void setIp(Map map) {
ip = map;
}

}


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



Sessions and ActionForm

2003-08-14 Thread Erez Efrati
I have a registration wizard where I have a RegForm bean on the session
scope. Now if on the second page I decide to quite and I close the
browser (MS IE), and I open a new IE browser, and I go to registration,
the same form is there containing all the information that I entered in
the previous session. 

1) Doesn't a session ends (invalidates) once I close the browser?
2) What is the best way to handle such situation of needing the
registration form always empty? The only thing that comes to my mind is
on the RegAction?method=init remove the RegForm from the session and
recreate a new one instead, or just call reset on the one that is there
on the session context. Will that work?

Thanks,
Erze 



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



Not getting javascript Popup on buttons

2003-08-14 Thread Erez Efrati
I have a field containing two a group of two  items with the
values 1 and 2. The page starts when none of them is selected. The
property is depends on required but still I don't get the javascript
popup, only the Action error coming from the server side.
Any ideas why?

Erez



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



RE: message localization

2003-08-14 Thread Erez Efrati
Thanks for the information. Could you tell me where I can find some
documentation on JavaServerFace ?

Erez

-Original Message-
From: Craig R. McClanahan [mailto:[EMAIL PROTECTED] 
Sent: Monday, August 11, 2003 2:50 AM
To: Struts Users Mailing List
Subject: RE: message localization

On Mon, 11 Aug 2003, Erez Efrati wrote:

> Date: Mon, 11 Aug 2003 03:09:56 +0200
> From: Erez Efrati <[EMAIL PROTECTED]>
> Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> To: 'Struts Users Mailing List' <[EMAIL PROTECTED]>
> Subject: RE: message localization
>
> In Struts  the default bundle is used without
having
> to declare it in each page. How can this be done in JSTL?
>

There's a context init parameter to set the default resource bundle
name.
See Section 8.11.3.

> Now just to make sure, again, is it recommended to make the transition
> to these JSTL tags or is it safe to stay with the Struts ones?

Either one will work fine, last a long time, as long as you're running
on
a Servlet 2.3 / JSP 1.2 or later container.  If you're on an earlier
version, your only choice is the Struts tags.

My recommendation is that new projects should use JSTL and struts-el
tags
(if you're on the appropriate container).  For existing apps, there is
no
compelling reason to change, other than perhaps to use those changes as
a
learning experience.

You're likely to see exactly the same sort of transition be recommended
on
the Struts HTML tags, once JavaServer Faces goes final.  In the mean
time,
there's an integration library that lets you mix in the current EA
release
with Struts 1.1:

http://jakarta.apache.org/builds/jakarta-struts/release/struts-faces/

>
> Erez

Craig

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



Signup Wizard and Edit mode

2003-08-14 Thread Erez Efrati
I have a user signup wizard running through several pages. After the
signed up process is done I let the users update their registration
information. I have an action named 'SignupAction'. Since I already
wrote those pages I want to reuse them in the Edit actions. How can I do
it?

One way I thought of, since those pages already have their , I will pass the SignupAction a hidden
parameter with the mode or action = "Edit" and category="BasicInfo".
That way it would that it is running in edit mode, and the category is
the basic info (what was entered in the page #1 in wizard mode).

1) Can this work?
2) Is there a better way to do that? 
3) How can I add arguments to the ? can someone give an example here?

Many thanks,
Erez




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



RE: Validator

2003-08-14 Thread Erez Efrati
It's in the code of FieldsCheck.java. I was trying to create one of my
own validator and I saw these lines  there.

Erez

-Original Message-
From: Yansheng Lin [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 07, 2003 12:10 AM
To: 'Struts Users Mailing List'
Subject: RE: Validator

???

I don't see it in my validation-rules.xml.  Which version are you using?

-Original Message-----
From: Erez Efrati [mailto:[EMAIL PROTECTED] 
Sent: August 6, 2003 3:33 PM
To: 'Struts Users Mailing List'
Subject: Validator



I am trying to figure out the code in struts.validator.FieldsCheck.java
in order to write one of my own.
Can someone explain what the purpose of the following lines of code in
all of the validateXXX() in Struts:

validateIntRange (...) {

if (isString(bean)) {
value = (String) bean;
}
...
}

Is this really necessary?

Erez



-
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: Using Struts Validator on Map-backed ActionForms

2003-08-14 Thread Erez Efrati
Just forgot to explain that I do the following:

mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 06, 2003 11:44 AM
To: 'Struts Users Mailing List'
Subject: RE: Using Struts Validator on Map-backed ActionForms

Hi Panchasheel,

I am working with map backed action forms and the way to work with
validation in this case is as follows (a piece of my validation.xml):

(on my ActionForm there are getProperty and setProperty interfacing the
actual map - as in your case I guess it is 'getVolume() and
setVolume()).








mask

${username}



Hope this helps,
Erez


-Original Message-
From: Gandle, Panchasheel [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 06, 2003 4:48 AM
To: 'Struts Users Mailing List'
Subject: RE: Using Struts Validator on Map-backed ActionForms

Has anybody come up with any validations for map-backed fields


   


what should go in ???
for 
<% for (int i=0;i<5;i++;) { %>

<% } %>

Thanks
Panchasheel


-Original Message-
From: Cordingley, Charles [mailto:[EMAIL PROTECTED]
Sent: Friday, August 01, 2003 1:24 PM
To: '[EMAIL PROTECTED]'
Subject: Using Struts Validator on Map-backed ActionForms


Hi,

I am trying to use the Struts Validator to generate Javascript
validation on
a Map-backed action form, but I keep getting "type is null or not an
object"
javascript error (I am using Struts 1.1). Non map-backed properties on
the
form work fine.

In the JSP I am creating text boxes using:



and have this method on the action form to get it:

public void setVolume(String key, Object value) {
   volumes.put(key, value);
}

In the validation.xml I have tried:


   


and:


   


but both result in the error.

Does anyone know how to do this?

Thanks,
Charles.



The Royal Bank of Scotland plc ('the Bank') is regulated by the
Financial 
Services Authority and is a member of The Royal Bank of Scotland
Marketing
Group.  The only packaged products (life policies, unit trusts and other
collective investment schemes and stakeholder and other pensions) the
Bank
advises on and sells are those of the Marketing Group, whose other
members
are Royal Scottish Assurance plc and Royal Bank of Scotland Unit Trust
Management Limited, both regulated by the Financial Services Authority.

The Royal Bank of Scotland plc. Registered in Scotland No 90312.
Registered
Office: 36 St Andrew Square, Edinburgh EH2 2YB. 

Agency agreements exist between members of The Royal Bank of Scotland
Group.

This e-mail message is confidential and for use by the addressee only.
If
the message is received by anyone other than the addressee, please
return
the message to the sender by replying to it and then delete the message
from
your computer. Internet e-mails are not necessarily secure. The Royal
Bank
of Scotland plc does not accept responsibility for changes made to this
message after it was sent. 

Whilst all reasonable care has been taken to avoid the transmission of
viruses, it is the responsibility of the recipient to ensure that the
onward
transmission, opening or use of this message and any attachments will
not
adversely affect its systems or data. No responsibility is accepted by
The
Royal Bank of Scotland plc in this regard and the recipient should carry
out
such virus and other checks as it considers appropriate.


-
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: Help please - indexed field in ActionForm

2003-08-14 Thread Erez Efrati
You could also try the following:


label:


You could also make use of the  and get rid of the
name="myForm", but this a bit more advanced.

Don't forget to put :
<%@ taglib uri="/tags/struts-html-el" prefix="html-el" %>

HTH,
Erez

-Original Message-
From: David Thielen [mailto:[EMAIL PROTECTED] 
Sent: Friday, August 08, 2003 1:39 AM
To: Struts Users Mailing List
Subject: Re: Help please - indexed field in ActionForm

Hi;

Thank you - this is part of what I need.

Is there any way to iterate through the lines if I don't know up front
how
many lines there will be? I tried the with the c JSTL and it doesn't
work.

thanks - dave


- Original Message - 
From: "Gary Kephart" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Thursday, August 07, 2003 4:55 PM
Subject: RE: Help please - indexed field in ActionForm


class MyActionForm
{
  private static final MAX_ENTRIES = 50;
  private String[] text;

  public MyActionForm()
  {
text = new String[MAX_ENTRIES];
  }

  public String[] getText() {return text;}

  public void setText(int index, String newText) {text[index] =
newText;}
}

my.jsp

  

  Label 1:
  Label 2:
  

  



Gary Kephart| New Century Mortgage
Web-Based Application Developer | http://www.ncen.com
[EMAIL PROTECTED]   | 340 Commerce
949-797-5660| Irvine, CA  92602-1318


> -Original Message-
> From: David Thielen [mailto:[EMAIL PROTECTED]
> Sent: Thursday, August 07, 2003 3:46 PM
> To: Struts-Users
> Subject: Help please - indexed field in ActionForm
>
>
> Hi;
>
> I've been fighting this all day with no luck. And it has to
> be a simple thing to do.
>
> I have a form where I have N lines in it. Each line needs to
> have some text displayed and an edit box.
>
> How do I set this up in the .jsp file and in the ActionForm?
> I've found a number of examples on the web but they all have
> incomplete code and my guesses for the rest of the code have
> not been right so far.
>
> thanks - dave
>

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



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



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



RE: Custom Validator

2003-08-14 Thread Erez Efrati
Keith, I have done the same and to do that I would suggest taking as a
starting point the code from the Struts source code. more specifically
have a look at FieldChecks.java (Struts src code) under
shared/.../struts/validator/FieldChecks.java. It will much clearer once
you do that. It worked for me :)

HTH,
Erez

-Original Message-
From: Kamholz, Keith (corp-staff) USX [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 07, 2003 6:05 PM
To: Struts (E-mail)
Subject: Custom Validator

Hey everyone,
I've got some nice custom validations working using the validation
framework.  However, I'm having a hard time with one seemingly imple
issue.
In the validation method in my custom validation class, how do I get the
value of the field I'm validating?
I found one example that did this, but it used deprecated methods.
Thanks in advance!

- Keith


-
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: Actions Best Practice

2003-08-14 Thread Erez Efrati
Taking your advice, it means that I would have two different action
mappings, one for the init step and the second for the actual action
(send).
But then I will have to write something like 
 which is a bit
strange to write again the "init", and it is needed cause the
ForgotPasswordAction.java needs this 'action' parameter to distinguish
between the two. Hmm.. 

Erez

-Original Message-
From: Adam Hardy [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 06, 2003 11:43 AM
To: Struts Users Mailing List
Subject: Re: Actions Best Practice

Erez Efrati wrote:

> One of the problem I found with 'action=init' method, is that the
> validation is activated automatically for both cases (both init &
send),
> and fails of course on the 'init' cause no field is yet in the form.
So
> I was forced to configure 'validate=false' and call it manually in the
> Action code.
> 

Option B would be compacter. You can write two action mappings in 
struts-config to distinguish the calls, where one has no validation and 
the other does.

I know some people don't like having extra action mappings in their 
struts-config, but I believe that is what they are there for.


Adam


-
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: Actions Best Practice

2003-08-14 Thread Erez Efrati
First, in my humble opinion, having one Action serving several actions
was the reality welcoming the pink vision of having a small action doing
different thing. Now, combining the two solutions as they are is quite
impossible since they both make use of the same action mapping
'parameter' field. There is however a nice-looking way around it. 
I can write our own version of base ActionForm  override the
validate(mapping, request), ignore the validation only if the
'parameter' is equal to "init" (as a convention, as a rule in the
specific application).
Therefore setting validation=true will be ignored when parameter="init"
and in all other cases will perform the validation.

To use the DispatchAction I would write the same base MyBaseForm, but
this time, it will imitate the DispatchAction and will look if the value
of the named parameter is "init". I think that solves it.

Erez



-Original Message-
From: Adam Hardy [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 06, 2003 3:32 PM
To: Struts Users Mailing List
Subject: Re: Actions Best Practice

I thought that was exactly what you were doing!

Erez Efrati wrote:
> The only thing you cannot do is having a mixture of this solution
> (having the action-mapping parameter set to the 'init' or else) and
the
> one of DispatchAction class that keeps all the operation under the
same
> roof (class).
> 
> Erez
> 
> -Original Message-
> From: Adam Hardy [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, August 06, 2003 3:00 PM
> To: Struts Users Mailing List
> Subject: Re: Actions Best Practice
> 
> That's not necessary. In the action mapping, you can specify the
action 
> parameter with parameter="init" or parameter="send".
> 
> Erez Efrati wrote:
> 
>>Taking your advice, it means that I would have two different action
>>mappings, one for the init step and the second for the actual action
>>(send).
>>But then I will have to write something like 
>> which is a bit
>>strange to write again the "init", and it is needed cause the
>>ForgotPasswordAction.java needs this 'action' parameter to distinguish
>>between the two. Hmm.. 
>>
>>Erez
>>
>>-Original Message-
>>From: Adam Hardy [mailto:[EMAIL PROTECTED] 
>>Sent: Wednesday, August 06, 2003 11:43 AM
>>To: Struts Users Mailing List
>>Subject: Re: Actions Best Practice
>>
>>Erez Efrati wrote:
>>
>>
>>
>>>One of the problem I found with 'action=init' method, is that the
>>>validation is activated automatically for both cases (both init &
>>
>>send),
>>
>>
>>>and fails of course on the 'init' cause no field is yet in the form.
>>
>>So
>>
>>
>>>I was forced to configure 'validate=false' and call it manually in
the
>>>Action code.
>>>
>>
>>
>>Option B would be compacter. You can write two action mappings in 
>>struts-config to distinguish the calls, where one has no validation
> 
> and 
> 
>>the other does.
>>
>>I know some people don't like having extra action mappings in their 
>>struts-config, but I believe that is what they are there for.
>>
>>
>>Adam
>>
>>
>>-
>>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]
> 
> 


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



Struts Validator Javascript

2003-08-14 Thread Erez Efrati
Working with the validator I found that the client-side javascript code
automatically generated by the validator tag does not handle correctly
or at all fields that are radio group , checkbox group or any other type
of group that exist.
I have posted few times on that but no response. After that I went and
fixed the javascript code to do it correctly in the validateRequired()
for instance. I am just wondering, am I the only one to use the client
side validator avascript? Am I so special :) ? Or everyone else is doing
it differently? 
I would appreciate any remark.

Erez



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



getting the current year

2003-08-14 Thread Erez Efrati
How can I get the current year in a JSP using JSTL or Struts, and no
java code?

Thanks,
Erez



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



Validator

2003-08-14 Thread Erez Efrati

I am trying to figure out the code in struts.validator.FieldsCheck.java
in order to write one of my own.
Can someone explain what the purpose of the following lines of code in
all of the validateXXX() in Struts:

validateIntRange (...) {

if (isString(bean)) {
value = (String) bean;
}
...
}

Is this really necessary?

Erez



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



RE: Relay Actions

2003-08-14 Thread Erez Efrati
I don't like it but it is written in Ted Husted "Struts in Action"
section 8.4, black on white :) Yes it reuses the same form bean, but it
resets it again, and repopulate it again. That is why he had inserted in
his scaffolds package BaseForm.java a method for set/getMutable() so
that the first action will set the mutability of the bean form to false
preventing the repopulation to occur or more accurate to change the
values of properties on the form bean.
I wish it was not true,

Erez

-Original Message-
From: K.C. Baltz [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 13, 2003 11:16 PM
To: Struts Users Mailing List
Subject: Re: Relay Actions

I don't believe that's true.  When a form is needed, a check is made to 
see if it already exists in the given scope and then the bean is reused.


K.C.

Erez Efrati wrote:

>Is this true that when you relay actions, meaning have one action
>forward to another action, the form gets populated twice, and moreover
>needs to be specified in both action mappings, (both the RelayAction
and
>the RealAction )?
>
>Erez
>
>
>
>-
>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: message localization

2003-08-12 Thread Erez Efrati
In Struts  the default bundle is used without having
to declare it in each page. How can this be done in JSTL?

Now just to make sure, again, is it recommended to make the transition
to these JSTL tags or is it safe to stay with the Struts ones?

Erez

-Original Message-
From: Craig R. McClanahan [mailto:[EMAIL PROTECTED] 
Sent: Monday, August 11, 2003 2:07 AM
To: Struts Users Mailing List
Subject: Re: message localization

On Mon, 11 Aug 2003, Erez Efrati wrote:

> Date: Mon, 11 Aug 2003 01:24:58 +0200
> From: Erez Efrati <[EMAIL PROTECTED]>
> Reply-To: Struts Users Mailing List <[EMAIL PROTECTED]>
> To: 'Struts Users Mailing List' <[EMAIL PROTECTED]>
> Subject: message localization
>
> All this talking on JSP 2.0, JSTL and Struts-el brought me to ask if
> I should avoid using the following:
>
> 
>
> Could someone tell me what is the equivalent in JSTL?
>

JSTL has formatting and i18n tags that get localized text from resource
bundles instead of Struts MessageResources objects -- check out the
 tag, in Section 8.1 of the spec.

> Erez

Craig

-
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: Remove a key from collection.

2003-08-11 Thread Erez Efrati
I don't really have the entire picture here but I would suggest: 

In you PropertiesBean split between the known, and dynamic containers of
properties and then in the page pull them using different property on
the PropertiesBean. This way it would be much more clear which is
expected and which is dynamically added.
Simply put to HashMaps on the PropBean and two sets of set/get to get
and set those properties.

This is only one solution I guess there are more. :)

Hope this helps,
Erez

-Original Message-
From: K.M.Prabhu [mailto:[EMAIL PROTECTED] 
Sent: Thursday, August 07, 2003 3:26 PM
To: [EMAIL PROTECTED]
Subject: Remove a key from collection.

Hi All,
I am having a collection of properties with keys of the form, say 
1,2,3,4,. Of these, a few keys are well known (say 1,2,3) and  the 
others will be
added to the properties object at run time. I want to display them in an

order in my UI, say 1,2,3,4..  To do this, first I get the values 
for the
known keys (1,2,3). For the remaining things, I put them in a loop and 
print it. But, the problem I face is , the already printed value will 
also print
once again (since I will not know if the key is present in my known list

or not). My question is how can i remove the key values once i print it.

Can anyone help me?

Thanks,
Prabhu


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



Actions Best Practice

2003-08-11 Thread Erez Efrati
I am looking for the best practice for writing Actions in my
application.
For example: 
I have a forgot password action where the users are taken to a page
where they can enter their username and click 'sumbit' and another page
is shown saying that their password was sent to their registered email.

Several options:
A) Have two actions:
1. InitForgotPasswordAction.java - just for showing the page and
if thereis some logic to do first then do it here.
2. SendForgotPasswordAction.java - handles the send.

B) Single action ForgotPasswordAction with dispatch 'init' and 'send'.

One of the problem I found with 'action=init' method, is that the
validation is activated automatically for both cases (both init & send),
and fails of course on the 'init' cause no field is yet in the form. So
I was forced to configure 'validate=false' and call it manually in the
Action code.

Any comment will be greatly appreciated here,
Thanks,

Erez



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



simple JSTL question

2003-08-11 Thread Erez Efrati
Some simple questions:

1) How do I subscribe to the JSTL mailing list? (I rather ask simple
dumb questions than stay with dumb answers :)

2) What is the latest version of JSTL that I should use? Currently I am
using the JSTL and Struts-el in combination.

Thanks,
Erez



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



Validator

2003-08-10 Thread Erez Efrati

I am trying to figure out the code in struts.validator.FieldsCheck.java
in order to write one of my own.
Can someone explain what the purpose of the following lines of code in
all of the validateXXX() in Struts:

validateIntRange (...) {

if (isString(bean)) {
value = (String) bean;
}
...
}

Is this really necessary?

Erez



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



RE: Actions Best Practice

2003-08-10 Thread Erez Efrati
The only thing you cannot do is having a mixture of this solution
(having the action-mapping parameter set to the 'init' or else) and the
one of DispatchAction class that keeps all the operation under the same
roof (class).

Erez

-Original Message-
From: Adam Hardy [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, August 06, 2003 3:00 PM
To: Struts Users Mailing List
Subject: Re: Actions Best Practice

That's not necessary. In the action mapping, you can specify the action 
parameter with parameter="init" or parameter="send".

Erez Efrati wrote:
> Taking your advice, it means that I would have two different action
> mappings, one for the init step and the second for the actual action
> (send).
> But then I will have to write something like 
>  which is a bit
> strange to write again the "init", and it is needed cause the
> ForgotPasswordAction.java needs this 'action' parameter to distinguish
> between the two. Hmm.. 
> 
> Erez
> 
> -Original Message-
> From: Adam Hardy [mailto:[EMAIL PROTECTED] 
> Sent: Wednesday, August 06, 2003 11:43 AM
> To: Struts Users Mailing List
> Subject: Re: Actions Best Practice
> 
> Erez Efrati wrote:
> 
> 
>>One of the problem I found with 'action=init' method, is that the
>>validation is activated automatically for both cases (both init &
> 
> send),
> 
>>and fails of course on the 'init' cause no field is yet in the form.
> 
> So
> 
>>I was forced to configure 'validate=false' and call it manually in the
>>Action code.
>>
> 
> 
> Option B would be compacter. You can write two action mappings in 
> struts-config to distinguish the calls, where one has no validation
and 
> the other does.
> 
> I know some people don't like having extra action mappings in their 
> struts-config, but I believe that is what they are there for.
> 
> 
> Adam
> 
> 
> -
> 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]



Validator real time expression vars

2003-08-10 Thread Erez Efrati
Is there a way to use vars in validation.xml  that are not
constants in a way that the javascript will use these values?

Thanks,
Erez



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



  1   2   >