Re: Form Beans - Vector

2002-03-28 Thread Ian Tomey


This will work if the form is in session scope, but NOT if it is in request scope. the 
reason being is that the form is recreated every time, and the parameterList will be 
null.

what is needed is some kind of creation description in the config file - which I built 
a quick version of yesterday. I don't know if the dynamic form beans are supposed to 
fix this kind of issue... does anybody know? (aka when is that going to get 
documented? lol)

if not I should be able tidy this stuff up a bit and submit it to somebody who can do 
the proper integration.

my config xml stuff looks like this:

form-creation-definition name=aForm
form-creation-property name=someProperties
type=java.util.ArrayList
sizeProperty=propertyCount
childType=foo.bar.SomePropertyType

form-creation-property
 name=subProperties
 type=java.util.Vector
 sizeProperty=someProperties[].subPropertiesSize
 childType=foo.bar.AnotherPropertyType/
 
/form-creation-property
/form-creation-definition

only aggravating thing is placing the size of collections into the form, so they can 
(have) to be written out by nested:hiddens. Would be easier if either the collection 
interfaces could be accessed as a bean properly (ie. getSize() instead of size() ) or 
the commons output code could handle it.

Regards
Ian


 [EMAIL PROTECTED] 03/27/02 07:54pm 
Hi, Perpetua
The attachement is  the example,  I tested it, it is OK.
It is not my work. A kind person.send me.
Hope it is useful for you.

Annie


- Original Message -
From: Ted Husted [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Wednesday, March 27, 2002 5:42 AM
Subject: Re: Form Beans - Vector


 Generally, specifying the type seems to help.

 .. type=java.util.Vector ...

 I don't use Vectors myself, since the synchronized aspect is not useful
 in the kind of applications I tend to work on, but using them with the
 iterate tags does seem to generate a lot of messages.

 If you continue to have problems, and if it's possible to use another
 collection class, like ArrayList, I'd do that. If not, I'd add a helper
 method that returned the Vector as an array.

 -- Ted Husted, Husted dot Com, Fairport NY US
 -- Developing Java Web Applications with Struts
 -- Tel: +1 585 737-3463
 -- Web: http://husted.com/about/services 

 Perpetua Cysne wrote:
 
  Could someone please provide me with an example of Form Beans using a
Vector
  of objects? How do display it in a iterate tag?
 
  The object is Passenger(firstName, lastName).
 
  Thank you!
 
  Perpetua
 
  --
  To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
  For additional commands, e-mail:
mailto:[EMAIL PROTECTED]

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




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




Re: Form Beans - Vector

2002-03-27 Thread Ted Husted

Generally, specifying the type seems to help. 

.. type=java.util.Vector ...

I don't use Vectors myself, since the synchronized aspect is not useful
in the kind of applications I tend to work on, but using them with the
iterate tags does seem to generate a lot of messages. 

If you continue to have problems, and if it's possible to use another
collection class, like ArrayList, I'd do that. If not, I'd add a helper
method that returned the Vector as an array.

-- Ted Husted, Husted dot Com, Fairport NY US
-- Developing Java Web Applications with Struts
-- Tel: +1 585 737-3463
-- Web: http://husted.com/about/services

Perpetua Cysne wrote:
 
 Could someone please provide me with an example of Form Beans using a Vector
 of objects? How do display it in a iterate tag?
 
 The object is Passenger(firstName, lastName).
 
 Thank you!
 
 Perpetua
 
 --
 To unsubscribe, e-mail:   mailto:[EMAIL PROTECTED]
 For additional commands, e-mail: mailto:[EMAIL PROTECTED]

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




Re: Form Beans - Vector

2002-03-27 Thread Annie Chang

Hi, Perpetua
The attachement is  the example,  I tested it, it is OK.
It is not my work. A kind person.send me.
Hope it is useful for you.

Annie


- Original Message -
From: Ted Husted [EMAIL PROTECTED]
To: Struts Users Mailing List [EMAIL PROTECTED]
Sent: Wednesday, March 27, 2002 5:42 AM
Subject: Re: Form Beans - Vector


 Generally, specifying the type seems to help.

 .. type=java.util.Vector ...

 I don't use Vectors myself, since the synchronized aspect is not useful
 in the kind of applications I tend to work on, but using them with the
 iterate tags does seem to generate a lot of messages.

 If you continue to have problems, and if it's possible to use another
 collection class, like ArrayList, I'd do that. If not, I'd add a helper
 method that returned the Vector as an array.

 -- Ted Husted, Husted dot Com, Fairport NY US
 -- Developing Java Web Applications with Struts
 -- Tel: +1 585 737-3463
 -- Web: http://husted.com/about/services

 Perpetua Cysne wrote:
 
  Could someone please provide me with an example of Form Beans using a
Vector
  of objects? How do display it in a iterate tag?
 
  The object is Passenger(firstName, lastName).
 
  Thank you!
 
  Perpetua
 
  --
  To unsubscribe, e-mail:
mailto:[EMAIL PROTECTED]
  For additional commands, e-mail:
mailto:[EMAIL PROTECTED]

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




?xml version=1.0 encoding=ISO-8859-1 ?

!DOCTYPE struts-config PUBLIC
  -//Apache Software Foundation//DTD Struts Configuration 1.0//EN
  http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd;

struts-config

form-beans type=org.apache.struts.action.ActionFormBean
	form-bean 
  name=LoginForm
  type=beans.LoginForm /
	form-bean 
  name=ParametersForm
  type=beans.ParametersForm /
   form-bean
  name=LoggingForm
  type=beans.LoggingForm /
   form-bean
  name=TraceForm
  type=beans.TraceForm /
   form-bean
  name=LogFilterForm
  type=beans.LogFilterForm /
   form-bean
  name=LogForm
  type=beans.LogForm /
   form-bean
  name=SnapshotFilterForm
  type=beans.SnapshotFilterForm /
   form-bean
  name=SnapshotForm
  type=beans.SnapshotForm /
/form-beans

action-mappings
	!-- Show Login Page --
	action
		path=/ShowLogin
		type=beans.ShowLoginAction
		name=LoginForm
		forward name=success path=/login.jsp /
	/action
	
	!-- Login --
	action
		path=/Login
		type=beans.LoginAction
		name=LoginForm
		input=/login.jsp
		validate=true
		forward name=success path=/welcome.htm /
	/action
	
	!-- Edit parameters --
	action
		path=/ShowParameters
		type=beans.ShowParametersAction
		name=ParametersForm
		forward name=success path=/parameters.jsp /
	/action
	
	!-- Save parameters --
	action
		path=/SaveParameters
		type=beans.SaveParametersAction
		name=ParametersForm
		forward name=success path=/welcome.htm /
	/action
	
	!-- Edit logging --
	action
		path=/ShowLogging
		type=beans.ShowLoggingAction
		name=LoggingForm
		forward name=success path=/logging.jsp /
	/action
		
	
	!-- Save logging --
	action
		path=/SaveLogging
		type=beans.SaveLoggingAction
		name=LoggingForm
		forward name=success path=/welcome.htm /
	/action

  
	!-- Edit Trace --
	action
		path=/ShowTrace
		type=beans.ShowTraceAction
		name=TraceForm
		forward name=success path=/trace.jsp /
	/action

  
	!-- Save Trace --
	action
		path=/SaveTrace
		type=beans.SaveTraceAction
		name=TraceForm
		forward name=success path=/welcome.htm /
	/action


	!-- Show Log filter --
	action
		path=/ShowLogFilter
		type=beans.ShowLogFilterAction
		name=LogFilterForm
		input=/index.jsp
		validate=false
		forward name=success path=/logFilter.jsp /
	/action


	!-- Change Log File Name --
	action
		path=/ChangeLogFileName
		type=beans.ChangeLogFileNameAction
		name=LogFilterForm
		validate=false
		forward name=display path=/changeLogFileName.jsp /
		forward name=done path=/ShowLogFilter.do /
	/action


	!-- Process Log filter --
	action
		path=/ProcessLogFilter
		type=beans.ProcessLogFilterAction
		name=LogFilterForm
		input=/logFilter.jsp
		validate=true
		forward name=showLog path=/ShowLog.do redirect=false /
		forward name=downloadLog path=/DownloadLog.do redirect=false /
	/action

	!-- Show Log --
	action
		path=/ShowLog
		type=beans.ShowLogAction
		name=LogForm
		forward name=success path=/log.jsp /
	/action


	!-- Download Log --
	action
		path=/DownloadLog
		type=beans.DownloadLogAction
		name=LogForm
		forward name=success path=/log.jsp /
	/action


	!-- Show Snapshot filter --
	action
		path=/ShowSnapshotFilter
		type=beans.ShowSnapshotFilterAction
		name=SnapshotForm
		input=/snapshotFilter.jsp
		validate=true
		forward name=success path=/snapshotFilter.jsp /
	/action
   

	!-- Process Snapshot filter 
	action
		path=/ProcessSnapshotFilter
		type=beans.ShowSnapshotAction
		name=SnapshotForm
		input=/snapshotFilter.jsp
		validate=true
		forward name=success path

Form Beans - Vector

2002-03-22 Thread Perpetua Cysne

Could someone please provide me with an example of Form Beans using a Vector
of objects? How do display it in a iterate tag?

The object is Passenger(firstName, lastName).

Thank you!

Perpetua


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