bryan nelson

Ranch Hand
+ Follow
since Jun 16, 2003
Merit badge: grant badges
For More
Cows and Likes
Total received
In last 30 days
Total given
Total received
Received in last 30 days
Total given
Given in last 30 days
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by bryan nelson

Hello there,

If I use this code I can access the overall ActionErrors object in my jsp using EL:

The output looks like this:


However, how can I access a specific key or value of one of the ActionError objects within this ActionErrors object using EL?

Many thanks!

p.s. I am restricted to using Struts 1.1, hence the ActionError and not ActionMessage question.
13 years ago
Can anyone provide some insight into the original question here without using a third party solution (such as open symphony that is referenced here)?

13 years ago
Yeah, that limits the robustness a bit.

As a solution I simply created a String[] inside one of my beans which was a field in the form. Although it added a layer of complexity when linking the specific checkbox with the specific String[] in each bean, it works well.

Crisis averted.
13 years ago
Apparently DispatchAction and the validate() method don't always play nicely together. You can do a search to find out the details of why this is...but here is a solution:

If you place the following check in your validate method you will be able to safely skip the first call to validate (on the initial form load) while still hitting the second call on form submission as intended.

Basically you're just checking to see whether or not your DispatchAction parameter has a value set to it yet. If it doesn't, it's the initial load. If it does, then it is actually the form submission.

Hope this helps someone!
13 years ago
Perhaps I should clarify that I am using DispatchAction.
13 years ago
Hello there,

My validate method seems to be being called before the page ever loads...meaning before the form is ever populated. I only need it to be called after the form is submitted. I believe there is some way to fix this but I have searched and cannot find it.

Any ideas?

Thank you!
13 years ago

I'm trying find a way to have a more robust mapping of multibox data from a jsp page to a struts form. My question is, is the multibox tag bound specifically to a String Array in the struts form? Or could I use something like a map, or list, etc...something that is a bit more dynamic?

For example...if my multibox is bound to a property in my form called "selectedThings," does "selectedThings" have to be a String[]?

13 years ago

I'm working with a Struts 1.1 app...but it may be upgraded to 1.3 in the near future. In this case would it be wise to just use the ActionMessages all the time for future compatibility?

13 years ago
First, let me apologize for posing a rather vague question. I was in a hurry and did not take the time to properly compose it. Let me try to explain in a bit more detail.

Let's say I have a Snake Factory...which (not surprisingly) creates Snakes. I want to create RattleSnakes, GarterSnakes, and CornSnakes. And I also want to create them specific to a continent. So all three snakes will be in the Americas, Australia, etc. This would look something like...having a concrete AmericanRattleSnake, AustralianRattleSnake (yes, I am aware there are no rattlesnakes in Australia), etc. class(es).

Using this idea, which is a standard implementation of the Factory Pattern (correct me if I'm wrong), how does the Core J2EE Patterns - Data Access Object article relate using DAOs? Specifically, relating to Figure 9.3 and the related text?

Are RdbDAO1 and RdbDAO2 synonymous with a RattleSnake and GarterSnake? And if so, where does the country level play in to Sun's example? I'm failing to find a correspondence in Sun's implementation of the Factory Pattern described in Gof and HFDP with the "contintent" level of abstraction.

Second, I am definitely not asking anyone to read two books and an article to answer my question. My assumption (founded by reading other threads in this forum) is that there are numerous people in this forum who are well versed in both Factory Pattern and Abstract Factory Pattern described in these two books and could easily answer a question about them applied to something else. I do apologize, however, for not specifying that "something else" very well!

Thank you each for your time!

I have been trying to wrap my head around the differences between Abstract Factory and Factory Pattern over the last week. I obtained a copy of Head First Design Patterns which has helped a great deal. However, just whenever I thought I was understanding some things I came across Sun's writeup on DAO design:

Core J2EE Patterns - Data Access Object

They give examples here of how to apply the Abstract Factory and Factory Patterns to DAOs and datasources. Could someone explain a bit more how this example relates to the standard definitions of these two Patterns described in HFDP and by the GoF? Are the databases in this example being used as the "object" that we want to create?

Thank you very much for your time.
Interesting question...even though the thread is a bit old.

Actually I've been doing some research into the best way to organize packages lately and have found this discussion on packaging to be extremely helpful; the other discusses packaging by feature vs layer. I think that on the surface packaging by layer (your horizontal slice above) looks more attractive...but it also takes less thought. However, packaging by feature (your vertical slice above) seems to have more expandability.

Does anyone else have anything to add to this discussion?
Thanks Mohamed (& Bert),

It's interesting that you bring those two books up. So far I've found that almost everyone recommends one of those. I know that Design Patterns by the "Gang of Four" is considered to be one of the classics. But I also know that many people, like yourself, recommend starting with Head First Design Patterns.

I've also heard this one mentioned: Patterns of Enterprise Application Architecture. Is anyone familiar with it?

Thanks for the discussion.

I'm hoping to advance my understanding of some time-tested Java design patterns and am looking for the best resource to do so.

So here's the question:

If you were trapped on a desert island with Wi-fi access, a laptop, and one Design Patterns book...what would that one book be?

Thanks for everyone's advice!
Oh man. Do I have egg on my face.

Thanks so much for clearing up the URI reference. This is extremely helpful and good for our current purposes. Basically we'll be able to use JSTL 1.1 and EL even if I can't convince anyone to alter the web.xml. I tried using the

page directive with the current 2.3 DTD and it works great. So we can at least go that route if nothing else.

Thank you each for your time in this thread...and hopefully it will help out others as well.

13 years ago