design pattern question - deriving form beans from model object?

2003-03-31 Thread Donald Ball
Hi guys. I've got a struts application design question for the group. I've got a webapp which guides the user through creating a large model object. The process takes several pages - each page has its own form bean which is used to update the model object (which has no real notion that it's in

question regarding DynaActionForm.reset()

2003-03-31 Thread Donald Ball
The API for ActionForm.reset() says it will, Reset all bean properties to their default state. This method is called before the properties are repopulated by the controller servlet. Why then does the default reset() method for DynaActionForm do nothing? DynaActionForm knows about its own

Re: question regarding DynaActionForm.reset()

2003-03-31 Thread Donald Ball
Craig R. McClanahan wrote: The API for ActionForm.reset() says it will, Reset all bean properties to their default state. This method is called before the properties are repopulated by the controller servlet. Why then does the default reset() method for DynaActionForm do nothing? DynaActionForm

Re: question regarding DynaActionForm.reset()

2003-03-31 Thread Donald Ball
Moore, Scott R. wrote: 1) Does this mean that the following statement in Chuck Cavanaugh's Programming Jakarta Struts (O'Reilly) is wrong?: Unlike with the ActionForm Class, where the default behavior for reset() does nothing, the reset() method in the DynaActionForm class resets all the

Re: question regarding DynaActionForm.reset()

2003-03-31 Thread Donald Ball
Wendy Smoak wrote: Donald wrote: why do you call reset() before manipulating the bean anyway? isn't it better to explicitly keep the old values around before setting any new ones based on the incoming request? Without reset, you'd never be able to 'un-check' an HTML checkbox. Sure you would -

Re: question regarding DynaActionForm.reset()

2003-03-31 Thread Donald Ball
Chen, Gin wrote: HTML does not submit a null for an unchecked checkbox. So if you have foo=bar you would have nothign if foo was not checked. If you try it with a GET HTML form you'll see that behavior. you're so right, mea culpa. i can't believe i misremembered about that inanity. i'll crawl

how to strutsly send the user back to the last URL

2003-03-27 Thread Donald Ball
hi guys, got a very simple question. i've got a SaveAction which can be invoked via the url /Save.do from basically anywhere in my struts app. naturally, its mapping configuration is quite terse: action path=/Save type=mypackage.SaveAction/ works fine, but here's the issue - at the end of the

problem with the struts-html-el taglib

2003-03-13 Thread Donald Ball
I'm using the struts-html-el taglib with struts-1.1rc1 and just converted one of my jsp pages from html to html-el. Unfortunately, I get an NPE: java.lang.NullPointerException at java.util.Hashtable.get(Hashtable.java:329) at

Re: content management ideas?

2002-09-13 Thread Donald Ball
On 9/12/2002 at 2:08 PM Bryan Field-Elliot wrote: I was wondering how people handle frequent content updates with Struts/JSP? At my company, I'm building a site for which much of the static content (including things like the CSS stylesheet) will probably undergo frequent revision. I'd like to

Re: Redirecting to a relative URL from root

2002-09-12 Thread Donald Ball
On 9/12/2002 at 11:01 AM Michael Lee wrote: by default the '/' root is from your webapp, as it should be. All URLs should be from '/' that are going to the same webapp. If your going to another webapp just do an http:// (Is this last sentence right?) Don't use ../.. whatever you do! (not

Re: Redirecting to a relative URL from root

2002-09-12 Thread Donald Ball
On 9/12/2002 at 12:08 PM Michael Lee wrote: Cool! Did not know that! I take it when you say that solution doesn't work you just mean the one scentence.. I meant the suggested solution, namely that you use absolute URLs in your struts-config.xml file when redirecting a user to another webapp on

Re: Struts 1.1 Final release

2002-09-11 Thread Donald Ball
On 9/11/2002 at 10:06 AM Michael Lee wrote: Be nice There are no ship dates for jakarta stuff. It is released when it meets a certain level of quality/features. You can help it meet the ship date! It's open source! It might have been more helpful to point the user towards the real release

RE: Additional logic:iterate helper tags wanted

2002-09-11 Thread Donald Ball
On 9/6/2002 at 4:46 PM Martin Cooper wrote: If you're using a JSP 1.2 container (e.g. Tomcat 4.x, Resin 2.x), you can do this (and many other cool things) using the JSTL c:forEach tag: c:forEach items=items var=item varStatus=status c:out value=${item}/ c:if test=${!status.last}

RE: Additional logic:iterate helper tags wanted

2002-09-11 Thread Donald Ball
On 9/11/2002 at 9:17 AM Craig R. McClanahan wrote: At the high level: The JSTL tags are nice. The JSTL expression language (now adopted by JSP 2.0) is powerful enough to completely eliminate the need for scriptlets and runtime expressions in JSP pages. JSP 2.0 page compilers will also let you

Re: Dynamic number of form fields

2002-09-11 Thread Donald Ball
On 9/11/2002 at 11:00 AM David Graham wrote: I want to have a form with a variable number of input boxes. For example, a simple edit person form that has a first name and last name input box for each person in your db. So the first set would be named firstName_12 lastName_12, the second set

Re: Dynamic number of form fields

2002-09-11 Thread Donald Ball
On 9/11/2002 at 1:02 PM David Graham wrote: Brilliant! Thanks so much for your help! That's a lot more elegant than what I had been doing, although it does create interesting dilemmas with javascript. Hopefully that patch will make it into the docs soon. Glad you found the docs useful. Out

Re: [LEGAL] RE: sites powered by struts

2002-09-11 Thread Donald Ball
On 9/11/2002 at 1:37 PM David Graham wrote: Oops, I stand corrected. I read the archive and apparently you do. I don't see this as a reason not to use struts though. It's not like people actually read those legal pages :-) Not true. If you use struts on your web site or application, you

Re: Dynamic number of form fields

2002-09-11 Thread Donald Ball
On 9/11/2002 at 2:53 PM David Graham wrote: I'm having some trouble getting this to work. I get the error message javax.servlet.jsp.JspException: No getter method for property categoryName(2) of bean org.apache.struts.taglib.html.BEAN I have a HashMap in my form called categoryNames and a

RE: Dynamic number of form fields

2002-09-11 Thread Donald Ball
On 9/11/2002 at 3:56 PM Hemanth Setty wrote: Correct me if I wrong, I think in the bean it should be: void setCategoryName(Map categoryName) and Map getCategoryName() -hemanth I'm reasonably certain that you're wrong. The map-backed ActionForm parsing code doesn't actually presume that there's

RE: Additional logic:iterate helper tags wanted

2002-09-11 Thread Donald Ball
On 9/11/2002 at 10:14 AM [EMAIL PROTECTED] wrote: Wow, good rhubarb here hiding under a misleading subject title ;-). rhubarb? do you mean rhetoric? :) To me, the big strength of the XSLT approach would be the ability to transform the model into a variety of views (not just one html view). I

Re: Additional logic:iterate helper tags wanted

2002-09-11 Thread Donald Ball
On 9/11/2002 at 2:02 PM Michael Lee wrote: Basically how we got the data dictated the view. I've found XSLT to be 'wordy'. I think its just as easy to write another damned JSP and parse the Java Objects up there as it is to create another XSL page and use the same JSP. I consider views to be

Re: Dynamic number of form fields

2002-09-11 Thread Donald Ball
On 9/11/2002 at 3:59 PM David Graham wrote: Javascript doesn't like it when you use things like [ or ( in the name of a form field. There are several ways of coding the js and one of them accepts those characters (I think). So, you can still use javascript to validate it but you might have

Re: Dynamic number of form fields

2002-09-11 Thread Donald Ball
On 9/11/2002 at 3:20 PM John Averty wrote: Duuh! Sorry about that. I'd like to bring it one step further: I'd like to be able to set the corresponding field type. Would the following work? % for (int i=0; i10; i++) { String name = value(foo- + i + ); String type = type(foo- + i + );

how to return errors from Model component

2002-09-06 Thread Donald Ball
Hey guys, I have an MVC-type question. My View captures data from the user and sends it to the Controller, which validates and massages it and uses it to configure the Model and tell the Model to do something. Based on the something, the Controller sends another View to the client. So far so

Re: Struts - vs XSLT (ASP.NET v. Struts)

2002-09-06 Thread Donald Ball
On 9/4/2002 at 9:47 PM Ted Husted wrote: As alluded, the stxx extension does a nice job of this by integrating with Struts. Though, I'd say the idea of a completely seperate servlet (a la Velocity) sounds cleaner. Why do you think this to be the case? If you do think that xml/xslt is the

RE: Struts - vs XSLT (ASP.NET v. Struts)

2002-09-06 Thread Donald Ball
If that's the perceived complaint, wouldn't it be better to connect the model data to the view using a sax pipeline rather than passing around a dom or dom-like object, or even worse, a String? And the sax 'pipeline' (I assume you mean an InputStream?) is connected towhat? If your

Re: Dynamic name to the text fields

2002-08-30 Thread Donald Ball
On 8/30/2002 at 7:28 PM Anoop wrote: Hi All, I am a newbie to struts and taglibs, was trying to display text fields dynamically using html:iterator. Below is the scenario I was trying out. You may be in luck, I've been recently trying to learn how to do something similar myself. snip/

dynamic forms and map-backed ActionForm beans

2002-08-29 Thread Donald Ball
Hi guys. I'm back to playing with the map-backed ActionForm beans again. I've got a dynamically created HTML form that I'm trying to make play nicely with a map-backed ActionForm. The ActionForm uses get/setProperty as described by Ted Husted and works nicely. The problem I'm having is accessing

RE: Nested tags performance

2002-08-28 Thread Donald Ball
On 8/28/2002 at 1:58 PM Lister, Tom (ANTS) wrote: I have got a page working with nested tags and the functionality is brilliant for master/detail pages However the performance is abysmal, to the point where we mayhave to abandon it completely. The problem appears to be during the page

Re: 1.1-b2 html:javascript validator question

2002-08-27 Thread Donald Ball
On 8/26/2002 at 5:47 PM Richards, Devin N (Devin) wrote: When I navigate to /app2.do I end up with a bunch of JavaScript code dumped out on the page. When I look at the JSP source code when the form works the html:javascript is replaced by: snip/ It does not start with the normal SCRIPT tag

RE: Re: trouble with DynaValidatorForm

2002-08-27 Thread Donald Ball
On 8/27/2002 at 12:54 PM Hardee, Tony wrote: Can you elaborate on what was invalid. I'm going through a similar iteration now. Sure. My validator.xml didn't have the proper root element since I was going from Chuck's chapter and not from the dtd itself. I had formset as my root element instead

Fwd: RE: Re: trouble with DynaValidatorForm

2002-08-27 Thread Donald Ball
jakarta.apache.org doesn't like my mail sometimes... :( retrying... On 8/27/2002 at 12:54 PM Donald Ball [EMAIL PROTECTED] wrote: From: Donald Ball [EMAIL PROTECTED] To: [EMAIL PROTECTED] Date: Tue, 27 Aug 2002 10:33:35 -0400 Subject: RE: Re: trouble with DynaValidatorForm On 8/27/2002

struts-1.1b2 hangs occasionally

2002-08-27 Thread Donald Ball
I know, this is every developer's favorite class of error... but I'm afraid it's really happening. Our struts webapp is hanging from time to time. It seems to hang on one URL, while the rest of the webapp functions normally. Based on the logging output, it seems to happen somewhere between

mysterious log4j problem

2002-08-27 Thread Donald Ball
Did something change between 1.1b1 and 1.1b2 regarding log4j behavior in struts? It's a long shot, but it's worth asking. Our log4j debug statements are disappearing now and the only relevant change we made was to upgrade from 1.1b1 to 1.1b2. I grepped through the struts source and wasn't able to

Re: mysterious log4j problem

2002-08-27 Thread Donald Ball
On 8/27/2002 at 3:16 PM Donald Ball wrote: Did something change between 1.1b1 and 1.1b2 regarding log4j behavior in struts? It's a long shot, but it's worth asking. Our log4j debug statements are disappearing now and the only relevant change we made was to upgrade from 1.1b1 to 1.1b2. I grepped

Re: mysterious log4j problem

2002-08-27 Thread Donald Ball
On 8/27/2002 at 12:48 PM Craig R. McClanahan wrote: Have you heeded the comment at the bottom of the 1.1-b2 download page about picking up the latest commons-logging.jar? It's in the paragraph that starts with bold text Log4J Users Please Note :-). Nope, i was needlessly heedless. :) Thanks

trouble with DynaValidatorForm

2002-08-26 Thread Donald Ball
Hey guys, I'm still experimenting with the Dyna stuff. I'm trying out the DynaValidatorForm, following the recipe in chapter 11 of Chuck's (?) book from theserverside. The form bean is capturing my data, hooray, but it does not appear to be validating it. Conf snipppets: struts-config.xml:

Fwd: Re: trouble with DynaValidatorForm

2002-08-26 Thread Donald Ball
Never mind, I found the problem - invalid validator.xml. Pretty good stuff going on now, thanks to the struts team. btw, never got an answer to my second original question - is anyone writing the jakarta docs for the Dyna and Validator stuff? If not, I could try to take a stab at it. - donald