Problem with

2003-01-17 Thread Drew Zimber

This code does not work can any one explain me why ?



  

  

this code throws a null pointer exception from

error
java.lang.NullPointerException
at
org.apache.struts.taglib.nested.NestedPropertyHelper.getNestedProperty(Neste
dPropertyHelper.java:173)
at
org.apache.struts.taglib.nested.NestedPropertyHelper.getNestedProperty(Neste
dPropertyHelper.java:195)
at
org.apache.struts.taglib.nested.NestedPropertyHelper.setNestedProperties(Nes
tedPropertyHelper.java:242)
at
org.apache.struts.taglib.nested.logic.NestedEqualTag.doStartTag(NestedEqualT
ag.java:91)
at
jrun__jsp__common__modelGroup2ejsp1a._jspService(jrun__jsp__common__modelGro
up2ejsp1a.java:284)
at jrun.jsp.runtime.HttpJSPServlet.service(HttpJSPServlet.java:43)
at jrun.jsp.JSPServlet.service(JSPServlet.java:110)
at jrun.servlet.ServletInvoker.invoke(ServletInvoker.java:91)
at jrun.servlet.JRunInvokerChain.invokeNext(JRunInvokerChain.java:42)
at
jrun.servlet.JRunRequestDispatcher.invokeNext(JRunRequestDispatcher.java:408
)
at
jrun.servlet.JRunRequestDispatcher.forwardInvoke(JRunRequestDispatcher.java:
378)
at
jrun.servlet.JRunRequestDispatcher.forward(JRunRequestDispatcher.java:157)
at
org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:10
14)
at
org.apache.struts.action.RequestProcessor.processForwardConfig(RequestProces
sor.java:417)
at
org.apache.struts.action.RequestProcessor.processActionForward(RequestProces
sor.java:390)
at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:271)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1292)


If I use scriptlet this code works

<% if(ctr == 0) { %>

<% } %>



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




problem with

2003-01-17 Thread Drew Zimber


This code does not work can any one explain me why ?



  

  

this code throws a null


This code works 

<% if(ctr == 0) { %>

<% } %>


thankx

--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: collections in forms

2002-12-05 Thread Drew Zimber


thanks for the reply...i was busy doing something else but i will get back
to you tomorrow after some testing

dz

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 05, 2002 9:59 AM
To: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: RE: collections in forms


Hi,
If u are displaying the screen as text fields(using html:text tag),what ever
u
show on screen will be retained as all the data gets resubmitted back and
struts repopulates teh form again with the data.
But if u are showing a read only data on screen using bean:write tag,then
the
data will nto be retained as bean write tag does not include parameters in
request.So in this case if u want to retain the data, u should also use
html:hidden for each bean write u want to retain so that when the form is
submitted, the data is resent back.

I am giving some sample code...GO through it.Hope it helps.

//Form Class
import java.util.ArrayList;
import java.util.List;

import org.apache.struts.action.ActionForm;

public class ExampleListForm extends ActionForm {

//A list of Emp beans
private List beanList = new ArrayList();

public List getBeanList(){
return beanList;
}

public void setBeanList(List list){
beanList = list;
}

//very imp.
//give indexed access to the beans
public Employee getEmployee(int index){
//very imp
//when a jsp is submited , then while auto populating the form,this
will ensure that
// teh fporm is populated properly.
if(index >= beanList.size()){
beanList.add(new Employee());
}
return (Employee)beanList.get(index);
}

public void setEmployee(int index,Employee emp){
beanList.set(index,emp);
}
}
***
Bean class
public class Employee {

private String name;

private String salary;

/**
 * Returns the name.
 * @return String
 */
public String getName() {
return name;
}

/**
 * Returns the salary.
 * @return String
 */
public String getSalary() {
return salary;
}

/**
 * Sets the name.
 * @param name The name to set
 */
public void setName(String name) {
this.name = name;
}

/**
 * Sets the salary.
 * @param salary The salary to set
 */
public void setSalary(String salary) {
this.salary = salary;
}

}

JSP
<%@ page language="java"%>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>



">
">



***





-Original Message-
From: drew.zimber [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 05, 2002 3:07 PM
To: struts-user
Subject: collections in forms



hey all...

i've used struts quite a bit now, but im not too well versed with
manipulating collections in form objects.  I had thought there was a way to
set up your forms/pages so that if you display a collection on screen and
submit back, the form in the least retains the collection in the action
class (an update would be nice too, but step by step i guess).

everytime i submit back to a form, the Collection comes back null.  Can
anyone give me some info/links/ideas on this so i dont have to rely on the
session so much?


thx!
dz


--
To unsubscribe, e-mail:

For additional commands, e-mail:




--
To unsubscribe, e-mail:

For additional commands, e-mail:



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




collections in forms

2002-12-05 Thread Drew Zimber

hey all...

i've used struts quite a bit now, but im not too well versed with
manipulating collections in form objects.  I had thought there was a way to
set up your forms/pages so that if you display a collection on screen and
submit back, the form in the least retains the collection in the action
class (an update would be nice too, but step by step i guess).

everytime i submit back to a form, the Collection comes back null.  Can
anyone give me some info/links/ideas on this so i dont have to rely on the
session so much?


thx!
dz


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: Tomcat 4.1.16/Struts 1.1b2/Tiles == BLAM

2002-12-03 Thread Drew Zimber

sorry i cant help ya, but i liked the "blam" word usage.  nice work!

dz

-Original Message-
From: Dave Hodson [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 03, 2002 1:08 PM
To: [EMAIL PROTECTED]
Subject: Tomcat 4.1.16/Struts 1.1b2/Tiles == BLAM


Anyone out there having problems with the latest Tomcat build (4.1.16)? I'm
using Struts 1.1b2 with Tiles and am unable to get any part of my app to
load (it works fine with Tomcat 4.0.3)
 
Stack trace below
 
Regards,
 
Dave
---
StandardWrapper[/config:jsp]: Marking servlet jsp as unavailable
StandardContext[/config]: Servlet /config threw load() exception:
javax.servlet.ServletException: Wrapper cannot find servlet class
org.apache.jasper.servlet.JspServlet or a class it depends on
javax.servlet.ServletException: Wrapper cannot find servlet class
org.apache.jasper.servlet.JspServlet or a class it depends on
 at
org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:87
1)
 at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:808)
 at
org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:
3266)
 at
org.apache.catalina.core.StandardContext.start(StandardContext.java:3395)
 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
 at org.apache.catalina.core.StandardHost.start(StandardHost.java:614)
 at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1123)
 at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:343)
 at org.apache.catalina.core.StandardService.start(StandardService.java:388)
 at org.apache.catalina.core.StandardServer.start(StandardServer.java:506)
 at org.apache.catalina.startup.Catalina.start(Catalina.java:781)
 at org.apache.catalina.startup.Catalina.execute(Catalina.java:681)
 at org.apache.catalina.startup.Catalina.process(Catalina.java:179)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
 at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
 at java.lang.reflect.Method.invoke(Method.java:324)
 at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
 
 
---
Dave Hodson 
MessageCast, inc.
Email: [EMAIL PROTECTED]
www.messagecast.net
 

<>--
To unsubscribe, e-mail:   
For additional commands, e-mail: 


RE: onclick attribute doesnt work in tag?

2002-11-18 Thread Drew Zimber


serveri think i found the problem though - outdated tld tags somehow got
in there.  Thanks for the help anyhow.

dz

-Original Message-
From: Andrew Hill [mailto:[EMAIL PROTECTED]]
Sent: Monday, November 18, 2002 10:25 AM
To: Struts Users Mailing List
Subject: RE: onclick attribute doesnt work in  tag?


Is it the browser or the server that is crashing?

-Original Message-
From: Drew Zimber [mailto:[EMAIL PROTECTED]]
Sent: Monday, November 18, 2002 23:21
To: 'Struts Users Mailing List'
Subject: RE: onclick attribute doesnt work in  tag?




stack trace is giving me nothing right now, im going to due some further
investigation...

dz

-Original Message-
From: Gemes Tibor [mailto:[EMAIL PROTECTED]]
Sent: Monday, November 18, 2002 10:16 AM
To: Struts Users Mailing List
Subject: Re: onclick attribute doesnt work in  tag?


2002. november 18. 16:09 dátummal Drew Zimber ezt írtad:
> anyone had any experience with this.  Anytime i add the onclick attribute
> it crashes the page..

I bet the stacktrace contains the error caused your crash. Read it.

Tip: check your case onclick and not onClick!

Tip #2: check your quotation marks.

Hth,

Tib

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


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




RE: onclick attribute doesnt work in tag?

2002-11-18 Thread Drew Zimber


stack trace is giving me nothing right now, im going to due some further
investigation...

dz

-Original Message-
From: Gemes Tibor [mailto:[EMAIL PROTECTED]]
Sent: Monday, November 18, 2002 10:16 AM
To: Struts Users Mailing List
Subject: Re: onclick attribute doesnt work in  tag?


2002. november 18. 16:09 dátummal Drew Zimber ezt írtad:
> anyone had any experience with this.  Anytime i add the onclick attribute
> it crashes the page..

I bet the stacktrace contains the error caused your crash. Read it.

Tip: check your case onclick and not onClick!

Tip #2: check your quotation marks.

Hth,

Tib

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




onclick attribute doesnt work in tag?

2002-11-18 Thread Drew Zimber


anyone had any experience with this.  Anytime i add the onclick attribute it
crashes the page..


dz


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: [OT]Need magic incantation [Friday alert!]

2002-11-15 Thread Drew Zimber


one of the most brilliant solutions I've ever come across, you're a true
software engineer! ;)

dz

> Here's the solution:
>
>  - Look around the case to your PC. You should find a power switch.
>
>  - Turn the switch to the "off" position (sometimes shown as a "0").
>
>  - Put your coat on.
>
> - Get your keys and wallet. Walk to your car.
>
>  - Drive to nearest pub. The bartender there will provide you with your
> next instructions.
>
> K.




--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: nested:iterate in an included page

2002-11-15 Thread Drew Zimber

hey arron and chris,

Good stuff on this nested tag issue.   When you say you need struts 1.1
instead of 1.1 b2, are you referring to just grabbing one of the nightly
builds or something else.  Hook me up brother!!!

dz

-Original Message-
From: Arron Bates [mailto:struts-user@;keyboardmonkey.com]
Sent: Friday, November 15, 2002 7:28 AM
To: Struts Users Mailing List
Subject: RE: nested:iterate in an included page


> I did not have any nested tags in the top page so I added one and
> now my code looks like this:
>
> (Your example referenced  and I assume you meant
> )

That'd be the one... :)


> I am still getting the null reference on the first nested tag in the
> included jsp.  I am using Struts 1.1B2.

1.1 is what we need.


> I must admit to not totally understanding your explanation of what
> property to reference in the nested parent tag

Doesn't really matter, but a parent nested tag (root, iterate, nest etc)
put the reference to the root bean and the current nested property into
the request object. This is so included pages can get a reference to the
root bean the the correct nested property by fetching it back out of the
request object.


> -- I am referencing my
> form object (which is, in fact, the parent I want).  I am also still a
> bit confused on whether I need a nested root tag or not.

This is where I have to apologise. You'll need an empty (no properties
are set at all)  tag in the included page, this will then
look to the request object for the bean/property reference.

Sorry about the hassle.

If you have any trouble, rather than wait for replies from the list to
run over the start of the tutorial I wrote about nesting through
includes to make a tree structure...


http://www.keyboardmonkey.com/pilotlight

...and click on the first link in the "JSP Reursion & TREES" tutorial.


Arron.


--
To unsubscribe, e-mail:

For additional commands, e-mail:



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: nested:iterate in an included page

2002-11-14 Thread Drew Zimber


just ran into this yesterday.  From what i can tell, the nested tags NEED
the  tags on that very page, or else it cant seem to resolve the
form object.  If anyone knows a way around this, i'd like to hear it as this
seems to defeat the purpose of templating...

try putting the form tags just on that included page and see if you get the
errors.

dz

-Original Message-
From: Chris Sargent [mailto:csargent@;aerisinc.com]
Sent: Thursday, November 14, 2002 4:07 PM
To: Struts Mail List
Subject: nested:iterate in an included page


I am having trouble using the nested:iterate tag in a page that I am
including using jsp:include.  I am probably doing something silly, but
could someone provide some help?  My main page looks like this:

   ...

   
   ...
   
   ...

And the included page looks like this:

   
   
   


I get a null ref error on the nested:iterate tag in the included page.

Any help is much appreciated!

Chris


--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: IndexOutOfBounds error, Struts 1.1b2, J2SDK 1.4.1

2002-11-14 Thread Drew Zimber


if you think thats the case, you could crack open the jar files for 1.3.x,
take out the reflection classes and replace them in the 1.4.1 jar.

If that works then look at the modification notes in the 1.4.1 source, see
what they did and email the developers directly.

dz

-Original Message-
From: Jim Krygowski [mailto:james.krygowski@;shaws.com]
Sent: Thursday, November 14, 2002 2:49 PM
To: Struts Users Mailing List
Subject: RE: IndexOutOfBounds error, Struts 1.1b2, J2SDK 1.4.1


The usage of "displaySections[0]" comes from struts itself when it
disassembles the request to determine which HTML form field values map to
what Bean properties.  The identification of PropertyDescriptor vs
IndexedPropertyDescriptor is solely the realm of
BeanInfo.getPropertyDescriptor.  You can see this at work in PropertyUtils
method public static PropertyDescriptor[] getPropertyDescriptors(Class
beanClass).

So no matter what struts thinks about names, it's really all up to Java's
reflection capabilities.  This is why I feel that we've got a potential JDK
1.4.1 issue here.






> -Original Message-
> From: Karr, David [mailto:david.karr@;attws.com]
> Sent: Thursday, November 14, 2002 2:40 PM
> To: Struts Users Mailing List
> Subject: RE: IndexOutOfBounds error, Struts 1.1b2, J2SDK 1.4.1
>
>
> So you're telling me that in both test cases, the "name" value is
> "displaySections", and in the "before" test case, you get back an
> IndexedPropertyDescriptor, and in the "after" test case, you get
> back a PropertyDescriptor?  I'm not that familiar with this code,
> but I don't see how you could get back an
> IndexedPropertyDescriptor, no matter what JDK version you're
> using.  If your name value was "displaySections[]" then
> you should get an IndexedPropertyDescriptor, otherwise a
> PropertyDescriptor.
>
> > -Original Message-
> > From: Jim Krygowski [mailto:james.krygowski@;shaws.com]
> >
> > As you suggested I delved into getDisplaySections.  I found
> > that my "name"
> > value, displaySections, was inappropriately identified as an
> > PropertyDescriptor even though it is defined as an ArrayList
> > with get and
> > set methods that handle the ArrayList datatype.  The funny
> > thing is that the
> > propertyType attribute of the PropertyDescriptor is ArrayList for the
> > displaySections node.
> >
> > Given this new info, what do you think is going on here?
> >
> >
> > > -Original Message-
> > > From: Karr, David [mailto:david.karr@;attws.com]
> > > Sent: Thursday, November 14, 2002 2:03 PM
> > > To: Struts Users Mailing List
> > > Subject: RE: IndexOutOfBounds error, Struts 1.1b2, J2SDK 1.4.1
> > >
> > >
> > > Step through the "getPropertyDescriptor()" method, which is
> > > called just before that check.  That's what makes the decision on
> > > what type to return.  What is the value of "name"?
> > >
> > > > -Original Message-
> > > > From: Jim Krygowski [mailto:james.krygowski@;shaws.com]
> > > > Sent: Thursday, November 14, 2002 10:43 AM
> > > > To: Struts Users Mailing List
> > > > Subject: RE: IndexOutOfBounds error, Struts 1.1b2, J2SDK 1.4.1
> > > >
> > > >
> > > > Been doing some research since my last post.  Here's the
> > setup, same
> > > > application code, same struts jars, same app server switching
> > > > between JDK
> > > > 1.3.1 and 1.4.1:
> > > >
> > > > When processing a submit, in the PropertyUtils the following
> > > > check is made
> > > > in the getIndexedProperty method on or around line 468:
> > > >
> > > >  if (descriptor instanceof IndexedPropertyDescriptor) {
> > > >
> > > > With JDK 1.3.1 running descriptor is indeed an
> > > > IndexedPropertyDescriptor,
> > > > but with JDK 1.4.1 I get a java.beans.PropertyDescriptor, so
> > > > the code passes
> > > > by the block that should handle the property I've passed an
> > > > onto a block of
> > > > code that results in the IndexOutOfBoundsException.
> > > >
> > > > This seems like a 1.4.1 induced bug.  Should I log it in
> > > > Bugzilla?  Has
> > > > anyone else seen this bug?
> > > >
> > > >
> > > >
> > > > > -Original Message-
> > > > > From: Jim Krygowski [mailto:james.krygowski@;shaws.com]
> > > > > Sent: Thursday, November 14, 2002 11:32 AM
> > > > > To: Struts Users Mailing List
> > > > > Subject: IndexOutOfBounds error, Struts 1.1b2, J2SDK 1.4.1
> > > > >
> > > > >
> > > > > Hi all-
> > > > >
> > > > > we have an application originally written to struts 1.1b2 and
> > > > > J2SDK 1.3.1_03
> > > > > that was working fine.  Recently, we've been given the signal to
> > > > > upgrade to
> > > > > J2SDK 1.4.1.  Fine, but now we're finding that our form
> > > > posts are failing
> > > > > with IndexOutOfBoundsException.  I've traced through the Struts
> > > > > source with
> > > > > a debugger and found the problem in this block of
> > > > PropertyUtils code:
> > > > >
> > > > > // Call the property getter and return the value
> > > > > Object value = readMethod.invoke(bean, new Object[0])

templates: cant access request in included files???

2002-11-14 Thread Drew Zimber


hey all,

im trying to get a template implementation going and none of the my
 tags can find the form in one of the templated files:


...




...



what is the deal with that!!!




--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




RE: help needed with DynaActionForm

2002-11-14 Thread Drew Zimber


I hear you, I had the same problem with time constraints.  We ended up going
for traditional forms to save time/hassle.

dz

-Original Message-
From: Andy Kriger [mailto:akriger@;greaterthanone.com]
Sent: Thursday, November 14, 2002 11:44 AM
To: Struts Users Mailing List
Subject: RE: help needed with DynaActionForm


If only there were time on my current project to explore this and get it
done right by extending the existing Struts architecture. For the while I'll
have to go back to Strings and convert them to objects in the Action.

-Original Message-
From: Drew Zimber [mailto:drew.zimber@;shaws.com]
Sent: Thursday, November 14, 2002 11:36
To: 'Struts Users Mailing List'
Subject: RE: help needed with DynaActionForm



interesting idea, but i dont think beanUtils is driving the whole dynaforms
thing.  I think its just a big HashMap they stick stuff into (for the
moment).  The big problem is that DynaForms requires you to specify the
initial values in the  as that "initial" value.  So, with
complex value objects and Collections, its not smart enough (yet) to
instantiate even an empty object.  It only knows how to create Wrapper
classes with values in them.

That's why i started toying with the direct DynaActionForm.set() in the
action class.  As far as i explored, that was the only way to get around
this.  And if you are using the XML validation in conjuction, it gets even
messier my friend.


dz


-Original Message-
From: Andy Kriger [mailto:akriger@;greaterthanone.com]
Sent: Thursday, November 14, 2002 11:19 AM
To: Struts Users Mailing List
Subject: RE: help needed with DynaActionForm


I'm speaking at the edge of understanding here, but...

If BeanUtils is underlying this whole thing, then you should be able to
create the user-objects instead of defaulting them to null (using the
JavaBean no-arg ctor). And following on that you could use the property
referencing struture used by the rest of Struts (e.g. object.field or
object[0].object.field) to handle the validation.

At first at least, one could implement this by handling user-objects but
requiring that the last value in the property referencing be a primitive or
Strings (for validation and returning objects to the form). Then I guess it
could be expanded to user-objects using a Validatable interface (similar to
the Comparable interface used by Arrays.sort).

-----Original Message-
From: Drew Zimber [mailto:drew.zimber@;shaws.com]
Sent: Thursday, November 14, 2002 11:00
To: 'Andy Kriger'; 'Struts Users Mailing List'
Subject: RE: help needed with DynaActionForm



"...I'm guessing it wouldn't be that hard to extend the form to handle any
old
Object, maybe someone more in the know with the src can comment on this?"

actually, i found some documentation about this on the web.  You can
subclass DynaActionForm  and add your own attributes, but it sort of defeats
the purpose of having a DynaForm.  You'll sort of have a "half and half"
form and im not sure how i feel about that.

for the DynaForms, you can put ANY object into the form, because it stores
all objects in a HashMap.  However, when you get to validation and returning
objects to the form on submit, it gets messy.  The DynaForms still need some
time to mature...

dz



-Original Message-
From: Andy Kriger [mailto:akriger@;greaterthanone.com]
Sent: Thursday, November 14, 2002 10:45 AM
To: Struts Users Mailing List; [EMAIL PROTECTED]
Subject: RE: help needed with DynaActionForm


Currently the first action in my webapp is an ForwardAction that takes you
to the JSP. So, if I understand you right, I could make this work by
replacing that with an Initalization action that creates the objects for use
in the form. I'll try that and report back.

I'm guessing it wouldn't be that hard to extend the form to handle any old
Object, maybe someone more in the know with the src can comment on this?

thx
andy

-Original Message-
From: Drew Zimber [mailto:drew.zimber@;shaws.com]
Sent: Thursday, November 14, 2002 10:35
To: 'Struts Users Mailing List'
Subject: RE: help needed with DynaActionForm



from:
http://jakarta.apache.org/struts/userGuide/building_controller.html#dyna_act
ion_form_classes

"The list of types supported by DynaActionForm beans includes:

java.lang.BigDecimal
java.lang.BigInteger
boolean and java.lang.Boolean
byte and java.lang.Byte
char and java.lang.Character
java.lang.Class
double and java.lang.Double
float and java.lang.Float
int and java.lang.Integer
long and java.lang.Long
short and java.lang.Short
java.lang.String
java.sql.Date
java.sql.Time
java.sql.Timestamp "


now, with that being said.  I have used my own classes in the DynaForms, but
they wil lbe initialized to null UNLESS you do the following:

1) in the Action class, cast the form to a DynaActionForm
2) do an explicit myForm.set("myProperty", new my

RE: help needed with DynaActionForm

2002-11-14 Thread Drew Zimber

interesting idea, but i dont think beanUtils is driving the whole dynaforms
thing.  I think its just a big HashMap they stick stuff into (for the
moment).  The big problem is that DynaForms requires you to specify the
initial values in the  as that "initial" value.  So, with
complex value objects and Collections, its not smart enough (yet) to
instantiate even an empty object.  It only knows how to create Wrapper
classes with values in them.

That's why i started toying with the direct DynaActionForm.set() in the
action class.  As far as i explored, that was the only way to get around
this.  And if you are using the XML validation in conjuction, it gets even
messier my friend.


dz


-Original Message-
From: Andy Kriger [mailto:akriger@;greaterthanone.com]
Sent: Thursday, November 14, 2002 11:19 AM
To: Struts Users Mailing List
Subject: RE: help needed with DynaActionForm


I'm speaking at the edge of understanding here, but...

If BeanUtils is underlying this whole thing, then you should be able to
create the user-objects instead of defaulting them to null (using the
JavaBean no-arg ctor). And following on that you could use the property
referencing struture used by the rest of Struts (e.g. object.field or
object[0].object.field) to handle the validation.

At first at least, one could implement this by handling user-objects but
requiring that the last value in the property referencing be a primitive or
Strings (for validation and returning objects to the form). Then I guess it
could be expanded to user-objects using a Validatable interface (similar to
the Comparable interface used by Arrays.sort).

-Original Message-----
From: Drew Zimber [mailto:drew.zimber@;shaws.com]
Sent: Thursday, November 14, 2002 11:00
To: 'Andy Kriger'; 'Struts Users Mailing List'
Subject: RE: help needed with DynaActionForm



"...I'm guessing it wouldn't be that hard to extend the form to handle any
old
Object, maybe someone more in the know with the src can comment on this?"

actually, i found some documentation about this on the web.  You can
subclass DynaActionForm  and add your own attributes, but it sort of defeats
the purpose of having a DynaForm.  You'll sort of have a "half and half"
form and im not sure how i feel about that.

for the DynaForms, you can put ANY object into the form, because it stores
all objects in a HashMap.  However, when you get to validation and returning
objects to the form on submit, it gets messy.  The DynaForms still need some
time to mature...

dz



-Original Message-
From: Andy Kriger [mailto:akriger@;greaterthanone.com]
Sent: Thursday, November 14, 2002 10:45 AM
To: Struts Users Mailing List; [EMAIL PROTECTED]
Subject: RE: help needed with DynaActionForm


Currently the first action in my webapp is an ForwardAction that takes you
to the JSP. So, if I understand you right, I could make this work by
replacing that with an Initalization action that creates the objects for use
in the form. I'll try that and report back.

I'm guessing it wouldn't be that hard to extend the form to handle any old
Object, maybe someone more in the know with the src can comment on this?

thx
andy

-Original Message-
From: Drew Zimber [mailto:drew.zimber@;shaws.com]
Sent: Thursday, November 14, 2002 10:35
To: 'Struts Users Mailing List'
Subject: RE: help needed with DynaActionForm



from:
http://jakarta.apache.org/struts/userGuide/building_controller.html#dyna_act
ion_form_classes

"The list of types supported by DynaActionForm beans includes:

java.lang.BigDecimal
java.lang.BigInteger
boolean and java.lang.Boolean
byte and java.lang.Byte
char and java.lang.Character
java.lang.Class
double and java.lang.Double
float and java.lang.Float
int and java.lang.Integer
long and java.lang.Long
short and java.lang.Short
java.lang.String
java.sql.Date
java.sql.Time
java.sql.Timestamp "


now, with that being said.  I have used my own classes in the DynaForms, but
they wil lbe initialized to null UNLESS you do the following:

1) in the Action class, cast the form to a DynaActionForm
2) do an explicit myForm.set("myProperty", new myObject()) type call

all in all, i did alot of research on dynaforms and they are pretty useful,
but in my opinion they arent versatile enough yet for complex
applications/valdation...In the end we choose to retain mostly traditional
forms.

drew


-Original Message-
From: Andy Kriger [mailto:akriger@;greaterthanone.com]
Sent: Thursday, November 14, 2002 10:25 AM
To: Struts Users Mailing List
Subject: help needed with DynaActionForm


I am trying to set properties of an object using DynaActionForm.

In my struts-config.xml I have in the 


In my JSP I try


The CreditCard class has a no-arg ctor and get/set methods for all of its
fields.

When I load the JSP I get an error
Null property value for 'creditCard'

I'm guessing that Dyna

RE: help needed with DynaActionForm

2002-11-14 Thread Drew Zimber

"...I'm guessing it wouldn't be that hard to extend the form to handle any
old
Object, maybe someone more in the know with the src can comment on this?"

actually, i found some documentation about this on the web.  You can
subclass DynaActionForm  and add your own attributes, but it sort of defeats
the purpose of having a DynaForm.  You'll sort of have a "half and half"
form and im not sure how i feel about that.

for the DynaForms, you can put ANY object into the form, because it stores
all objects in a HashMap.  However, when you get to validation and returning
objects to the form on submit, it gets messy.  The DynaForms still need some
time to mature...

dz



-Original Message-
From: Andy Kriger [mailto:akriger@;greaterthanone.com]
Sent: Thursday, November 14, 2002 10:45 AM
To: Struts Users Mailing List; [EMAIL PROTECTED]
Subject: RE: help needed with DynaActionForm


Currently the first action in my webapp is an ForwardAction that takes you
to the JSP. So, if I understand you right, I could make this work by
replacing that with an Initalization action that creates the objects for use
in the form. I'll try that and report back.

I'm guessing it wouldn't be that hard to extend the form to handle any old
Object, maybe someone more in the know with the src can comment on this?

thx
andy

-Original Message-
From: Drew Zimber [mailto:drew.zimber@;shaws.com]
Sent: Thursday, November 14, 2002 10:35
To: 'Struts Users Mailing List'
Subject: RE: help needed with DynaActionForm



from:
http://jakarta.apache.org/struts/userGuide/building_controller.html#dyna_act
ion_form_classes

"The list of types supported by DynaActionForm beans includes:

java.lang.BigDecimal
java.lang.BigInteger
boolean and java.lang.Boolean
byte and java.lang.Byte
char and java.lang.Character
java.lang.Class
double and java.lang.Double
float and java.lang.Float
int and java.lang.Integer
long and java.lang.Long
short and java.lang.Short
java.lang.String
java.sql.Date
java.sql.Time
java.sql.Timestamp "


now, with that being said.  I have used my own classes in the DynaForms, but
they wil lbe initialized to null UNLESS you do the following:

1) in the Action class, cast the form to a DynaActionForm
2) do an explicit myForm.set("myProperty", new myObject()) type call

all in all, i did alot of research on dynaforms and they are pretty useful,
but in my opinion they arent versatile enough yet for complex
applications/valdation...In the end we choose to retain mostly traditional
forms.

drew


-Original Message-
From: Andy Kriger [mailto:akriger@;greaterthanone.com]
Sent: Thursday, November 14, 2002 10:25 AM
To: Struts Users Mailing List
Subject: help needed with DynaActionForm


I am trying to set properties of an object using DynaActionForm.

In my struts-config.xml I have in the 


In my JSP I try


The CreditCard class has a no-arg ctor and get/set methods for all of its
fields.

When I load the JSP I get an error
Null property value for 'creditCard'

I'm guessing that DynaActionForm is not initializing the CreditCard object,
but I don't know why (I thought that was the point of DynaActionForm - to be
able to use any object and initialize it from the form automatically).

Can anyone who has done this successfully point me in the right direction?

thx
andy



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


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



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




RE: help needed with DynaActionForm

2002-11-14 Thread Drew Zimber

from:
http://jakarta.apache.org/struts/userGuide/building_controller.html#dyna_act
ion_form_classes

"The list of types supported by DynaActionForm beans includes:

java.lang.BigDecimal
java.lang.BigInteger
boolean and java.lang.Boolean
byte and java.lang.Byte
char and java.lang.Character
java.lang.Class
double and java.lang.Double
float and java.lang.Float
int and java.lang.Integer
long and java.lang.Long
short and java.lang.Short
java.lang.String
java.sql.Date
java.sql.Time
java.sql.Timestamp "


now, with that being said.  I have used my own classes in the DynaForms, but
they wil lbe initialized to null UNLESS you do the following:

1) in the Action class, cast the form to a DynaActionForm
2) do an explicit myForm.set("myProperty", new myObject()) type call

all in all, i did alot of research on dynaforms and they are pretty useful,
but in my opinion they arent versatile enough yet for complex
applications/valdation...In the end we choose to retain mostly traditional
forms.

drew


-Original Message-
From: Andy Kriger [mailto:akriger@;greaterthanone.com]
Sent: Thursday, November 14, 2002 10:25 AM
To: Struts Users Mailing List
Subject: help needed with DynaActionForm


I am trying to set properties of an object using DynaActionForm.

In my struts-config.xml I have in the 


In my JSP I try


The CreditCard class has a no-arg ctor and get/set methods for all of its
fields.

When I load the JSP I get an error
Null property value for 'creditCard'

I'm guessing that DynaActionForm is not initializing the CreditCard object,
but I don't know why (I thought that was the point of DynaActionForm - to be
able to use any object and initialize it from the form automatically).

Can anyone who has done this successfully point me in the right direction?

thx
andy



--
To unsubscribe, e-mail:

For additional commands, e-mail:



--
To unsubscribe, e-mail:   
For additional commands, e-mail: 




Help: validation and dyna beans, data disappears

2002-11-13 Thread Drew Zimber

All,

Hello.  Im currently working on a small application where I am researching
the use of the DynaBeans and XML Validation functionality within struts 1.1.
Both technologies are quite impressive and I have them working well with one
caveat;  allow me to explain via senario:


Right now, my test dyna form contains a few collections of static data (for
combo boxes) and a few fields.  One of the fields is set up for the
"required" and "integer" validations.

Everything appears to be configured properly and it on error it works as it
should, except for the fact that the form resets to the default values and
hence, the static data disappears.

Yes, I am aware that Collections are techinically not supported by dyna
beans.  Alternatively, I was putting the Collections directly into the
request as well, and logically they also disappear.


So:  I guess what im looking for advice/suggestions/takes on this delimna
before I revert back to traditional forms.  Thank you for your time!!!


Regards,
Drew Zimber


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