Re: ActionForm 'reset' method being called when JSP is rendered

2003-06-19 Thread Paul Harrison
I have looked at this again, and in 1.1 rc2 on tomcat 4.1.18 the reset 
is called for each action of a multi action sequence sharing a form bean 
even though the form bean is in session scope and only created once - I 
have written a demo app with logging that shows this behaviour - should 
I submit a bug if this is not what is intended to happen.

Paul.

Paul Harrison wrote:

I am writing an application with a series of "wizard" type pages, so I 
thought that I would use one big ActionForm in session scope and each 
page add extra information to it - however this did not work as reset 
was being called at each page invocation - I am interested to hear 
that reset should only be called at instantiation time, because I 
believe that in 1.1 RC2 it is being called more often  than that - I 
can did out the old verision of the code to have a look at the exact 
circumstances if necessary

Ted Husted wrote:

In Struts 1.0.2 and later, reset is called by the html:form tag *if* 
the ActionForm is being instantiated at that time. The scope 
shouldn't matter.

Also remember that the html:form tag is looking at the Action to 
which it submits, which may not be "Action 1". If these are the same 
Action, or share the same formbean under the same attribute, then the 
ActionForm should already exist, and reset should not be called.

-Ted.

Jerry Jalenak wrote:

I'm seeing some odd behaviour with one of my actions.  If anyone can 
explain
this I'd sure appreciate it

Here's what I've got - in struts-config I have an ActionForm that is 
shared
by two Actions.  The ActionForm is created in session scope by the 
first
action, and referenced by the second Action (also in session).  
Tracing the
calls to 'reset' and 'validate' I see the following:

JSP is displayed  -> html form is submitted -> 'reset' is called ->
'validate' is called -> Action 1 is performed -> forward to next JSP ->
'reset' is called -> JSP is displayed
/\/\/\/\/\/\/\ !
My understanding is that 'reset' should not be called again until 
the form
on the second JSP is submitted.  Have I completely mis-understood 
how this
works?  Or is it something due to the ActionForm being created in 
session
scope?

TIA!

Jerry Jalenak
Team Lead, Web Publishing
LabOne, Inc.
10101 Renner Blvd.
Lenexa, KS  66219
(913) 577-1496
[EMAIL PROTECTED]

This transmission (and any information attached to it) may be 
confidential and is intended solely for the use of the individual or 
entity to which it is addressed. If you are not the intended 
recipient or the person responsible for delivering the transmission 
to the intended recipient, be advised that you have received this 
transmission in error and that any use, dissemination, forwarding, 
printing, or copying of this information is strictly prohibited. If 
you have received this transmission in error, please immediately 
notify LabOne at the following email address: 
[EMAIL PROTECTED]



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




--
Paul Harrison
[EMAIL PROTECTED]
tel: 0161 428 2794
mob: 07904025192


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


Re: ActionForm 'reset' method being called when JSP is rendered

2003-06-19 Thread Paul Harrison
I am writing an application with a series of "wizard" type pages, so I 
thought that I would use one big ActionForm in session scope and each 
page add extra information to it - however this did not work as reset 
was being called at each page invocation - I am interested to hear that 
reset should only be called at instantiation time, because I believe 
that in 1.1 RC2 it is being called more often  than that - I can did out 
the old verision of the code to have a look at the exact circumstances 
if necessary

Ted Husted wrote:

In Struts 1.0.2 and later, reset is called by the html:form tag *if* 
the ActionForm is being instantiated at that time. The scope shouldn't 
matter.

Also remember that the html:form tag is looking at the Action to which 
it submits, which may not be "Action 1". If these are the same Action, 
or share the same formbean under the same attribute, then the 
ActionForm should already exist, and reset should not be called.

-Ted.

Jerry Jalenak wrote:

I'm seeing some odd behaviour with one of my actions.  If anyone can 
explain
this I'd sure appreciate it

Here's what I've got - in struts-config I have an ActionForm that is 
shared
by two Actions.  The ActionForm is created in session scope by the first
action, and referenced by the second Action (also in session).  
Tracing the
calls to 'reset' and 'validate' I see the following:

JSP is displayed  -> html form is submitted -> 'reset' is called ->
'validate' is called -> Action 1 is performed -> forward to next JSP ->
'reset' is called -> JSP is displayed

/\/\/\/\/\/\/\ !

My understanding is that 'reset' should not be called again until the 
form
on the second JSP is submitted.  Have I completely mis-understood how 
this
works?  Or is it something due to the ActionForm being created in 
session
scope?

TIA!

Jerry Jalenak
Team Lead, Web Publishing
LabOne, Inc.
10101 Renner Blvd.
Lenexa, KS  66219
(913) 577-1496
[EMAIL PROTECTED]

This transmission (and any information attached to it) may be 
confidential and is intended solely for the use of the individual or 
entity to which it is addressed. If you are not the intended 
recipient or the person responsible for delivering the transmission 
to the intended recipient, be advised that you have received this 
transmission in error and that any use, dissemination, forwarding, 
printing, or copying of this information is strictly prohibited. If 
you have received this transmission in error, please immediately 
notify LabOne at the following email address: 
[EMAIL PROTECTED]



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



--
Paul Harrison
[EMAIL PROTECTED]
tel: 0161 428 2794
mob: 07904025192


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


Re: Problems with an inherited getter in a derived bean

2003-06-18 Thread Paul Harrison
thanks for confirming that this should work - one fact that I omitted in 
my original mailing was that the classes were inner classes

i.e. it  was the PostCode.Area class that is in the collection

public class PostCode
{
protected static class Pbase
   {
   protected String name;
   public String getName()
   {
   return name;
   }
   }
   public static class Area extends Pbase
   {
   }
}

I works it I change the access on the Pbase class to public, but do I 
have to ? I thought that it was legal to have derived classes increase 
the accessibility - I do not want to expose the Pbase class - 
however this is pushing the limits of my knowledge about what should be 
happening.

Alen Ribic wrote:

I'm doing the same thing in my current project successfully.
No problems in my specializes class.
e.g.

public abstract class BaseBusinessBean
   implements java.io.Serializable {
   protected int id;
   protected String description;
   // getters/setters here
}
e.g.

public class Category
   extends BaseBusinessBean {
   // Category specific getters/setters
}
Now  I use Category class with no problem in my options for select box.

You have code ?

--Alen



- Original Message -
From: "Paul Harrison" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Wednesday, June 18, 2003 4:55 PM
Subject: Problems with an inherited getter in a derived bean
 

In my struts application, I have a base bean with a set of basic
properties (e.g. name) and then I create various derived beans with
their own extra properties. I have a problem with the  tag
in that if I try to read a property  that is inherited from the base
bean  from a collection of the derived beans
i.e. I have a tag like this



- I get an error saying

No getter method available for property name for bean under name
   

CountyList
 

and if I implement the getter in the derived bean the  error goes away.
Is this known behaviour in struts - is seems like a bug to me (or
perhaps a bug in commons-beanutils?) Can anyone comment
--
Paul Harrison
[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]
 

--
Paul Harrison
[EMAIL PROTECTED]
tel: 0161 428 2794
mob: 07904025192


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


Problems with an inherited getter in a derived bean

2003-06-18 Thread Paul Harrison
In my struts application, I have a base bean with a set of basic 
properties (e.g. name) and then I create various derived beans with 
their own extra properties. I have a problem with the  tag 
in that if I try to read a property  that is inherited from the base 
bean  from a collection of the derived beans

i.e. I have a tag like this



- I get an error saying

No getter method available for property name for bean under name CountyList

and if I implement the getter in the derived bean the  error goes away. 
Is this known behaviour in struts - is seems like a bug to me (or 
perhaps a bug in commons-beanutils?) Can anyone comment

--
Paul Harrison
[EMAIL PROTECTED]



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