RE: version 1.2

2004-03-20 Thread Ted Husted
As Joe mentioned, we no longer use the "beta-beta-beta-final" versioning scheme.

We now use an "immutable" versioning scheme, like that used by the Apache HTTPD 
project, Jakata Tomcat, and many others.

Each release is a "point" release, meaning it's a three part number: 
major-minor-point. The most recent Struts point release is 1.2.0. The next will be 
1.2.1. Each number is an integer, so there can be any number of point releases.

Each point release is created exactly once. After the release is created, we vote as 
to whether to change its status from "alpha" to "beta" and/or "general availability".

We may also vote to demote a release, if we discover problems later.

At this time, Struts 1.1 is the best available release. Struts 1.2.0 is also 
available, but still considered "alpha" quality.

** We encourage everyone to try running your applications against 1.2.0 and report any 
problems.  **

Right now, there are a handful of problem tickets against 1.2.0. As soon as those are 
resolved, we will issue 1.2.1. Hopefully, that release will make "GA" status. Either 
way, the next 1.2.x release after 1.2.1 will be 1.2.2.

-Ted.

On Sat, 20 Mar 2004 23:20:39 +0200, Erez Efrati wrote:
> Yes, I here so much of this version so I wondered if it was
> released or the CVS head version is stable enough for production.
>
> Erez
>
>
> -Original Message-
> From: Zsolt Koppany [mailto:[EMAIL PROTECTED] Sent:
> Saturday, March 20, 2004 10:58 PM To: Struts Users Mailing List
> Subject: RE: version 1.2
>
> Hi,
>
>
> do you mean struts-1.2 final? I cannot find that at:
> http://jakarta.apache.org/site/binindex.cgi
>
> Zsolt
>
>
>> -Original Message-
>> From: Joe Germuska [mailto:[EMAIL PROTECTED]
>> Sent: Saturday, March 20, 2004 3:20 PM
>> To: Struts Users Mailing List
>> Subject: Re: version 1.2
>>
>>
>> At 1:14 PM +0200 3/20/04, Erez Efrati wrote:
>>> Hi, I am currently working with the 1.1, is there a good reason
>>> to
>>>
> move
>>> to 1.2? Is it going to be released sometime soon?
>>>
>>
>> Struts 1.2.0 was released a few weeks ago using the new Tomcat-
>> style version numbering.  That means that a numbered release may
>> or may not be considered a production quality release.  There has
>> not been a formal vote on the status of 1.2.0, but I think we'd
>> cut another release rather than vote 1.2.0 as production-quality.
>>
>> If you're satisfied with Struts 1.1, you may as well stick with
>> it. If you like to keep up with Struts while its evolving, you
>> might be just as well off building from CVS Head as using Struts
>> 1.2.0.  That way you'd roll in recent bug fixes and be in a
>> position to fix other bugs yourself if you find them (or just
>> update from CVS and apply fixes and changes as they come in.)
>>
>> There aren't anywhere near the number of structural changes
>> between 1.1 and 1.2 that there were between 1.0 and 1.1.  Many
>> deprecated members from 1.1 have been removed, so if you were
>> ignoring the deprecation warnings all this time, you'll finally
>> have to catch up. Also, if I recall correctly, there are some
>> changes in the JSP tag libraries that may be hard to find until
>> you compile the JSPs.
>>
>> Hope that helps,
>> Joe
>>
>>
>> --
>> Joe Germuska
>> [EMAIL PROTECTED]
>> http://blog.germuska.com
>> "Imagine if every Thursday your shoes exploded if you tied them
>> the usual way.  This happens to us all the time with computers,
>> and nobody thinks of complaining." -- Jef Raskin
>>
>> --
>> --- To unsubscribe, e-mail: struts-user-
>> [EMAIL PROTECTED] For additional commands, e-mail:
>> [EMAIL PROTECTED]
>
>
> 
> - To unsubscribe, e-mail: struts-user-
> [EMAIL PROTECTED] For additional commands, e-mail:
> [EMAIL PROTECTED]
>
>
> 
> - To unsubscribe, e-mail: struts-user-
> [EMAIL PROTECTED] For additional commands, e-mail:
> [EMAIL PROTECTED]




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



Re: Again Action Chaining

2004-03-18 Thread Ted Husted
On Thu, 18 Mar 2004 15:24:25 +0300, AKostylev wrote:
> How can I avoid action chaining in such situation... In my
> application user can set "resolution" on some "demand". For
> example, there two types of resolutions: "bug" and "not a bug". If
> user selects "not a bug" option on form, then nothing happens...
> But if user selects "bug" option, then he must create object "bug".
> But also user can create object "bug" from another place of
> application. So I get two actions: ResolutionSelectAction and
> BugCreateAction, how can avoid action chaining between them and
> move this dependence to business logic?

The Actions should not be implementing the business logic. The business logic should 
be behind a facade where any Action can call it. In this way, if multiple Actions need 
to call an operation, like "createBug", they can. The facade can simply be a JavaBean 
placed in application scope by a Plug-In, as is done with the Struts MailReader 
example. If the facade is based on an interface, as is done with MailReader, you can 
change the implementation of the facade whenever you like.

The Action's job is not to create business objects, but to *decide* whether an object 
needs to be created. When any Action anywhere needs to create a business object, they 
should be able to call a method on the facade. Actions should represent the workflows 
or "scripts" (to  use Fowler's term) within an application, not the underlying 
business operations. The idea is that the user makes a request, and the Action 
fulfills that request, calling whatever business operations it may need along the way.

Another responsibility of the Action is to select the resource that will complete the 
response, usually by rendering a page. Sometimes this resource may be behind another 
Action. But this is not an instance of Action Chaining, since a "resource" Action (or 
PageLoader) seeks to complete the response, rather than fulfill the request.

Another way to think of the facade is as a set of services, like Web Services. Any 
time anyone needs to work with a business object, they should be able to call a 
service to handle the implementations details. All the Actions see are signatures.

-Ted.


Developing Web Applications Using Open Source Tools
Saturday, 3 Apr 2004, New York City
http://basebeans.com/do/website



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



RE: using Two struts-config

2004-03-16 Thread Ted Husted
On Tue, 16 Mar 2004 08:03:10 -0500, [EMAIL PROTECTED] wrote:
> Frank is correct; we're doing it the same way, with nearly 20
> struts config files (and tiles def files) to help organize things.
>
> Try it without the space between the comma and the next entry, e.g.:
>
> /WEB-INF/struts-config.xml,/WEB-INF/struts-
> config1.xml

I've started to use more and config files too. On one team, we started to call it 
"config-behind-story".

The idea is that most use-cases (or stories) correspond to a discrete set of 
ActionForms and ActionMappings. It can be much easier to understand how these elements 
work together when the are in a file of their own. We give each story a symbolic name 
(like "InsertPermit") and then try to keep using this symbol throughout, as kind of a 
metaphor. Of course, there are shared configuration files too. But separating the 
shared from the "single-use" also helps to clarify intent.

Meanwhile, whether whitespace makes a difference might depend on the parser. I've put 
them on a separate line with no problem using Tomcat 4.x and 1.4. Just be sure there's 
a comma after each one save the last.

-Ted.


Developing Web Applications Using Open Source Tools
Saturday, 3 Apr 2004, New York City
http://basebeans.com/do/website



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



Re: Fundamental Struts Concept

2004-03-16 Thread Ted Husted
> The reason I ask is that since it is my understanding that either a
> new Action Form is created when the user submits the form or if one
> already exists it is "reset",  how can the Action Form have all of
> the original data, including the one or 2 fields the user just
> submitted?

The ActionForm won't have all the "original" data, just what was submitted on the 
form, including any hidden fields. Unless, as you say, it's in session scope. (Also 
note that reset does nothing by default. So it only clears what *you* tell it to 
clear.)

If you need to redisplay the form, say because validation fails, then put an Action in 
front of the page that will populate the controls (and nothing else). Where ever you 
have a reference to that page, even in the configuration, put a reference to the 
Action instead.

On the DEV list, we've started to call these "PageControllers" or "PageLoaders". The 
idea is that a "business" Action may be able to choose between several display pages. 
But, that Action doesn't need to know what controls are on a given page. All a 
business action should know is the logical name. A PageLoader Action serves as the 
page's proxy. It knows how to populate a certain page's controls, but it doesn't know 
anything about setting the control's default value. That's left to the ActionForm, 
which may have been pre-populated from the request or by a "business" Action. 
Generally, the PageLoader should also forward only to "success" and not make 
navigational decisions. (One possible exception being choosing between localized 
versions of the same page -- but that's another discussion.)

Note that we don't consider this "action chaining" since the PageLoader Action is the 
page's proxy. It doesn't branch off to some other action to continue the business 
operation. Most of still recommend using a single "business" action that fulfills the 
request and selects a resource to complete the response. In this case, the resource 
completing the response is the PageLoader Action working directly with the server 
page. (Consider them a couple.)

It's important to note that you don't *need* to put lists that populate controls on 
the ActionForm. The lists can also exist on a separate object (or objects) separate 
from the ActionForm. In fact, in a post 1.1 world, I'd recommend using a separate 
"chrome bean" to populate select boxes and such. You can then use DynaActionForms to 
represent only The ActionForm can then represent only the input fields on the form.

Under Struts 1.0, I tended to use coarse-grained ActionForms that represented a series 
of related ActionForms (or even all the ActionForms in the application). And, I used 
to embed the lists for the controls too. But this was mainly to make conventional 
ActionForms easier to maintain. Post 1.1, I tend to use finely-grained, single-use 
DynaActionForms that represent the output of a given page, and then put the lists and 
such on a separate bean.

HTH, Ted.


Developing Web Applications Using Open Source Tools
Saturday, 3 Apr 2004, New York City
http://basebeans.com/do/website


On Sun, 14 Mar 2004 15:31:32 -0500, Ed Tornick wrote:
> Let's assume you have a Action Form with much data, including lists
> (you are using nested tags for example). When you create the Action
> Form you load it up with the data from your data source wherever it
> is. Let's also assume that you have set the action path in the
> configuration file so that the scope of this form is request.
>
> If the jsp on the server that is going to create your form on the
> client has only a few of the fields from the Action Form then how
> much data is actually sent to the client in the httpRequest?
>>
> The reason I ask is that since it is my understanding that either a
> new Action Form is created when the user submits the form or if one
> already exists it is "reset",  how can the Action Form have all of
> the original data, including the one or 2 fields the user just
> submitted?
>
> If the scope was session then it would make sense to me that the
> data would still be on the server and the users input would just
> modify a few fields.. but when it is request scope...This is what I
> don't understand.
>
>
> As you can see, probably a very fundamental question but it is key
> to me understanding what is going on.
>
>
> Thanks in advance for your input..
> Ed



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



Re: [OT] Jericho == Struts 2.0?

2004-03-16 Thread Ted Husted
On Mon, 15 Mar 2004 13:07:10 -0800, Nadeem Bitar wrote:
>
> Which role will struts play when JSF matures, and JSF 2.0 is
> released is what interests me more than the proposed name of struts
> 2.0.

Struts will be whatever the community needs it to be.

The Struts-JSF taglib Craig put together demonstrates that it's not an either/or 
proposition.

Even today, not every application needs to use Struts. For smaller, simpler 
applications a Model 1 approach works just fine. With JSF, many moderate-sized 
applications might not need Struts either.

But, in my experience, large, complex applications do need front controllers. Even 
Microsoft admits that now. The next generation of .NET (Whidbey) will include a front 
controller out of the box.

The core role of Struts has always been to provide missing pieces that help enterprise 
developers connect the dots. As we discover what JSF is missing, we can help provide 
those pieces too.

Same old, same old :)

-Ted.



Developing Web Applications Using Open Source Tools
Saturday, 3 Apr 2004, New York City
http://basebeans.com/do/website



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



RE: [OT] Jericho == Struts 2.0?

2004-03-15 Thread Ted Husted
The Apache convention is to give proposals a codename. Once a working implementation 
is available, then, and only then, do we start making decisions that might ultimately 
lead to assigning version numbers.

Absolutely no one is saying that this proposal is going to be Struts 2.0. It's just a 
convenient place to post some notes until somebody decides to do the work.

For more see, the README.

http://cvs.apache.org/viewcvs.cgi/jakarta-struts/contrib/struts-jericho/

And this recent thread on DEV

http://www.mail-archive.com/struts-dev%40jakarta.apache.org/msg21930.html

-Ted.

On Mon, 15 Mar 2004 08:21:12 -0600, Joe Germuska wrote:
> merlin, tiger, longhorn, whidbey, panther, jaguar...
>
>
> folks, "Jericho" is just a name.  When the thing actually gets
> released, it will be Struts 2.0.
>
> Joe




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



[FRIDAY] YA Stuts In Action / JUnit in Action Trivia Quiz

2004-03-01 Thread Ted Husted
Last time, we asked contestants to recite the "jingle" from The Demolished Man by 
Alfred Bester and the "Fear" litany from Dune -OR-  name  two favorite changes, 
improvements, or new additions to theStruts Nightly Build since 1.1 was released (now 
known as Struts 1.2.0 ).

The sought answers were:

Demolished Man:

"Tenser, said the Tensor. Tenser, said the Tensor. Tension, apprehension, and 
dissension have begun."  

Dune:

"I must not fear. Fear is the mind-killer. Fear is the little-death that brings total 
obliteration. I will face my fear. I will permit it to pass over me and through me. 
And when it has gone past I will turn the inner eye to see its path. Where the fear 
has gone there will be nothing. Only I will remain."

As to favorite changes, we had votes for

* Maven project files (still under development!)

* Tiles EL Tag Library

* Session-Scoped ActionMessages

* Struts-Chain (still unreleased)


Of coursem, we had several correct responses. The lucky winner, selected arbitrarily, 
is:


RANDY DILLON


(Randy, please send your surface mail address to [EMAIL PROTECTED], and
indicate whether you would like JUnit in Action or Struts in Action)



NEXT:

To play, correctly answer  -- *DIRECTLY* to me at [EMAIL PROTECTED] -- one or both of 
these questions.


(1) One of the original creators of JUnit now works on a popular open source IDE (with 
some excellent Struts addins!). Name this computer scientist.


-OR-


(2) A SF author, best know for his "edgy" short stories, wrote one of the first Star 
Treck episodes dealing with time travel. Later, he served as the creative consultant 
for another popular TV series, in which time travel plays a pivotal role. Name this SF 
author and his single Star Trek episode.






Contestants sending -- *DIRECTLY* to me at [EMAIL PROTECTED] -- correct answers to the 
to the Computer question *OR* the SF question to me will be eligible for the next 
drawing. (the correct answers being the ones I expect). Prior winners excluded (but 
feel free to play anyway).

The contest will run until Thursday, March 11, 2004, 23:59:59, so everyone  has a 
chance to participate.

The lucky winner selected from the correct responses will receive theirchoice of 
either a signed copy of Struts in Action *OR* JUnit in Action.

(Signed only by me, I'm afraid, my co-authors are scattered across the globe -- gotta 
love the Internet!)

PLEASE be sure to reply to [EMAIL PROTECTED]

If you have an interesting science fiction or computer science question that is hard, 
or at least fun, to google, please send it to me. The first to suggest a question that 
we use also wins!

-Ted.

PLEASE be sure to reply to [EMAIL PROTECTED]




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



Re: [FRIDAY] YA Stuts In Action / JUnit in Action Trivia Quiz

2004-02-07 Thread Ted Husted
On Sat, 07 Feb 2004 10:04:10 -0600, Ted Husted wrote:
> The contest will run until Thursday, January 15, 2004, 23:59:59, so
> everyone has a chance to participate.

Oops, forgot to update the date. :)

The drawing will actually run until February 12, 2004, 23:59:59.

-Ted.



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



[FRIDAY] YA Stuts In Action / JUnit in Action Trivia Quiz

2004-02-07 Thread Ted Husted
Last time, we asked contestants to name for a popular science fiction series that 
featured a psi cop named after a science fiction author

1 The series (Babylon 5)

2 The character (Alfred Bester)

3 The actor who played the character (Walter Koenig)

4 The character this actor played in another famous science fiction series (Chekov)

*OR* to list the twelve core practices of Extreme Programming.



Turn out was low for this contest, so either the questions were hard, or this bit is 
getting stale :)

Anyway, last week's winner is:

* MELISSA L KELLEY

(Melissa, please send your surface mail address to [EMAIL PROTECTED], and indicate 
whether you would like JUnit in Action or Struts in Action)



NEXT:

To play, correctly answer  -- directly to me at [EMAIL PROTECTED] -- one or both of 
these questions.

In The Demolished Man by Alfred Bester, a character used a jingle to help keep himself 
from being "scanned".

  1 The first word of the chant is "Tenser". How does the rest of it go?

In Dune by Frank Herbert, a character used a litany to help him through a time of 
stress.

  2 The first word of the chant is "Fear". How does the rest of it go?

*OR*

  + Name your two favorite changes, improvements, or new additions to the Struts 
Nightly Build since 1.1 was released. Hint: 
<http://jakarta.apache.org/struts/userGuide/release-notes.html>. One more addition, 
currently in progress, is to add a "module" parameters to several tags to allow 
linking between modules. [Yes, 1.2.0 will be along shortly :)]



Contestants sending -- directly to me at [EMAIL PROTECTED] -- correct answers to the 
to the bonus question *OR* the SF question to me will be eligible for the next 
drawing. (the correct answers being the ones I expect). Prior winners excluded (but 
feel free to play anyway).

The contest will run until Thursday, January 15, 2004, 23:59:59, so everyone has a 
chance to participate.

The lucky winner selected from the correct responses will receive their choice of 
either a signed copy of Struts in Action *OR* JUnit in Action.

(Signed only by me, I'm afraid, my co-authors are scattered across the globe -- gotta 
love the Internet!)

    PLEASE be sure to reply to [EMAIL PROTECTED]

If you have an interesting science fiction or computer science question that is hard, 
or at least fun, to google, please send it to me. The first to suggest a question that 
we use also wins!

-Ted.

    PLEASE be sure to reply to [EMAIL PROTECTED]


--
Ted Husted,
   Junit in Action  - <http://www.manning.com/massol/>,
   Struts in Action - <http://husted.com/struts/book.html>,
   JSP Site Design  - <http://www.amazon.com/exec/obidos/ISBN=1861005512>.



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



Re: [OT] Canoe Webtest / HttpUnit

2004-01-07 Thread Ted Husted
I use WebTest a lot. I think you have turn cookies on via the HttpUnit config.

http://lists.canoo.com/pipermail/webtest/2003q2/000735.html

-Ted.

On Wed, 07 Jan 2004 22:28:10 -0500, Edgar P Dollin wrote:
> I have been struggling with these two testing tools for a while now
> attempting to retrofit http tests over an existing working
> application.
>
> JavaScript has been a bear, stuff that works on Mozilla and IE
> breaks in HttpUnit (not that the review didn't turn up myriads of
> errors).  Repairing the scripts has really strengthened the code.
>
> I know that others on this list use Canoe Webtest.  It is much
> nicer writing Webtest scripts than HttpUnit java code.
>
> However, I am ready to give up on WebTest, but before I do would
> like to hear if others have had similar problems.  The issue I
> can't seem get around is that my site requires cookies.  I have a
> hidden field and some javascript to test if cookies are enabled and
> value the hidden field.  Webtest won't value the field and won't
> let me set the value of the field.  Additionally, this issue
> cropped up when I upgraded from Tomcat 4.1.18 to 4.1.29.
>
> Any insight is welcome.
>
>
> Thanks.
>
>
> Edgar
>
>
> ---
> Outgoing mail is certified Virus Free.
> Checked by AVG anti-virus system (http://www.grisoft.com). Version:
> 6.0.558 / Virus Database: 350 - Release Date: 1/2/2004
>
>
> 
> - To unsubscribe, e-mail: struts-user-
> [EMAIL PROTECTED] For additional commands, e-mail:
> [EMAIL PROTECTED]




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



Re: struts vs. portal framework

2004-01-03 Thread Ted Husted
IMHO, Jetspeed isn't a framework per se (or wasn't last time I looked). It's an 
application that you can customize for your own use. You can write custom components 
for  Jetspeed to use, but you're really plugging things into Jetspeed, the way you 
plug things into an IDE, like Eclipse or IDEA. A power user could download Jetspeed 
and get it up and running without being a Java developer.

Struts is a framework to help Java developers create MVC-style web applications. You 
use it to give you a leg up on writing applications. A power use couldn't download 
"Struts" and get it up and running, because Struts isn't something you run. It's 
something you use to create web applications for people to run.

If you download Jetspeed, and it's pretty much what you want, then that's probably 
want you want to use. But if it's nothing like what you need, and you need to write a 
MVC-style web application, the Struts may be what you need.

For more background on the technologies that are used to write web applications, see 
the preface to the Struts User Guide



and the Struts Community Resource Guide at SourceForge

http://struts.sourceforge.net/community/index.html

Struts does not directly support the new portlet specification at this time, but there 
is a lot of interest on the DEV in making that happen. We do want to make Struts a 
very good choice for writing web apps for both the servlet spec and portlet spec, 
hopefully with zero or near-zero code changes.

HTH, Ted.

On Sat, 03 Jan 2004 11:22:36 +, Naresh Agarwal wrote:
> Hi
>
>
> I'm new to the world of web application/portals.
>
>
> What is the difference between struts and a portal framework like
> jetspeed?
>
>
> thanks,
> Naresh




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



[FRIDAY] YA Stuts In Action / JUnit in Action Trivia Quiz

2004-01-03 Thread Ted Husted
Last time (which was some time ago), we asked contestants to identify the title and 
author of a seminal paper regarding artificial intelligence published by the journal 
MIND in 1950. Our bonus question regarding a tangentially related story by Harlan 
Ellison (gotta love Harlan).

As many already know, here are the correct answers

The paper was entitled "" and written by "". The Ellison story featured an AI computer 
named "AM" by the title "I have no mouth and I must scream".

Sadly, one contestant let the cat of the bag and posed the answers to the user list. 
But no worries, we'll just make it a drawing instead. So, that week's winner, selected 
from all the responses, is:

* MICHAEL MCGRADY

as our winning contestant. (Michael, please send your surface mail address to [EMAIL 
PROTECTED], and indicate whether you would like JUnit in Action or Struts in Action)





NEXT:


A popular science fiction series featured a psy cop named after a science fiction 
author

1 Name the series

2 Name the character

3 Name the actor who played the character

4 Name the character this actor played in another famous science fiction series


*OR*, answer this bonus question instead:


* List the 12 core practices of Extreme Programming.


Contestants sending -- directly to me at [EMAIL PROTECTED] -- correct answers to the 
to the bonus question *OR* the SF question to me will be eligible for the next 
drawing. (the correct answers being the ones I expect). Prior winners excluded (but 
feel free to play anyway).

The contest will run until Thursday, January 8, 2004, 23:59:59, so everyone has a 
chance to participate.

The lucky winner selected from the correct responses will receive their choice of 
either a signed copy of Struts in Action *OR* JUnit in Action.

(Signed only by me, I'm afraid, my co-authors are scattered across the globe -- gotta 
love the Internet!)

PLEASE be sure to reply to [EMAIL PROTECTED]

If you have an interesting science fiction or computer science question that is hard, 
or at least fun, to google, please send it to me. The first to suggest a question that 
we use also wins!

-Ted.

    PLEASE be sure to reply to [EMAIL PROTECTED]


--
Ted Husted,
   Junit in Action  - <http://www.manning.com/massol/>,
   Struts in Action - <http://husted.com/struts/book.html>,
   JSP Site Design  - <http://www.amazon.com/exec/obidos/ISBN=1861005512>.



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



Re: how many struts_config.xml

2004-01-02 Thread Ted Husted
It's not going to matter much to the framework. The files are read at startup and then 
dismissed. It's mainly a human engineering issue.

If you are using multiple configs in the same module, and can be sure that the none of 
the element names collide across the files, then it's just a matter of personal 
preference.

I often advise teams that are working closely together to use multiple configs rather 
than modules, since the "paper wall" approach of modules often creates as many 
problems as it solves. It's really not that hard to enforce your own prefixes, so long 
as there is an "enforcer" to which everyone reports.

-Ted.

On Fri, 02 Jan 2004 17:52:00 +0800, Kalra, Ashwani wrote:
> hi,
>
>
> Is there any drawbacks of having too many struts_config.xml files.
> Any guidelines on this ?
>
>
> Thanks & Regds
> Ashwani Kalra
>
>
> 
> This message contains information that may be privileged or
> confidential and is the property of the Cap Gemini Ernst & Young
> Group. It is intended only for the person to whom it is addressed.
> If you are not the intended recipient, you are not authorised to
> read, print, retain, copy, disseminate, distribute, or use this
> message or any part thereof. If you receive this message in error,
> please notify the sender immediately and delete all copies of this
> message.
>
> 
> - To unsubscribe, e-mail: struts-user-
> [EMAIL PROTECTED] For additional commands, e-mail:
> [EMAIL PROTECTED]




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



Re: applyLocalizedPattern

2004-01-01 Thread Ted Husted
That's definitely what we were looking for :)

Next question for the group: What's the best way to determine the unicode value for fr 
group separator character?

>From this, I can't actually tell what character it's suppose to be. The browser 
>substitutes another character. I tried saving the java file directly, but when I try 
>to paste it over, something is lost in the translation (so to speak), and I end up 
>with a question mark.

-Ted.

On Fri, 02 Jan 2004 09:35:04 +1300, Jason Lea wrote:
> I don't know the official location but this stuff seems to be
> located in  your jre/lib/ext/localedata.jar as class files
>
> I found this link to some java source for these (java v1.1.7) here
> http://www.dei.unipd.it/corsi/fi2ae-
> docs/source/jdk1.1.7/src/java/text/resources/
>
> This one:
> http://www.dei.unipd.it/corsi/fi2ae-
> docs/source/jdk1.1.7/src/java/text/resources/LocaleElements_fr.java
> has
>
>
> ",", /*decimal separator*/
> " ", /*group (thousands) separator*/
>
>
> where
> http://www.dei.unipd.it/corsi/fi2ae-
> docs/source/jdk1.1.7/src/java/text/resources/LocaleElements_en.java
> has
>
>
> ".", /*decimal separator*/
> ",", /*group (thousands) separator*/
>
>
> Ted Husted wrote:
>
>
>> When  is provided a pattern through the message
>> resources, rather than as a tag attribute, the
>> applyLocalizedPattern
>> <http://java.sun.com/j2se/1.4.2/docs/api/java/text/SimpleDateFormat.ht
>> ml#applyLocalizedPattern> method is used. This method assumes the
>> pattern is using a localized notation.
>>
>>
>> Does anyone know where the localized notations are documented?
>>
>>
>> Or, do you have to run a test program with toLocalizedPattern and
>> discover it that way?
>>
>>
>> This question relates to Issue #2119
>> <http://issues.apache.org/bugzilla/show_bug.cgi?id=21992>.
>>
>>
>> -Ted.
>>
>>
>> --
>> --- To unsubscribe, e-mail: struts-user-
>> [EMAIL PROTECTED] For additional commands, e-mail:
>> [EMAIL PROTECTED]




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



RE: Problem with action chaining

2004-01-01 Thread Ted Husted
In your case, something to consider might be to use BSF scripts instead of Java 
Actions.

<http://struts.sourceforge.net/struts-bsf/index.html>

Another idea would be to reduce the business classes to Commands (using the Command 
Chain of Command package) <http://jakarta.apache.org/commons/sandbox/chain/>. A 
standard Action could then be used to run one or more business Commands.

Something else that has been mentioned is the idea of using JSPs for Actions, but I 
don't know that anyone has implemented anything yet.

-Ted.


On Thu, 01 Jan 2004 10:49:46 -0500, Tim Lucia wrote:
> Ted,
>
>
> Thanks for the reply.
>
>
> Putting methods in the base action(s) works (since the actions are
> related by what attributes they add to the request or session.)
> The down side is that the page designer who is ignorant of Java (or
> may not have access to the code) can't make changes this way. If I
> have an action to retrieve each business object and put it in the
> request (session) under a known key, then the page designer can
> chain these together to produce the objects necessary for the view.
>  I hesitate to say that the actions are "doing actual work", other
> then the bare minimum - access the DAO to get a (list of) object(s)
> and place it (them) in a request (session) attribute.
>
> (Background note -- I have a requirement where there will be
> customizations done by field engineers at various customer sites.
> They need to know how to move tiles around (new layouts), and
> understand basic struts tag libraries, and HTML [which they already
> know].  By chaining actions, they can use the existing .class files
> without us shipping the java sources and having them modified in
> the field.)
>
> Happy New Year,
> Tim
>
>
>> -Original Message-
>> From: Ted Husted [mailto:[EMAIL PROTECTED]
>> Sent: Wednesday, December 31, 2003 4:10 PM
>> To: Struts Users Mailing List
>> Subject: RE: Problem with action chaining
>>
>>
>> On Wed, 31 Dec 2003 12:36:33 -0500, Tim Lucia wrote:
>>
>>> So is it a bad design if you have
>>>
>>>
>>> Action1 -> add CollectionOfObject1 to request
>>> Action2 -> add Object2 request
>>>
>>>
>>> And then chain them together to produce two request attributes?
>>>  I have some pages which display a list of Object1, and other
>>>
>> pages which
>>> require the Collection to populate a select.  So I define
>>>
>> action path
>>> 1 to be action 1 and forward to the display for the Collection
>>> of Object1, and define action path 2 to be action 1 forward to
>>>
>> action 2
>>> forward to editor page which has a select of collection of
>>>
>> object 1,
>>> while editing Object2.
>>>
>>
>> One common strategy is to use one action as a "page controller"
>> and another as the "business transaction controller".
>>
>> The "business" action works as a go between with the business API
>> and DAO
>> objects. The Action class extracts any needed input from the
>> ActionForm and
>> packages for the API/DAO objects. If appropriate, it also bundles
>> any output and
>> places it in a servlet context, sometimes by populating an
>> ActionForm, other times by creating some other bean.
>>
>> The "page" action ensures that whatever assets the page needs are
>> available.
>> These may be lists for drop-down boxes and so forth. This may
>> also mean
>> interacting with the API/DAO objects, but the interaction is
>> static and driven
>> by the page display requirements, rather than what the user
>> input..
>>
>>
>> As mentioned, each of these actions should represent a single
>> "unit of work".
>> The business Action is an adapter for the user input. The page
>> Action is an adapter for the page output.
>>
>> The core idea is that Actions are Adapters -- not the actual
>> working classes.
>> When people start chaining several actions together, it is
>> usually a signal that
>> the Actions classes are doing actual work, rather than just
>> acting as a go-between with the business classes.
>>
>> The problem with Actions doing the work is that these classes are
>> bound to
>> Struts and to the HttpServlet platform. Struts Actions are not
>> easy to reuse
>> outside of Struts and are more difficult to test than POJO
>> business classes.
>>
>> Creating your own set of business API or DAO classes isn't
>> difficult. You can
>>

applyLocalizedPattern

2004-01-01 Thread Ted Husted
When  is provided a pattern through the message resources, rather than as 
a tag attribute, the applyLocalizedPattern 

 method is used. This method assumes the pattern is using a localized notation.

Does anyone know where the localized notations are documented?

Or, do you have to run a test program with toLocalizedPattern and discover it that way?

This question relates to Issue #2119 
.

-Ted.



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



Re: is there an eta for struts 1.2 beta?

2003-12-31 Thread Ted Husted
On Tue, 30 Dec 2003 15:52:03 -0500, John McGrath wrote:
> we've been using a nightly build of 1.2, in order to be be able to
> more easily put ActionMessages into the session object. we're a
> little leery of putting it into production, though, until there's
> at least an official beta... any idea when that might be?
>
> this is our first struts project, and we're excited about it. many
> thanks to the developers.
>
> john

We're working down the short-list of outstanding problem reports.



I believe that when these are clear, we should be able to roll the 1.2.0
release. This will start out as an alpha, and then may proceed to beta, and even
General Availability (stable), depending on the votes of the committers.

Other than these issues, it shouldn't be any different than the nightly build
though.

I also wanted to include more of the outstanding enhancements, especially those
with patches , but those may have to wait for 1.2.1 :)

-Ted.



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



RE: Problem with action chaining

2003-12-31 Thread Ted Husted
On Wed, 31 Dec 2003 12:36:33 -0500, Tim Lucia wrote:
> So is it a bad design if you have
>
>
> Action1 -> add CollectionOfObject1 to request
> Action2 -> add Object2 request
>
>
> And then chain them together to produce two request attributes?  I
> have some pages which display a list of Object1, and other pages
> which require the Collection to populate a select.  So I define
> action path 1 to be action 1 and forward to the display for the
> Collection of Object1, and define action path 2 to be action 1
> forward to action 2 forward to editor page which has a select of
> collection of object 1, while editing Object2.

One common strategy is to use one action as a "page controller" and another as
the "business transaction controller".

The "business" action works as a go between with the business API and DAO
objects. The Action class extracts any needed input from the ActionForm and
packages for the API/DAO objects. If appropriate, it also bundles any output and
places it in a servlet context, sometimes by populating an ActionForm, other
times by creating some other bean.

The "page" action ensures that whatever assets the page needs are available.
These may be lists for drop-down boxes and so forth. This may also mean
interacting with the API/DAO objects, but the interaction is static and driven
by the page display requirements, rather than what the user input..

As mentioned, each of these actions should represent a single "unit of work".
The business Action is an adapter for the user input. The page Action is an
adapter for the page output.

The core idea is that Actions are Adapters -- not the actual working classes.
When people start chaining several actions together, it is usually a signal that
the Actions classes are doing actual work, rather than just acting as a
go-between with the business classes.

The problem with Actions doing the work is that these classes are bound to
Struts and to the HttpServlet platform. Struts Actions are not easy to reuse
outside of Struts and are more difficult to test than POJO business classes.

Creating your own set of business API or DAO classes isn't difficult. You can
use a PlugIn to create a instance of your classes in application scope under a
known name and then have the Actions call them there. Just be sure they are
thread-safe, like Actions.

Or, depending on your circumstances, Actions can create new instances of
business classes so you don't have to worry about thread-safety. Object creates
are a lot cheaper than they used to be.

If several of the page or business Action classes need to do the same thing that
isn't business-related (create some presentation collection or what-not), you
can put that code in a base Action that any subclass can call. In that way, you
get code-reuse the old-fashioned way, instead of by making multiple trips
through the HTTP layer.

HTH, Ted.




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



Re: Multiple struts-config.xml

2003-12-19 Thread Ted Husted
Just specify whatever files you want to use as a comma-delimited list in 
the web-xml. See the Struts Mailreader (struts-example) for a working 
example.

HTH, Ted

Sudhakar G wrote:
Hi,
Can any one give me a example how struts supports multiple struts-config.xml
file?
Thanks in advance..
cheers
Sudhakar




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


Re: Test tiles attribute presence

2003-12-19 Thread Ted Husted
I think you would import the Tiles attribute into page scope, and then 
use the usual logic tags.

-Ted.

Franck wrote:
Hi,

In a tiles template I would like to test if a tiles attribute should be
inserted or not :
Example :


  

I would like to code something like



  


Something to remplace the non-existing tiles:notEmpty ?

Thanks

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


Re: how to not insert javascript into forms

2003-12-19 Thread Ted Husted
I think that's only if you use the "focus=" attribute.

[EMAIL PROTECTED] wrote:
Hallo,
when I use 
page. How I can disable it? 

Thanks,
Jiri




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


Re: Runtime Generation of DynaValidatorActionForms

2003-12-19 Thread Ted Husted
People often ask about this kind of use case, but, AFAIK, there's not a 
generic solution. (In fact, something similar came up on the DEV list 
yesterday.)

What would be helpful is some type of simple example application that 
demonstrated the use case. A lot of haven't had to this sort of thing 
ourselves, and you can only take a thought experiment so far.

I personally have a lot of trouble getting my head around the complete 
work flow, since you'd also have to generate the HTML form dynamically, 
as well as the query that eventually handled the database update.

-Ted.

Hookom, Jacob wrote:
Runtime Generation of DynaValidatorActionForms, is it possible?  We have
forms defined in the DB and I want to generate a DynaActionForm that would
use Validator.
I checked the main struts books we have at the office and couldn't find any
reference to something like this, I'm sure others have done it, care to
share? :-)
Thanks!

Jacob Hookom
Senior Programmer/Analyst
McKesson Medical-Surgical
Golden Valley, MN


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


Re: Accessing PlugIn config information

2003-12-19 Thread Ted Husted
Typically, you would have the PlugIn store an object in the Servlet 
scope under a known name, and then other objects could retrieve the 
information form there. So, the PlugIn does provide the service itself, 
it's a loader for the service provider.

HTH, Ted.

Andy Engle wrote:
Hi all,

I am wondering if there is a clean(er) way to get PlugIn configuration
information out of struts-config.xml.  I have written a PlugIn that
gets this information, but it seems somewhat convoluted.  First I get
all the PlugInConfigs, then I loop through that array of PlugInConfig
objects until I find the one that matches the current PlugIn I'm
working with.  Next, I set that value as my PlugIn index and get the
properties from there.  While this works, it seems like I am getting it
almost "by hook or by crook", and I'm wondering if there is a more
elegant way to do it.  I'm not sure I like the use of the "for" loop;
it seems there should be a way to just directly access the PlugIn's
config info right away.  The code snippet I'm using is below.
Thanks for any advice!

Andy

---

Here's that code snippet:

// Get all the PlugIn configs, for every plugin
PlugInConfig allPluginConfigs[] = config.findPlugInConfigs();
// This goes through all the Plugin configs and looks for the
// plugin config for this class.
for(int i = 0; i < allPluginConfigs.length; i++) {
 
if(allPluginConfigs[i].getClassName().equals("com.andyengle.struts.app.WhateverPlugin"))
{
pluginConfigIndex = i;
break;
  }
}

// Get the properties for this PlugIn and shlep them into a map.
thisConfigMap = allPluginConfigs[pluginConfigIndex].getProperties();
// Finally, access the config information that was set in struts-config
String value1 = (String) thisConfigMap.get("val1_str");
String value2 = (String) thisConfigMap.get("val2_str");
-
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]


Re: Application url , why it does not change?

2003-12-19 Thread Ted Husted
The Servlet API provides for an internal forward that happens 
server-side. The request does not go back to the client, and so the 
client has no clue that some other resource has responded.

There is a redirect attribute in the forward element that causes a 
"round trip" with the client: it has the client make another request for 
the resource and so the address bar changes. The side effect there is 
that you lose the servlet request context (since it completes one 
request and creates another).

If you want the address bar to remain constant, one solution is to use 
frames (which has its own baggage).

Of course, none of this is really about Struts, but about how web 
applications work. For more background, see the Web Technology section 
of the Java WebServices Tutorial 
, along 
with the other links in the Preface to the Struts User Guide 
.

HTH, Ted.

martin holmes wrote:
Hi I have developed a simple web application with struts and I am having
trouble understanding why the url in the address bar changes to a path set
by a link or a form submission, but does not change when forwarded from the
mapping .findforward() in  an action object.
Ideally I would like the url in the address bar to reamain the same throught
site navagtion.
Can someone please help me understand these points.
thanks martin



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


Re: Validate method in action form

2003-12-18 Thread Ted Husted
Another approach would be to create a base ActionForm with the 
properties, and then extend it for each validation instance.

You can also use the came ActionForm class in multiple form-bean 
elements, and then use the Struts Validator to give each form-bean it's 
own validation suite.

HTH, Ted.

vasudevrao gupta wrote:
I have a single action form bean for multiple JSP pages.
Validation of fields for JSP1 is different from validation of fields in
JSP2.
How should I write the validate() method in the form so that depending
on the 
action, appropriate validation of fields is done.

Regards
Vasudevraogupta
Confidentiality Notice 

The information contained in this electronic message and any attachments to this 
message are intended
for the exclusive use of the addressee(s) and may contain confidential or privileged 
information. If
you are not the intended recipient, please notify the sender at Wipro or [EMAIL 
PROTECTED] immediately
and destroy all copies of this message and any attachments.
-
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]


Re: ActionMapping - regexp pattern matching for path

2003-12-17 Thread Ted Husted
Not in 1.1, but you can use wildcards in the nightly build.

http://jakarta.apache.org/struts/userGuide/building_controller.html#action_mapping_wildcards

Sergey Proskurnya wrote:

Hello to all,

In Struts-1.1 it is possible to bind Actions to static URL path,
but is it possible to bind Actions to the set of the paths,
described by Java regular expression?
For example:




I mean that in this case the requests for "/users/John/",
"/users/Mary/" and etc. will be handled by "com.mysite.UserPageAction".
Thanks for attention,
  Sergey Proskurnya.
-
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]


Re: [OT] I didn't know Struts was an "antipattern"

2003-12-17 Thread Ted Husted
Gus Heck wrote:
Interesting, I'm not sure I agree, but the patch that he complains about 
not being added sounds useful...
A lot of people have requested a history stack, and have also 
implemented it in their own applications. But I think we need to solve 
it in the larger context of a general solution to workflow issues.

Meanwhile, the post the author cited does *not* prove this point. In 
fact, it proves just the opposite.

The developer said that he *was able* to extend the framework and was 
simply offering the extension to the community. This is the same way the 
Validator and Tiles started.

The author was offering it as an example of Struts being inflexible when 
in fact is an example of Struts being flexible enough that people can 
extend it without our help :)

-Ted.



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


Re: iBatis DAO + Hibernate?

2003-12-16 Thread Ted Husted
You might be confiusing the iBATIS SqlMaps framework with the seperate 
and distict iBATIS DAO framework. Mixing and matching SqlMaps with 
Hibernate would probably be a bad idea, but the iBATIS DAO framework is 
a horse of a different color.

The DAO framework is not linked to SqlMaps and should work with 
anything. Otherwise, it could not be a DAO framework, since the whole 
idea is that you can change persistence implementations.

Gavin King himself does recommend using the DAO strategy with Hibernate. 
It's just that Hibernate does not provide a DAO framework of its own.

-Ted.

Larry Meadors wrote:

I am working in an environment where we are mixing the two. 

My advice to you is to *not* do it. Pick one and use it as it was
intended to be used.
I personally prefer iBATIS. It is very simple; it plays well with
existing databases; it allows you the flexibility, commodity and
performance tuning of sql; it provides object wrappers for your data.
All while staying in your DAO and out of your application.
From my experience, if you are using hibernate, you write hibernate
applications, not java applications that use hibernate - even if you try
to wrap it so that it is not used directly. Trust me, we did. If you are
willing to accept that, hibernate may work for you.
Some other factors to consider: 
 - How many developers know hql vs sql?
 - How much time will it take for a new person to learn the
idiosyncrasies of the tool (and they both have them)?

Larry


[EMAIL PROTECTED] 12/16/03 9:40 AM >>>
We're needing to roll out DAO and ORM in our webapp... been evaluating
hibernate and it looks awesome, but we'd like to insulate our app from
that,
has anyone tried using iBatis' DAO layer then plugging hibernate
underneath
that?
-David
-
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]



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


Re: .Net Struts?

2003-12-16 Thread Ted Husted
There's a similar framework called Maverick that has Java, .net, and PHP 
 versions available.

http://mav.sourceforge.net/

If you are more than just curious and were looking for something like 
Struts to use on .net today, Maverick is your best option.

Several people are working on PHP versions of Struts (google: php 
Struts), but I'm not aware of anyone actively working on a .net version.

-Ted.

Dhaliwal, Pritpal (HQP) wrote:
Is anyone working on struts in .Net?

Curious..

Pritpal Dhaliwal

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


Re: Struts EL status

2003-12-16 Thread Ted Husted
As a longtime Struts Committer, I can tell you that it *is* part of the 
main development tract. As Joe mentioned, the only reason it doesn't 
ship with the other taglibs is because it requires a 2.3/1.2 container.

When a 2.3/1.2 container is in play, I do tell my own clients to prefer 
Struts EL to the conventional HTML taglib, and to prefer JSTL to the 
other Struts taglibs, when convenient. (OT: I also advice people to 
create their own JSP taglibs as needed, especially when doing so reduces 
the number of tags on a page.)

Of course, some teams are comfortable with the conventional tags and may 
choose to stay the course. As long as the Community is using the 
conventional taglibs, I'm sure they will remain available.

But, if this is a "duty now for the future" question, the answer is JSTL 
and Struts EL.

HTH, Ted.

Derek Clarkson wrote:
Hi all,
	My boss doesn't want to use Struts EL because as he puts it "it's not part of 
the main development and we can't tell where it might go". Can anyone clarify 
when and if it is going to take over ? everyone seems to be using it and I've 
used it in two projects (which didn't make my boss happy!)



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


Re: iBatis DAO + Hibernate?

2003-12-16 Thread Ted Husted
I haven't tried it, but I have used the DAO layer with mock 
implementations, and it works just fine. There's nothing in that part of 
it that is SqlMap specific. Clinton Begin says that it should work with 
Hibernate, or anything else, and I would agree. For the 2.0 release, 
I've been encouraging Clinton to release these as separate products.

HTH, Ted.

David Erickson wrote:
We're needing to roll out DAO and ORM in our webapp... been evaluating
hibernate and it looks awesome, but we'd like to insulate our app from that,
has anyone tried using iBatis' DAO layer then plugging hibernate underneath
that?
-David
-
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]


Re: Struts EL status

2003-12-16 Thread Ted Husted
What is supported and what is deprecated is totally up to the community. 
  If there are people out there who want to use and maintain the 
original Struts tags, then there's no reason why they cannot remain 
current.

All that has ever happened is that the current set of Committers are not 
using the original tags themselves, and so these individuals are not 
aggressively pursuing new development themselves. But if another 
developer comes along and pursues enhancements for these tags, and also 
groks the Apache Way, we would be happy to add another Committer.

It is true that, all things remaining equal, JSTL tags should be 
preferred to other JSP tags. "Duty now for the future." But until *your* 
container supports JSTL internally, it makes no practical difference 
which tags you use.

-Ted.

Vic Cekvenich wrote:
Yes, I would say BEAN and LOGIC tags should not be used!
One should use JSTL, DisplayTag, Struts Menu, HTML-el, Tiles-el.
AFAIK EL will become main (and others deprecated) when Struts drops 
support for Tomcat 3, which is planed for Struts 2.0.

I do think everyone is using EL and if they are not, it's a mistake (or 
they are on Tomcat 3. I am on Tomcat 5 and Resin 3 since they came out)

.V

Mike Duffy wrote:

IMHO:   Using the Struts HTML-EL tags with JSTL is the best way to 
go.  The Struts Logic tags are
not as funtional as JSTL.

Mike

--- Derek Clarkson <[EMAIL PROTECTED]> wrote:

Hi all,
My boss doesn't want to use Struts EL because as he puts it "it's 
not part of the main development and we can't tell where it might 
go". Can anyone clarify when and if it is going to take over ? 
everyone seems to be using it and I've used it in two projects (which 
didn't make my boss happy!)

--
Regards,
Derek Clarkson
.O. Analyst/Programmer
..O Waterwerks Pty Ltd
OOO Melbourne, Australia
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


__
Do you Yahoo!?
New Yahoo! Photos - easier uploading and sharing.
http://photos.yahoo.com/




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


Re: Help URL Rewriting

2003-12-11 Thread Ted Husted
The container can't be sure that any given client supports cookies, so 
it will always use URL rewriting on the first request.

-Ted.

michel Van Asten wrote:
Hi,

I have a strut application running with ServletExec 4.1 (patch 20...)
I want to manage my session with cookies... not url rewrinting
need to disable url Rewriting (to complicate to explain why here...)
1) I Enable cookie in my explorer
2) E disable url rewrinting with ServletExec admin
...

But I still have this code in my start page ??

 <
BR>
How can I control that the cookie is generated ???

Regards,

Michel Van Asten

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


Re: PlugIn Interface implementation

2003-12-11 Thread Ted Husted
The purpose of the plugin interface is to give people a chance to 
initialize their own resources without subclassing ActionServlet or 
creating their own.

Typically, you would not use the PlugIn class directly, but whatever 
resources it initialized (and then placed in Application scope under a 
known name).

In any event, you should definately remove any service methods from the 
Action class and place these on some other object. A very good candidate 
for a service layer is the Chain of Command package, now in the Jakarta 
 Commons Sandbox. Another likely suspect is HiveMind (also in the 
Sandbox).

HTH, Ted.

Gopal Venkata Achi wrote:
Hi All,
 
Has anyone experienced with PlugIn interface implementation?
We are thinking of abstracting the service calls from the action class and creating the service layer which implements PlugIn.  
Please suggest me on what is the advantage that we get by implementing this PlugIn, and is this PlugIn is a kind of marker interface, does it allow me to create different methods while implementing?
In implementing class, what are all objects that we have access to?
 
I appreciate any help/suggestions in this regard.
 
Regards,
Gopal
 



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


Re: dynamically sized form (mostly solved)

2003-12-11 Thread Ted Husted
I'm sure it's come up before, but a link to the Commons ListUtils might 
be helpful here:

http://tinyurl.com/87fs

What Robert is doing seems like the cannonical solution to me. In many 
cases just specifying a classname in the configuration wouldn't be 
enough, and so you need to  use reset as well.

The other thing to note is that reset files before any autopopulation 
takes place.(It's the prepopulation extension point.) Then, if 
validation, passes, the Action class (if any) fires.

HTH. Ted.

Robert Taylor wrote:
Nicholas,

I use DynaActionValidatorForm almost exclusively in my application.
I have successfully used IndexedProperties for structures that are dynamic
using LazyLists.
For me, when ever I have to do this, I always have to think about how Struts
handles the sequence of events in a request and submission.
What I do is subclass DynaActionValidatorForm and override the reset().
The reset() gets called before the action is executed.
For example:

/**
 * Reset all bean properties to their default state.  This method is
 * called before the properties are repopulated by the controller servlet.
 * 
 * The default implementation uses the initial value specified in the
 * FormPropertyConfig element for each property.
 *
 * @param mapping The mapping used to select this instance
 * @param request The servlet request we are processing
 */
 public void reset(ActionMapping mapping, HttpServletRequest request) {
super.reset(mapping, request);

/*
 * We have to create lazy lists for selected items
 * because we don't know which items will index
 * into the collection. A lazy list will create
 * the appropriate item at a specified index if it
 * doesn't exist there.
 */
 List selectedItems = ListUtils
.lazyList(new ArrayList(), new SelectedItemFactory());
this.set("selectedItems", selectedItems);

// other stuff here if necessary
}
My Factory classes are usually inner classes to the subclassed
Dyna*Form.
For example:

/**
 * SelectedItemFactory is used in the form
 * to create a lazy list that will lazily create selected items.
 *
 * @author Robert Taylor
 * @author last modified  $Author: rtaylor $
 * @version $Revision: 1.8 $ $Date: 2003/11/17 13:58:51 $
 * @see org.apache.commons.ListUtils
 */
class SelectedItemFactory implements Factory {
/**
 * Create a new instance of the specified object
 */
public Object create() {
return new SelectedItemVO();
}
}

As long as the input fields which are added to the client have the correct
syntax
for indexing into your form (formName.selectedItems[0].fieldName) then
Struts should
handle the rest.
Does that help at all?

robert




-Original Message-
From: Nicholas L Mohler [mailto:[EMAIL PROTECTED]
Sent: Thursday, December 11, 2003 7:46 AM
To: Struts Users Mailing List
Subject: Re: dynamically sized form (mostly solved)






Ted,

The origin of this thread had to do with using Indexed Properties and a
Dyna* form.  As when using the ActionForm, getting the values to the
browser is not an issue.  The area where the difficulty arises is when the
values are returned from the browser.
When using the ActionForm  (or subclass), this is neatly handled by
implementing the LazyList (or similar functionality) or by making the form
have session scope.  Note that the session scope solution fails if the
end-user can add new entries to the list without a call to the server.  In
the app I work on, we use javascript to add and remove list
elements, so we
use LazyList functionality.
The problem is when the Dyna* type forms are used.  How do the indexed
properties get back into the form when the page is submitted.  Similar to
ActionForm based implementations, the form can have session
scope, but this
also fails if the user can add new entries to the list without a server
call.  It isn't obvoius how one would implement LazyList type
functionality
in a dyna form.
I have seen the suggestions for map-backed forms, but I don't see how this
would help for the indexed properties...how it would be different
from just
grabbing the indexed properties out of the request.
Any thoughts on this?
Nick




 Ted Husted

 <[EMAIL PROTECTED]To:   Struts
Users Mailing List <[EMAIL PROTECTED]>
 g>   cc:
  Subject:  Re:
dynamically sized form (mostly solved)
  12/11/2003 07:03

 AM

 Please respond to

 "Struts Users

 Mailing List"









I've lost track of the underlying use case for this thread, but if it's
about populating input options on a form, you might consider using a
second object for storing these types of options. For a time, some of us
were starting to use the ActionForm to r

Re: dynamically sized form (mostly solved)

2003-12-11 Thread Ted Husted
I've lost track of the underlying use case for this thread, but if it's 
about populating input options on a form, you might consider using a 
second object for storing these types of options. For a time, some of us 
were starting to use the ActionForm to represent the input options along 
with the input values. This notion had more to do with code maintenance 
than architecture. At this point, I would suggest using finely-grained 
DynaActionForms to represent only the input required by an action. All 
other constructs, like arraylists for select boxes and so forth, can be 
put on a second "chrome" bean. A distinct advantage here is that you can 
scope the chrome bean as appropriate. A global default can live in 
applidcation scope, and other can live in session or request scope, as 
appropriate to a request.

HTH, Ted.

Andy Schmidgall wrote:
Does this mean it's impossible to do through request scope? I am
attempting to do this, and it would be nice to know if my work is in
vain :)
-Andy

-Original Message-
From: Yee, Richard K,,DMDCWEST [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, December 10, 2003 3:20 PM
To: 'Struts Users Mailing List'
Subject: RE: dynamically sized form (mostly solved)

I thought it worked, but it didn't.

-Richard

-Original Message-
From: Nifty Music [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, December 10, 2003 1:02 PM
To: [EMAIL PROTECTED]
Subject: RE: dynamically sized form (mostly solved)

Nicholas, 

What you said definitely makes sense to me.  Richard graciously replied
off-list with a similar response.  I remember reading documentation
which stated that when using dynamic arrays with DynaForms, it is
necessary to place the DynaForm in session scope.  However, I 'm almost
positive that someone (Matt? Mark?) mentioned on this list that they
were able to pass an ArrayList through a DynaForm in request scope.  For
a variety of reasons, I'm not too eager to put the entire formbean in
the session for the sake of propogating one ArrayList attribute.  If
Matt or Mark or anyone else has some insights to share regarding how
they were able to get this to work in request scope, I'd be very
grateful to hear.  

Thanks again,

Brent

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


Re: logic tag using locale

2003-12-10 Thread Ted Husted
I'd suggest resolving this type of language choice in the Action. For 
example, there could be one product bean that is populated with whatever 
language is preferred by the client. The page could then just write 
whatever has been placed into the bean.

HTH, Ted.

Tsang, F (Fred) wrote:
All,

I'm trying to do a bean:write based on the user's current language.
Before you ask, this isn't just internationalization using the
properties files.  I'm displaying item attributes stored in a database,
where there are german and english descriptions.  I know I can set a
bean in my action and access the tag like so:
request.setAttribute("currentLanguage",
getLocale(request).getLanguage());

  
 
   
is there a bean for locale by default which removes the need to set the
currentLanguage bean I have above?  something like:

  

Are there any special beans which have default names?  Any help is
appreciated.
cheers,
Fred


_

This email (including any attachments to it) is confidential, legally privileged, 
subject to copyright and is sent for the personal attention of the intended recipient 
only. If you have received this email in error, please advise us immediately and 
delete it. You are notified that disclosing, copying, distributing or taking any 
action in reliance on the contents of this information is strictly prohibited. 
Although we have taken reasonable precautions to ensure no viruses are present in this 
email, we cannot accept responsibility for any loss or damage arising from the viruses 
in this email or attachments. We exclude any liability for the content of this email, 
or for the consequences of any actions taken on the basis of the information provided 
in this email or its attachments, unless that information is subsequently confirmed in 
writing. If this email contains an offer, that should be considered as an invitation 
to treat.
_
-
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]


Re: When HashMap will replace ActionForm ?

2003-12-10 Thread Ted Husted
As mentioned, you can use a map-backed ActionForm to store whatever 
fields you need without defining them elsewhere.

http://tinyurl.com/ymkr

You do need to code the forms a little differently, and your forms still 
need to know what properties/entries to ask for.

Personally, I would strongly recommnend using DynaActionForms. The 
overhead of defining the elements in the configuration is negligable in 
practice, and it clearly defines which properties are used with which 
forms.

In practice, what really costs projects time is miscommunication. For 
example, is the entry name in the Map userName or username? With 
DynaActionForms all the entry names are documented in the configuration. 
Otherwise, you will have to document them elsewhere and redo what has 
already been done.

I *am* a big fan of using Maps for Contexts, especially between 
application layers, and with the Commons Chain influence, we're sure to 
see more of that. The thing about DynaActionForms is that you get the 
agility of a Map with the documentation of a JavaBean.

HTH, Ted.

Antony Paul wrote:
but it prints the form field name like this map(username). I want to get the
key as name of form field. here username. possible ?
rgds
Antony Paul.
- Original Message -
From: "Fullam, Jonathan" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Wednesday, December 10, 2003 7:30 PM
Subject: RE: When HashMap will replace ActionForm ?


That's where a map-backed Hashmap is useful.

-Original Message-
From: Antony Paul [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 10, 2003 6:02 AM
To: Struts Users Mailing List
Subject: Re: When HashMap will replace ActionForm ?
I know that but one have to define 10 to 30 elements in struts-config.xml
for that. With a hash map one have to say whether it is needed ot not. It
could be accessed like DynaValidator form. And my requirement is to store
simple text field values.
rgds
Antony Paul.
- Original Message -
From: "Kalra, Ashwani" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Wednesday, December 10, 2003 4:05 PM
Subject: RE: When HashMap will replace ActionForm ?


DynaValidator forms stores data in Hashmap internally if you dont want
to

define norma action forms.





-Original Message-
From: Antony Paul [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 10, 2003 2:40 PM
To: struts
Subject: When HashMap will replace ActionForm ?
Hi,
  Is there any move to support HashMap in place of
ActionForm ?. I dont
want to start any argument. I have read a lot on ActionForm in
this archive.
rgds
Antony Paul.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

This message contains information that may be privileged or confidential
and

is the property of the Cap Gemini Ernst & Young Group. It is intended
only

for the person to whom it is addressed. If you are not the intended
recipient, you are not authorised to read, print, retain, copy,
disseminate,

distribute, or use this message or any part thereof. If you receive this
message in error, please notify the sender immediately and delete all
copies

of this message.

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


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


Re: ActionErrors without resource bundle.

2003-12-10 Thread Ted Husted
You can put a single entry in the bundle

general.error={0}

and use this with all your error messages.

HTH, Ted.

Antony Paul wrote:
Hi,
I want to display error messages saved in Action class using  saveErrors
without looking at resource bundle. Instead of the key provide message.
Possible ?
Our app does not need internatilisation support and putting all errors
related to business logic in resource bundle is unnecessary. There will be
lot of entries int it. One have to use searching tools to find the error
message in bundle.
rgds
Antony Paul
-
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]


Re: [OT] Log4J and Pre-Processor

2003-12-09 Thread Ted Husted
You might first run some load tests to see if the boolean statements do 
have a non-negligable performance impact. It's easy to loose something 
like this in the rounding, and there may be better places to spend your 
optimization dollars. As scientists, we should should more than "feel", 
we should know.

Tolle Krez wrote:
Sorry for an off-topic post. I hope I will get an answer since this is a very active
mailing list.
I am using Log4J for logging in my current project with too many logging statements.  I
wrap every logging statements with the  isDebugEnabled(), isWarnEnabled(), etc.  During
production , the logging level will be set to very minimum, and only critical errors 
will
be logged.  But however,  the boolean comparison statements (whether or not to log) 
will
be executed, which we feel will have a performance impact.
I would like to know if  it is a good idea to pre-process the java code to remove all 
the
logging statements and then create the binary?? or to begin with, limit the number of
logging statements during the development process itself?? If pre-processing the source
code to find and remove logging statements.. is a better option, then can some one 
point
me to a good java pre processor?
Thanks in Advance.



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


Re: Have your Book: UserInRole question

2003-12-09 Thread Ted Husted
You said it. The database returns the user's various roles ... to the 
container, which also supplies the request from whence isUserInRole comes.

HTH, Ted.

Dave Yutzy wrote:

I’ve been wracking the web to try and find out how to use the 
“request.isUserInRole()” functionality.

I understand how to setup the web.xml as well as the  tag in 
the struts config, but where would I actually “assign” the value of 
the user’s role?

So, if I have a custom login page and I auth. against a DB that 
returns the user’s various roles, how to I get those values into 
“” so that they can be read by the request.isUserInRole() call?

Anything you can do to point me in the right direction is greatly 
appreciated!




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


Re: How to set action path from Action.

2003-12-09 Thread Ted Husted
The different entry points should each be represented by their own 
ActionForwards. The Action class decides to forward the user to 
"science" or "biology". The ActionForward supplies the page and directory.

Generally, it is helpful to think of the ActionForwards as boxes on a 
flowchart. The Action class encapsulates the logic that decides it is 
time to forward to this box or that box. The directory and pages are 
implmentation details. The focal point is the *logical* names of the 
ActionForward, not the paths they encapsulate.

HTH, Ted.

Antony Paul wrote:
Hi,
After user login based on the dept of user user has to forwarded to
pages in different directories. How to do it ?. There are 5 departments.
This directory and page to be used in other parts to identify the home page
and directory of user so at other times user can be redirected. Putting a
ForwardAction in struts-config.xml which accepts and checks a single
parameter(Home) is possible ? Or set the path of a global forward at
runtime. I am new to Struts. Other options are
1. Write another action class which takes this parameter and based on the
user dept got from session invoke corresponding ForwardAction. This action
is reached through a global forward.
2. Use modules. I dont know what is it. Is it possible to have same named
ForwardAction in different modules ?.
rgds
Antony Paul.
-
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]


Re: Disadvantages of Struts?

2003-12-04 Thread Ted Husted
Yes, we should be passing an API context object instead of tucking 
things away here and there in the various contexts. We started work on 
one during the 1.1 march, but it was sidetracked by the module 
initiative. At this point, it will probably be slated for Stuts 2.0.

The other questions speak to whether you want to take a declarative 
approach to writing a web application. If you are writing a small 
application, the strategy of using XML configurations to deploy object 
graphs can be more trouble than it's worth. But if you are writing a 
larger application, most developers believe it is much better than the 
alternatives. (Been there, done that.) Of course, your mileage may vary.

There are several other web application frameworks available, most of 
which are tracked by the wafer project.

Choosing a framework is like choosing shoes. You really need to try them 
on for yourself to be sure.

Like most software products, Struts is far from perfect. But, like Java 
itself, for complex enterprise applications, many developers find it's 
the best alternative available today. Neither Struts nor Java is the 
best choice for all applications and all teams, but most people do find 
that it is a good choice for larger applications that need to be 
maintained and improved over time.

If there is a disadvantage to using Struts, it's that the underlying 
design is so darn useful that people try to use it as an application 
framework rather than a WEB application framework. Many teams invest 
*way* too much business logic in ActionForms and Actions. Why? Because 
most large application do need to utilize the Context and Command 
patterns. But because they don't have a distinct business framework, 
people usurp the Struts classes.

The Chain of Responsibility package in the Commons Sandbox is a first 
step toward creating a business layer framework. Webwork is doing 
something similiar with their xwork package.

-Ted.

Robert H. Tran wrote:
I am not sure that is true. Struts seems to lack of an API. IMO, there are
more required configurations than necessary. Take Action for example, to
write an Action, one has to paddle back and forth between the code and the
configuration. It is like an executable having to configure each of its
dlls. The visibility of the mappings is nice to have but the mappings can
be generated after the fact as in a debugging view. When the application is
finished, configurations become static. But since configurations are
required, they will be like loose ends of the application. Another issue:
how can one componentize his code and deploy it in a self-contained plug-in,
as with Eclipse? Please forgive my novice.
- Robert.

- Original Message - 
From: "Rick Hightower" <[EMAIL PROTECTED]>
To: "'Struts Developers List'" <[EMAIL PROTECTED]>
Sent: Wednesday, December 03, 2003 6:24 PM
Subject: RE: Disadvantages of Struts?



Don't be silly. Struts is perfect.

-Original Message-
From: Robert H. Tran [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 03, 2003 2:10 PM
To: Struts Developers List
Subject: Disadvantages of Struts?
I just wonder if Struts comes with any significant drawback. I mean not in
terms of when to use Struts and when not to use it necessarily, but more
in

the line of anyone's wishes that it had been better. Any advice is very
appreciated.


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


Re: Dynamic assignment of tiles

2003-12-03 Thread Ted Husted
The XMLs files are just used to generate an object graph. If you want to 
  change definitions dynamically, you'd want to look at changing the 
object graph rather than the XML script.

Though, dynamic content is not usually dependant on the Tiles definition 
itself. Typically, dynamic content is passed through the request and 
then merged into the server page.

If you are talking about adding additional tiles to a list at runtime, I 
believe Cedric describes some techniques for that in his advanced Tiles 
document.

http://www.lifl.fr/~dumoulin/tiles/tilesAdvancedFeatures.pdf

Essentially, you might be talking about creating a profile and then 
using that profile to create the list of tiles to render.

Meanwhile, no this isn't a DEV topic, and yes, you should be posting 
items like this to the USER list. DEV is for features that don't exist 
yet :)

-Ted.

Paul-J Woodward wrote:
Dear All,

I am working on an intranet website using struts/tiles. Due to server 
restrictions write access is not allowed to the disk from which content is 

served. In order to update/add to the content of the website dynamically I 

need to change the tileDefinitions.xml file, which is obviously not 
possible.

My only solution so far is to write my own version of the 
org.apache.struts.tiles.xmlDefinition package to access a database instead 

- essentially create a TilesDefinitionFactory which reads the definitions 
from a database.

I was wondering if anyone had any suggestions or alternatives?

Paul

PS Apologies for the repost - on 2nd thoughts this seems far more 
dev-oriented than most posts on users list.


Global Equity Derivatives Technology
Deutsche Bank [/]
Office  +44 (0)20 754 55458
Mobile +44 (0)7736 299483
Fax  +44 (0)20 7547 2752

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


Re: Where I can perform global tasks for application ?

2003-11-29 Thread Ted Husted
There's nothing wrong with using a filter, if that works for you.

Within the Struts framework, you can either extend the RequestProcessor 
or use a base Action.

Extending the RequestProcessor ensures that the task will be performed 
for each request, but some developers shy away from extending the 
RequestProcessor.

With a base Action, you are not guaranteed that the task will be 
performed unless each Action you use extends the base Action. The usual 
approach is to define your own version of the execute signature and mark 
it abstract. You then put whatever you need to do each time in the base 
execute signature and that one call your version when it's ready.

ActionForward myExecute(...) throws ...;

ActionForward execute(...) throws ... {

	ActionForward forward = doMyStuff(...);

	if (forward!=null) return forward;

	return execute(...);

}

For access and authorization checks, a good approach is to use JAAS and 
the processRoles property of the ActionMapping. Alternatively, you can 
extend the RequestProcessor to handle your own login code.

HTH, Ted.

lis wrote:
Hello

Where I can perform global tasks for application ?
I mean: some user specific configure tasks for example or check for
user is signin in.
I do it via Filter Servlet now,
but I think exists other method on the MVC framework for this job.
In other words, how I can add some task, which Struts controller will
perform for me for every http request.
--
Ted Husted,
  Junit in Action  - <http://www.manning.com/massol/>,
  Struts in Action - <http://husted.com/struts/book.html>,
  JSP Site Design  - <http://www.amazon.com/exec/obidos/ISBN=1861005512>.


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


Re: [FRIDAY] YA Stuts In Action / JUnit in Action Trivia Quiz

2003-11-28 Thread Ted Husted
Not to worry. So now it's a raffle :)

Andrew Hill wrote:
How about a new question for those of us who didnt get our answer in before
the result was prematurely revealed. (ie anyone who answered before Edgars
post is still in the running but anyone after (like me :-< ) has to answer a
new question)???


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


Re: [FRIDAY] YA Stuts In Action / JUnit in Action Trivia Quiz

2003-11-28 Thread Ted Husted
Ellison wrote the Star Trek episode that featured Joan Collins - 
entitled "City on the Edge of Forever", I believe.

Of course, many people would argue whether Ellison is Science Fictoin or 
 speculative fiction. Mainly short stories, so it's an easy commitment 
for the impatient reader. :)

Edgar P Dollin wrote:
1) Computing Machinery and Intelligence
2) Alan M. Turing
Bonus I Have No Mouth and I Must Scream
Edgar

PS, never read any Turing, but now I understand his influence.  Still
haven't read an Ellison, my patience with Science Fiction left after 30
years of Trek.


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


Re: Chain - not comatible

2003-11-28 Thread Ted Husted
Vic Cekvenich wrote:
(I am still just looking at examples.. still not sure how to write a 
"hello world" chain)
There are two distinct things going on.

Commons Chain is a general-purpose implementation of the Chain of 
Responsibility pattern. It could be used by any Java application, 
library, or framework that needed to implement a Chain of Responsibility.

Once likely suspect for a Chain of Responsibility is the Struts 
RequestProcessor. So, as a proof of concept, we're working on a Struts 
Chain RequestProcessor. The goal here is to be able to plug it into 
Struts like any other RequestProcessor, without any Struts API changes. 
Then, at some point, we'd be likely to make Struts-Chain the default 
RequestProcessor, since it is more extensible than the 1.1 version.

To use Commons Chain in an application, you create a Context and pass it 
to a Command. The Command can then do whatever you like, including 
adding a "hello world" entry to the Context. The Context is then 
returned the caller.

In a web application, the context could simply be added to the request 
context, or used to populate an ActionForm or some other JavaBean.

In the web package of Chain, there is a generic Servlet and a generic 
Listener class that can be used to load a Catalog of Commands into 
application-scope. Then, all the Action has to do is lookup a given 
Command Chain in the Catalog, invoke it with the desired context, and 
place the result in request or session scope. Another approach would be 
to use the ServletWebContext, so that any changes the Command makes to 
the Context are reflected in request scope.

But, right now, both Struts-Chain and Commons-Chain are in the sandbox, 
mainly because we haven't finished doing the hello world examples :)

-Ted.

--
Ted Husted,
  Junit in Action  - <http://www.manning.com/massol/>,
  Struts in Action - <http://husted.com/struts/book.html>,
  JSP Site Design  - <http://www.amazon.com/exec/obidos/ISBN=1861005512>.


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


[FRIDAY] YA Stuts In Action / JUnit in Action Trivia Quiz

2003-11-26 Thread Ted Husted
Last time, we asked contestants to identify the cartoonist responsible
for this gem:


Tour of Accounting:

"Over here we have our random number generator."

"NINE NINE NINE NINE NINE NINE"

"Are you sure that's random?"

"That's the problem with randomness: You can never be sure."



The answer, of course, is: Scott Adams, born June 8, 1957, who launched
the Dilbert strip in 1989.
From the several correct responses, we arbitrarily selected

  BECKY L. NORUM

as our winning contestant. (Becky, please send your surface mail address
to [EMAIL PROTECTED], and indicate whether you would like JUnit in
Action or Struts in Action)


NEXT:

In 1950, the journal MIND, a Quarterly Review of Psychology and
Philosophy, published a seminal paper regarding artificial intelligence.
1 What was the title of the paper?

2 Who was the author of the paper?

Any contestants correctly answering these two questions will qualify for
this week's drawing. As always, the correct answers are the ones that I
expect :)
** BONUS QUESTION **

3 The author of this paper used his initials for his first and middle
name. What Hugo-winning story by Harlan Ellison regarding artificial
intelligence features a protagonist whose name are these same two initials?
Any contestant correctly answering the bonus question will also qualify,
regardless. :) [I do love my Ellison!]


The contest will run until Thursday, December 4, 2003, 23:59:59, so
everyone has a chance to participate.
The lucky winner selected from the correct responses will receive their
choice of either a signed copy of Struts in Action *OR* JUnit in Action.
PLEASE be sure to reply to [EMAIL PROTECTED]

If you have an interesting science fiction or computer science question
that is hard, or at least fun, to google, please send it to
me. The first to suggest a question that we use also wins!
-Ted.

PLEASE be sure to reply to [EMAIL PROTECTED]

--
Ted Husted,
  Junit in Action  - <http://www.manning.com/massol/>,
  Struts in Action - <http://husted.com/struts/book.html>,
  JSP Site Design  - <http://www.amazon.com/exec/obidos/ISBN=1861005512>.




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


Re: ActionForms+struts-config

2003-11-26 Thread Ted Husted
The nomenclature here can be confusing. The "name" property doesn't 
refer to the Action or the ActionMapping, but to the FormBean "name" 
property. Earlier in the configuration file, there is a form-beans 
section, and a form-bean element with the name "MyActionForm". This is 
the class to which the ActionMapping.name property refers.

This is neither a good nor bad practice. Is the only practice. :)

HTH, Ted.

Jerald Powel wrote:
Hi,

  Does an ActionForm belong in the struts-config.xml mappings? ie:

 
 
Mine is placed here and functions quite well. But is has occurred to me this may be a bad pratcice, as it does not extend Action and is thefore not logically an Action? Or perhaps ActionForm extends Action? 

Also, for those using Struts Studio, my ActionForm is in the struts-config as described, and is thus visible in the 'diagram' pane. Is this recommended, or poor pratice?

Thanks for your help

J





-
Want to chat instantly with your online friends? Get the FREE Yahoo!Messenger
--
Ted Husted,
  Junit in Action  - <http://www.manning.com/massol/>,
  Struts in Action - <http://husted.com/struts/book.html>,
  JSP Site Design  - <http://www.amazon.com/exec/obidos/ISBN=1861005512>.


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


Re: ACtion Form within an ACtion

2003-11-25 Thread Ted Husted
It's possible, but it's messy, and not recommended.

It usually means that there is business logic trapped in the Action. 
Rather than call another action, extract that business logic into a 
separate class that anyone can call on demand.

The Actions are best used as *adapters* to your business logic layer. 
The first sign that an Action is no longer an adapter, but part of an 
API, is the yearning to call one Action from another. :)

A very excellent tool for building a business layer is the new Commons 
Chain package in the sandbox.

http://jakarta.apache.org/commons/sandbox/chain/

HTH, Ted.

Gurpreet Dhanoa wrote:
hi Dennis ,

Thanks for your prompted answer but in this case i'll be forwarding to
another action from one action.BUt i dont want to do that. I want to execute
perform method of Action2 in the perform method of ACtion1 then I want to
forward it to the JSP from the Action1 itself.
Is this something possible

Thanks
Gary


- Original Message -
From: "Hunziker Dennis" <[EMAIL PROTECTED]>
To: "'Struts Users Mailing List'" <[EMAIL PROTECTED]>
Sent: Tuesday, November 25, 2003 5:23 PM
Subject: RE: ACtion Form within an ACtion


Hi

Something like that (taken from the Struts example) should work.

private String page = "/action.do";
pageContext.forward(page);
Kind regards
Dennis Hunziker
-Original Message-
From: Gurpreet Dhanoa [mailto:[EMAIL PROTECTED]
Sent: Dienstag, 25. November 2003 12:47
To: Struts Users Mailing List
Subject: ACtion Form within an ACtion
HI All

Can anybody link me to the track of calling one Action within another
Action.
I have one Action File in which I want to call one more ACtion File and
then

I want to forward to the JSP

Can anybody Help

Thanks
gary




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

--
Ted Husted,
  Junit in Action  - <http://www.manning.com/massol/>,
  Struts in Action - <http://husted.com/struts/book.html>,
  JSP Site Design  - <http://www.amazon.com/exec/obidos/ISBN=1861005512>.


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


Re: [OT] Need Free database

2003-11-25 Thread Ted Husted
Jeff Kyser wrote:
> do a little homework, buddy. that's a bogus question
> that is hardly excused by an [OT] prefix.
>
> -jeff
Oh, I don't know. The link to Firebird was pretty interesting to me. 
(Thanks Paul!) And the subject line is complete enough that it would be 
easy enough to ignore.

As to doing the research, here's a link if anyone is still interested.

http://dmoz.org/Computers/Software/Databases/

Since most of write applications that hook up to databases, a Wiki page 
 on the open source DBMS options might be good to have.

http://nagoya.apache.org/wiki/apachewiki.cgi?StrutsProjectPages

Perhaps Vishal might start one as a summary of this thread. :)

-Ted.

Jeff Kyser wrote:
do a little homework, buddy. that's a bogus question
that is hardly excused by an [OT] prefix.
-jeff

On Tuesday, November 25, 2003, at 06:04  AM, Agashivala, Vishal wrote:

Hi All,
Can any buddy suggest me Database which is free and has JDBC driver. If
possible get me the URL.
Regards,
Vishal Agashivala
-
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]

--
Ted Husted,
  Junit in Action  - <http://www.manning.com/massol/>,
  Struts in Action - <http://husted.com/struts/book.html>,
  JSP Site Design  - <http://www.amazon.com/exec/obidos/ISBN=1861005512>.


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


Re: Lazy questions on this list

2003-11-20 Thread Ted Husted
Paul McCulloch wrote:
> Is it my imagination or are the number of downright lazy requests to
> this list getting worse?
>
> If the only replies any lazy questions ever got was
> http://www.catb.org/~esr/faqs/smart-questions.html then maybe people
> would get the point. Has anyone got any other ideas about how we can
> educe the amount of lazy and totally off-topic posts to the list?
Welcome to the darkside of being the world's most popular web 
application framework. :)

IMHO, the very best way to handle easy questions is with a link to the 
answer.



> Where can I download Struts?

http://jakarta.apache.org/struts/acquiring.html

HTH, Ted.



> Struts setup and IDE?

http://jakarta.apache.org/struts/userGuide/installation.html

http://nagoya.apache.org/wiki/apachewiki.cgi?StrutsMyFavoriteIDE

HTH, Ted.

-

Simple, efficient, and to the point. Once you've pointed them at once 
answers, perhaps they can start finding the others on their own :)

If the answer doesn't exist as a link, a very good approach would be to 
create a wiki page and then link to that. Like bugzilla, the wiki is 
open to all comers. You don't have to be a Committer to post.

http://nagoya.apache.org/wiki/apachewiki.cgi?StrutsProjectPages

For questions not directly related to Struts, one of the links on the 
preface page will usually be on task:

http://jakarta.apache.org/struts/userGuide/preface.html

HTH, Ted.



--
Ted Husted,
  Junit in Action  - <http://www.manning.com/massol/>,
  Struts in Action - <http://husted.com/struts/book.html>,
  JSP Site Design  - <http://www.amazon.com/exec/obidos/ISBN=1861005512>.


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


Re: Struts ActionForm Question

2003-11-20 Thread Ted Husted
This is really a question for the USER list. If there is any followup, 
please continue the thread there.

But, the configuration isn't different from any web application. The 
compiled classes can be under WEB-INF/classes or in a JAR under 
WEB-INF/lib. The Struts JARs (including the Commons and Jakarta ones) 
would go under WEB-INF/lib. Typically, people put their own class files 
under classes, but some people JAR those as well.

HTH, Ted.

Divya B Sridhar wrote:
Hi all,
I have a question.
I am new into struts and right now doing a small sample page for the
same.
Right now, I have a form which has a  textbox which can take a stock
code as input - index.jsp
Here it goes:
<%@ page language="java" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
 

 
  BAT struts application
 
 
  
  
    
  
  
   

 

   
  
  
    
  
  
 
  
   

 Symbol:
 


 

   
  
 

 
Now, I have a class LookupForm.java. This extends ActionForm. Here it
goes.
 
package batclass;
 
import javax.servlet.http.HttpServletRequest;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
 
public class LookupForm extends ActionForm
{
 private String symbol = null;
 
 public String getSymbol()
 {
  return(symbol);
 }
 
 public void setSymbol(String symbol)
 {
  this.symbol = symbol;
 }
 
 public void reset(ActionMapping mapping, HttpServletRequest request)
 {
  this.symbol = null;
 }
}
 
Now, I have installed tomcat 4.1.24 and struts 1.1; set CATALINA_HOME
and JAVA_HOME environment variables. Also, since I use
httpServletRequest, I have set the classpath for servlet.jar as well.
Now when I compile the LookupForm.java, it gives me "cannot resolve
symbol" for ActionForm and ActionMapping classes(made them bold in the
class above). What other configuration/setting classpath etc is required
to overcome this? I mean, what other configuration did I miss in order
that I can get this class compile successfully.
Thanks in advance,
Divya.

--
Ted Husted,
  Junit in Action  - <http://www.manning.com/massol/>,
  Struts in Action - <http://husted.com/struts/book.html>,
  JSP Site Design  - <http://www.amazon.com/exec/obidos/ISBN=1861005512>.


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


Re: Struts and CMS

2003-11-19 Thread Ted Husted
I've heard that Vignette uses Struts.

Eric Dahnke wrote:
Does anyone know of a CMS system either commercial or OSS that works w/
Struts?
Anyone have any objective comments they'd like to share about good
experiences they've had with CMS systems out there. 

Thx
--
Ted Husted,
  Junit in Action  - <http://www.manning.com/massol/>,
  Struts in Action - <http://husted.com/struts/book.html>,
  JSP Site Design  - <http://www.amazon.com/exec/obidos/ISBN=1861005512>.


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


Re: Which framework to choose?

2003-11-18 Thread Ted Husted
Personally, I consider MVC frameworks to be commodities. It doesn't 
really matter which you use use. The real point of the exercise is to 
treat web applications like applications, rather than some throwaway hack.

Which framework is best for a particular project is going to depend on 
the project, and more importantly, the people working on the project. 
Most any tool can do the job, so long as the people using the tool 
*want* to make it so.

Right now, I'm using Struts on some projects and Maverick on others. 
It's all the same to me. I push as much of the work back to the business 
layer as possible, so the frameworks boil down to adapters. The question 
to ask is not "am I using the 'right' framework now", but "how easy 
would it be to switch to another framework later".

No one can make tomorrow's decision today. All you can do is try and 
design applications that can adapt to tomorrow when it comes.

Right now, wafer is tracking over twenty different Java frameworks.

http://www.waferproject.org/index.html

Each of which have their own special talents. JPublish, for example, is 
great for content management. Sofia has dynamite Dreamweaver support. 
And so forth.

Of course, the best part is that these frameworks are not mutually 
exclusive. It all comes down to HTTP. You can have as many of these 
frameworks working in a web application as you like.

It's not an election of remedies, it's an embarrassment of riches.

-Ted.

[EMAIL PROTECTED] wrote:
Hi all,

Altough this might not be the right place to ask, but I'm just curious.

Recently I see a lot of different frameworks which pretty much promise the 
same functionality as the Struts framework.

For instance I found:

struts
webwork
Spring
etc...
Which one is the best? I have been using Struts for some time now... But 
maybe some other framework has more future then Struts.
I would like to hear your opionions...

Thanks,

Regards,

Harm de Laat
Informatiefabriek
The Netherlands


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

--
Ted Husted,
  Junit in Action  - <http://www.manning.com/massol/>,
  Struts in Action - <http://husted.com/struts/book.html>,
  JSP Site Design  - <http://www.amazon.com/exec/obidos/ISBN=1861005512>.


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


Re: [FRIDAY] YA Stuts In Action / JUnit in Action Trivia Quiz

2003-11-17 Thread Ted Husted
Last time, we asked contestants to finish this quote

  Tests are the Programmer's Stone ...

and identifier the writer

Of course, several contestants completed Kent Beck's quote to be

"Tests are the Programmer's Stone, transmuting fear into boredom."

Of these, our arbitrarily selected winner is ...

  Matt McMahon

(Matt, please send me your mailing address and which title you would like.)

NEXT:

Once again, we are offering your choice of Struts in Action or JUnit in 
Action to one lucky contestant who correctly answers our quiz.

OK, here's another gimme:

For this storyline:



Tour of Accounting:

"Over here we have our random number generator."

"NINE NINE NINE NINE NINE NINE"

"Are you sure that's random?"

"That's the problem with randomness: You can never be sure."

-

To play, name

* The Cartoonist
* The cartoonist's birthdate, and
* The year the comic strip was launched
Of course, everything here can be googled, since apparently anything of 
interest can now be googled :)

The winner will be selected at random (or at least arbitrarily) from the
correct responses. [The correct response being the one I expected =:)]
The contest will run until Friday, November 21, 2003, 23:59:59, so
everyone has a chance to participate.
The lucky winner selected from the correct responses will receive their
choice of either a signed copy of Struts in Action *OR* JUnit in Action.
PLEASE be sure to reply to [EMAIL PROTECTED]

If you have an interesting science fiction or computer science quote
that is hard to google (or at least not *too* easy), please send it to
me. The first to suggest a
quote that we use also wins!
-Ted.

PLEASE be sure to reply to [EMAIL PROTECTED]



--
Ted Husted,
  Junit in Action  - <http://www.manning.com/massol/>,
  Struts in Action - <http://husted.com/struts/book.html>,
  JSP Site Design  - <http://www.amazon.com/exec/obidos/ISBN=1861005512>.


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


Re: data source in struts-config

2003-11-14 Thread Ted Husted
There's a write-up here,

http://jakarta.apache.org/struts/faqs/database.html

But we do recommend that your container's data-source be used instead. 
Most data access packages, like iBATIS, Hibernate, and OJB, provide 
their own mechanisms, which do not need to be exposed to Struts.

HTH, Ted.

David Liles wrote:

Please excuse my ignorance... but I haven't been able to find an example that show how the  tag is used in struts

I've looked at several of the examples and I don't see where the properties that are set in the xml file get referenced.

How are these pulled into a servlet to be used?

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

--
Ted Husted,
  Junit in Action  - <http://www.manning.com/massol/>,
  Struts in Action - <http://husted.com/struts/book.html>,
  JSP Site Design  - <http://www.amazon.com/exec/obidos/ISBN=1861005512>.


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


Re: Sturts

2003-11-14 Thread Ted Husted
That depends on what you mean by call.

The general model is to invoke an  Action class *before* displaying a 
server page. The Action puts resources in the request scope for the page 
to use. The page then displays the ready-made resources (e.g. JavaBeans) 
without knowing from whence they came. All the page knows is that the 
resources has a particular name and is available in one of the scopes.

If you mean link to an action URI, then sure. To the server pages, the 
Struts actions (this.do, that.do), look like any other context-relative 
URI. As mentioned, you can use the  tag to 
do this sort of thing.

The thing to keep in mind is that a Struts web application is first and 
foremost a web application. Struts exposes everything through standard 
URIs or through the servlet scopes, as do all Java web applications.

HTH, Ted.

Gurpreet Dhanoa wrote:
HI 
is there any way to call a action within an JSP file without using Submit button and any other html:form element

I want to call a action with in a logic:iterate which is further containing one more logic:iterate 



--
Ted Husted,
  Junit in Action  - <http://www.manning.com/massol/>,
  Struts in Action - <http://husted.com/struts/book.html>,
  JSP Site Design  - <http://www.amazon.com/exec/obidos/ISBN=1861005512>.


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


Re: [FRIDAY] YA Stuts In Action / JUnit in Action Trivia Quiz

2003-11-10 Thread Ted Husted
Since JUnit on Action is hot off the presses, this time we'll be 
offering the winner the choice of a signed copy of SIA *OR* JUnit in 
Action.

(Just my signature in both cases, I'm afraid, logistics prevent 
circulating these to my many co-authors.)

But, first, last time we offered up a "holiday treat" question. We asked 
contestants to name the famous science fiction series whose various 
peoples and institutions were made to say:



"Truth is a chameleon."

"All persons are contained within a single individual, just as all time
is in a moment, and the entire universe is in a grain of sand."
"One observes the survivors, and learns from them."



to which many respondents correctly answered "Dune".

The winning reply, selected arbitrarily, is:

JEREMY APPEL

(Jeremy, please send your surface mail address to [EMAIL PROTECTED])

Thanks to the many people who took the time to play.

NEXT:

In honor of JUnit in Action hitting the streets, this time we ask 
contestants to finish this quote and identifier the writer:



Tests are the Programmer's Stone ...



PLEASE be sure to reply to [EMAIL PROTECTED], and to both

* finish the quote, and
* identify the author.
The winner will be selected at random (or at least arbitrarily) from the
correct responses. [The correct response being the one I expected =:)]
The contest will run until Friday, November 14, 2003, 23:59:59, so
everyone has a chance to participate.
The lucky winner selected from the correct responses will receive their 
choice of either a signed copy of Struts in Action *OR* JUnit in Action.

PLEASE be sure to reply to [EMAIL PROTECTED]

If you have an interesting science fiction or computer science quote
that is hard to google (or at least not *too* easy), please send it to 
me. The first to suggest a
quote that we use also wins!

-Ted.

PLEASE be sure to reply to [EMAIL PROTECTED]



--
Ted Husted,
  Junit in Action  - <http://www.manning.com/massol/>,
  Struts in Action - <http://husted.com/struts/book.html>,
  JSP Site Design  - <http://www.amazon.com/exec/obidos/ISBN=1861005512>.


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


[OT] [ANNOUNCE] JUnit in Action now available

2003-11-10 Thread Ted Husted
A new book offering, JUnit in Action, by Jakarta regulars Vincent Massol 
and Ted Husted, is now available for purchase.

Developers in the know are switching to a new testing strategy - unit 
testing - which interleaves coding and testing in an integrated way. 
This has proven to be a powerful combination that results in better 
designed software with fewer defects and faster delivery cycles.

JUnit in Action shows you how to benefit from this strategy using the 
popular open source testing framework, JUnit. It's a no fluff discussion 
of unit testing techniques and best practices. It gives examples of 
tough situations such as how to unit test EJBs, database applications, 
JSPs and Taglibs. It discusses unit testing of J2EE applications, and 
shows how to test in automated builds.
What's Inside

* Testing in isolation with mock objects
* In-container testing with Cactus
* Automated builds with Ant and Maven
* Unit testing from within Eclipse
* Test Driven Development principles
* Unit testing
  o Java apps
  o Servlets
  o JSP
  o Taglibs
  o Filters
  o EJB
  o DB apps
While the book does not cover Struts-only testing, the techniques taught 
here are applicable to any web application.

For more, visit http://manning.com/massol/

--
Ted Husted,
  Junit in Action  - <http://www.manning.com/massol/>,
  Struts in Action - <http://husted.com/struts/book.html>,
  JSP Site Design  - <http://www.amazon.com/exec/obidos/ISBN=1861005512>.


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


Re: Struts Best Practices.. Paper for Review pls

2003-11-10 Thread Ted Husted
The document is really closer to a cookbook. Hibernate has a very good 
example of a "best practices" document.

http://www.hibernate.org/hib_docs/reference/html/best-practices.html

-Ted.

Puneet Agarwal wrote:
Hi Adam,
Yup, it was originally a pdf file and I converted it to HTML, have fixed it
now.
We took those as best practices from user's mailing list and within TCS
Delhi,
however if the people don't accept those as best practices, I shall be ready
to amend this.
I am planning to update this paper with newer features like Struts modular
approach and how to and few more,
very soon. I shall sincerely consider your suggestions.
Thanks & Regards
Puneet
- Original Message -
From: "Adam Hardy" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Sunday, November 09, 2003 3:51 PM
Subject: Re: Struts Best Practices.. Paper for Review pls


Hi Puneet, I think you need to check your HTML in Mozilla. Under
'Designing screens for variable number of fields' Mozilla shows no code
and some huge blank spaces between paragraphs.
Otherwise it's a fine document. But I think it's always a difficult call
to differentiate between describing 'best practices' and documenting
your favourite features. ;)
You might want to talk more about MVC, which is certainly a lynch pin
for best practices in struts, IMHO.
Adam

On 11/08/2003 09:00 AM Ted Husted wrote:

I started section in the wiki for a Struts Catalog of Design Patterns
and Practices.
http://nagoya.apache.org/wiki/apachewiki.cgi?StrutsCatalog

Please feel free to add your entries here, if you like. People can then
add comments as to how they feel about the various practices.
-Ted.

Puneet Agarwal wrote:


Hi All,
I wrote a paper on Struts Best Practices...if you think it can be
usefull

to someone...Please review and give your valuable inputs...

Check the paper at

http://puneetdelhi.tripod.com

Regards,
Puneet Agarwal


--
struts 1.1 + tomcat 5.0.12 + java 1.4.2
Linux 2.4.20 RH9
-
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]

--
Ted Husted,
  Junit in Action  - <http://www.manning.com/massol/>,
  Struts in Action - <http://husted.com/struts/book.html>,
  JSP Site Design  - <http://www.amazon.com/exec/obidos/ISBN=1861005512>.


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


Re: Struts Best Practices.. Paper for Review pls

2003-11-08 Thread Ted Husted
I started section in the wiki for a Struts Catalog of Design Patterns 
and Practices.

http://nagoya.apache.org/wiki/apachewiki.cgi?StrutsCatalog

Please feel free to add your entries here, if you like. People can then 
add comments as to how they feel about the various practices.

-Ted.

Puneet Agarwal wrote:

Hi All,
I wrote a paper on Struts Best Practices...if you think it can be usefull
to someone...Please review and give your valuable inputs...
Check the paper at

http://puneetdelhi.tripod.com

Regards,
Puneet Agarwal


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


Re: [ANNOUNCE] Visual Tags for Struts 2004 Released

2003-11-05 Thread Ted Husted
Vic Cekvenich wrote:
If  anyone redevelops and old app, they might as well upgrade to a new 
container, not like we have to upgrade each workstation in the 
Client/Server days.  Take advantage of EL, other features.
It's very easy for us to say things like that, but some of my clients, 
especially very large corporations, have to upgrade many, many servers. 
Everyone just can't download the latest Tomcat or Resin and pop it up. 
Sad, but very, very true.

Meanwhile, there are other people in our community who still seem to 
prefer the original taglibs. While the JSTL is a good idea, the original 
JSP taglib spec is still a standard too.

Sadly, none of the current Committers are using the original taglibs in 
their own work, and so we are actively looking for a taglib maintainer.

http://nagoya.apache.org/wiki/apachewiki.cgi?StrutsJobJar

-Ted.

--
Ted Husted,
  Junit in Action  - <http://www.manning.com/massol/>,
  Struts in Action - <http://husted.com/struts/book.html>,
  JSP Site Design  - <http://www.amazon.com/exec/obidos/ISBN=1861005512>.


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


Re: [ANNOUNCE] Visual Tags for Struts 2004 Released

2003-11-05 Thread Ted Husted
If your container supports 2.3, preferring JSTL is a good idea. But many 
teams still don't have that option.

-Ted.

Vic Cekvenich wrote:
Would this support JSTL tags?
In essence, if you can deal with tlds, it should.
Bean and logic should not be used, JSTL should be used instead.


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


Re: Struts Best Practices

2003-11-05 Thread Ted Husted
Manish Singla wrote:
I am looking for resources (links/books/suggestions) for Struts best 
practices.

We are migrating a huge WEB app from (40% struts & 60% in 4 other MVC 
frameworks) to 100% struts.
We want to document/standardize as our team is at 5 different geographic 
locations.
Once upon a time, I did assemble a few common practices here:

http://husted.com/struts/catalog.html

But I wouldn't call all of these *best* practices. The only one that 
stands out to me as a true Best Practice would be

* Link only to ActionMappings

I should probably port this page to the Wiki, to make it easier to grow 
and maintain. There are quite a few things that arose in the 1.1 
release, like use the "action" property in links to refer to 
ActionMappings.

-Ted.



--
Ted Husted,
  Junit in Action  - <http://www.manning.com/massol/>,
  Struts in Action - <http://husted.com/struts/book.html>,
  JSP Site Design  - <http://www.amazon.com/exec/obidos/ISBN=1861005512>.
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


Re: Integration of Business Processes in Web-portals

2003-11-03 Thread Ted Husted
A very good tool for encapsulating and reusing logic is the new Commons 
Chain package.

http://jakarta.apache.org/commons/sandbox/chain/

You can call Chain from your Struts Actions to invoke the business 
logic. The Actions then put the result into the request or session 
contexts, so that the data can be used by the server pages.

HTH, Ted.

Dominik Stöttner wrote:
Hi,

I am working on a project which aims to integrate a business process in a content based web portal. On that subject it is very important to encapsulate the necessary business logic for reuse in other pages. So the same business process should be available on different pages. Furthermore it should be possible to arrange a number of independent pieces (e.g. content based ones and some that include business processes) on the same page. Hence my question: Are struts and tiles appropriate techniques to achieve that aim or are there others that fit better?

thanks in advance!!

dominik

--
Ted Husted,
  Junit in Action  - <http://www.manning.com/massol/>,
  Struts in Action - <http://husted.com/struts/book.html>,
  JSP Site Design  - <http://www.amazon.com/exec/obidos/ISBN=1861005512>.


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


Re: Unit Test Actions

2003-10-31 Thread Ted Husted
Steven Woody wrote:
I skimmed through the code, but dont get a concrete ideal.  Does ProcessAction.java is a part of 'Scaffold'?  Would you please point me to a full documentation about the project?  Thanks!
There's some coverage in the book, but it's really not documented 
outside of the source code.


Ok, I'm abou to use WebTest.   And, if not so boring I still want to ask, how do you compare WebTest with Fitness?
Fitness is a general-purpose testing framework, with a special emphasis 
on acceptance testing. WebTest is focused on testing web sites. Period. 
A WebTest could be used as an client-level acceptance test, since it 
tests what the client's care about: the end result. But, a WebTest is 
not a replacement for a programmer's unit test. We need to catch most 
problems before they ever trickle down to the presentation.

Unlike FitNess and JUnit, WebTest is more like an end-user application 
than an engineering framework. The elements you use are already defined. 
You don't run around creating Java subclasses. You just write the XML 
script and then keep it updated. But since it's just a script, it's easy 
to update.

-Ted.



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


Re: Unit Test Actions

2003-10-30 Thread Ted Husted
Steven Woody wrote:
Ted,

1)
How do you implement the Action Adapter?  Derived from Action and make it composite a 
substential Action Adaptee object which know nothing about web stuff? If this is the 
case, I want to know what the Action Adaptee's execute() return?  Actually, I want to 
know if or not the Action Adaptee get knowledge of forwarding.  Thanks.
There's this, for example.

http://cvs.apache.org/viewcvs/jakarta-struts/contrib/scaffold/src/java/org/apache/struts/scaffold/ProcessAction.java?rev=HEAD&content-type=text/vnd.viewcvs-markup

Though as adapters go, the ProcessAction is rather extreme. :)

Basically, you bundle everything into a transfer object and hand that 
down to the business layer. Then the business layer hands another 
transfer object back.

The (relatively new) Commons Chain Context is an ideal transfer object 
for this sort of thing.

http://jakarta.apache.org/commons/sandbox/chain/


2)
I think I like the WebTest.  Before use it, I still want to get some opinion from you 
about how do you compare WebTest and HttpTest.  Thanks in advance.
HttpUnit is a good thing if you have code based on the http package to 
test. I have very little of that of my own now-a-days, so HttpUnit isn't 
something I feel a need to use.

WebTest exercises the actual pages. You can start using it from page one 
of your first storyboard. (Matter of a fact, started a new one today, 
and first thing I did was setup the WebTest.) Since it's run by an XML 
script, it's very easy to keep the WebTest up-to-date. And, it's 
something anyone can do, not just the Java engineers.

HTH, Ted.



--
Ted Husted,
  Junit in Action  - <http://www.manning.com/massol/>,
  Struts in Action - <http://husted.com/struts/book.html>,
  JSP Site Design  - <http://www.amazon.com/exec/obidos/ISBN=1861005512>.


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


Re: "A Walking Tour of the Struts Example Application" does not match the code!

2003-10-30 Thread Ted Husted
Steven Woody wrote:
> I'm new to Struts, so a begining example is very important for me. 
Is this a version conflict?  Where is the correct tour for the 
MailReader example?

I originally wrote the tour when I was new to Struts and trying to 
figure out the example.

Learning Struts by updating the tour document might be an excellent 
exercise for someone who's truly interested in figuring out how things 
work. :)

-Ted.


Hi, list

The "A Walking Tour of the Struts Example Application" (MailReader example) seems not to match the code come with release 1.1.   A few minutes after I began to read the document, I got:

--- cut ---
If you check the application's web.xml, you will see how these objects are loaded. The 
message resource is loaded by the application parameter to the ActionServlet. When the 
ActionServlet initializes, it parses the ApplicationResources.properties in the 
package folder into the default message resource. If you change a message in the 
resource, and then reload the application, it will appear throughout the application.
--- end ---
But in the web.xml, I dont find anything to loading those mentioned objects and message resource.  They are loaded in the strut-config.xml in fact.

I'm new to Struts, so a begining example is very important for me.  Is this a version conflict?  Where is the correct tour for the MailReader example?

--
Steven Woody
[EMAIL PROTECTED]
--
Ted Husted,
  Junit in Action  - <http://www.manning.com/massol/>,
  Struts in Action - <http://husted.com/struts/book.html>,
  JSP Site Design  - <http://www.amazon.com/exec/obidos/ISBN=1861005512>.


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


Re: Planning Struts Application Development

2003-10-29 Thread Ted Husted
[EMAIL PROTECTED] wrote:
Hi
   I thought I might add a query about performance related issues when
reflection is used. This might be odd but many teams in my company have
started using Struts without ActionForms. They use Actions and pick up the
parameters from the request object.
   Are there any benchmarks that prove reflection doesn't impose a big
overhead ?
Well, published benchmarks are like bikinis. They seem to reveal a lot 
but keep the best bits under wraps. :) The best advice would be for you 
to cobble up the same workflow using ActionForms and then use JMeter to 
run your own benchmarks. That's the only way you will *know* whether 
it's a problem for you or not, and exactly how severe it is for *you* on 
*your* equipment. Mileage can vary depending on the underlying hardware 
platform and network configuration.

Anyway, here's a thread that speaks to your original question:

http://www.mail-archive.com/[EMAIL PROTECTED]/msg80042.html


   Secondly one team is facing problems with multiple master-detail
layers. We have used indexed properties for one level of master-detail .
What about multiple levels ?Any suggestions ?
I generally continue to nest detail within detail to whatever arbitrary 
layer is needed. Usually, the trick is to have a very clever JavaBean 
and rather stupid presentation code. Things like this get very hairy if 
you are trying to do too much on the page. Think in terms of a JavaBean 
that could be used to produce a plain-text, PDF, or HTML report, and 
then use tags to render the *JavaBean* in HTML, without knowing to much 
about the logic of the underlying report.

HTH, Ted.

--
Ted Husted,
  Junit in Action  - <http://www.manning.com/massol/>,
  Struts in Action - <http://husted.com/struts/book.html>,
  JSP Site Design  - <http://www.amazon.com/exec/obidos/ISBN=1861005512>.


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


Re: Unit Test Actions

2003-10-29 Thread Ted Husted
StrutsTestCase includes a set of mock classes (that we *really* should 
integrate into the core) that work without Cactus and another set that 
work with Cactus. The fork takes places at the highest level, so you can 
start with one and then switch to the other, if need be.

With StrutsTestCase, you can write some very fine-grained tests against 
the Struts configuration. I'm not aware of any other tool that works in 
the same way.

Though, in my own work now, I tend to write standard JUnit tests against 
the business layer, and then use Canoo WebTest 
<http://webtest.canoo.com/> against the web layer.

But, that's because my actions have devolved to adapters, and so there 
less and less to test at this level. Though, I do think we should be 
using StrutsTestCase to prove that the standard Actions work as expected.

The nice thing about WebTest is that it runs against the actual pages, 
and it is quite agile. It's driven by a XML document that any savvy 
person can maintain, including page designers. You have to have the 
server running, but it is a very light tool and the tests run quickly. 
No server-side configuration is required, and it's not Java or JSP 
specific. You can write Webtests against a HTML storyboard (or 
"wireframe"), so that you are test-driven from square one. Good stuff!

HTH, Ted.

Steven Woody wrote:
How does this compare to Cactus ?  To my understand,  it can test Actions w/o a container while Cactus can test Actions in-container.  Right?

----- Original Message - 
From: "Ted Husted" <[EMAIL PROTECTED]>
To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
Sent: Tuesday, October 28, 2003 5:12 PM
Subject: Re: Unit Test Actions

Steven Woody wrote:
> Can I unit test Action subclasses with JUnit without running of a
> Servlet container?
http://strutstestcase.sourceforge.net/


--
Ted Husted,
  Junit in Action  - <http://www.manning.com/massol/>,
  Struts in Action - <http://husted.com/struts/book.html>,
  JSP Site Design  - <http://www.amazon.com/exec/obidos/ISBN=1861005512>.


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


Re: Sell me on tiles revisited

2003-10-28 Thread Ted Husted
Sounds like a job for the Struts Wiki!

http://nagoya.apache.org/wiki/apachewiki.cgi?StrutsProjectPages

Frank Rizzo wrote:

Why should we use tiles as opposed to anything else? I am told that this question comes often, so the list below has been compiled from this mailing list archive and other published articles to consolidate the arguments for using tiles.  If you have experience with tiles, please add, modify, or subtract from this list with the goal of creating a list that people can use when evaluating whether to use tiles or not on their project. 
 
1) Inheritence. Why don't we just use the  tag or @include to include common page elements? tiles definitions support inheritence. If you have 60 jsps, you have @include header.jsp repeated in every jsp. Next, imagine a new requirement dictates that the menu should be moved from the right side to the left. You now have to change 60 jsps.  If your application uses tiles, you change only one jsp, all of your jsps inherit from this layout jsp. 
 
2) If you have a standard site with a common layout (header, footer, menu, bodycontent), tiles does what you want to do very cleanly, integrates with Struts very nicely, and is a standard solution that you don't have to develop or document, and that your team members may already have experience with or at least be more excited about learning than an in-house, one-off system since that experience will have more value in the marketplace.
 
3) Using jsp:include or @ include you cannot internationalize parameterized content very easily.
 
4) Tiles-defs.xml offers a central document to determine which jsps are used in which places. If the developers follow mvc properly, a new person new to the project can get a sense of site flow and structure by looking at only struts-config.xml and tiles-defs.xml
 
5) You can use a tiles controller rather than write a custom tag. This is especially useful for creating a tile such as Amazon's "books you've recently browsed". The tile can plug in to any page without considering the Struts action code for that URL.
 
6) Tiles scope offers another namespace where attribute names will not collide.



-
Do you Yahoo!?
Exclusive Video Premiere - Britney Spears
--
Ted Husted,
  Junit in Action  - <http://www.manning.com/massol/>,
  Struts in Action - <http://husted.com/struts/book.html>,
  JSP Site Design  - <http://www.amazon.com/exec/obidos/ISBN=1861005512>.


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


Re: Dynamic Text Boxes - Urgent .Pl help - Struts

2003-10-28 Thread Ted Husted
You can define an Array to catch multiple parameters of the same name.

http://husted.com/struts/tips/006.html

HTH, Ted.

[name withheld] wrote:
Hi Husted,
 
 
I Have  a Struts  jsp with with  some Dynamic text boxes.  I have 
array list that contain  data for these text boxes.I put this List in 
the request object in the action class.
 Here The problem is all text boxes names are same.
 
Example java code.
For (i=0;i
{

}
 
Actually I am doing this one by struts and Jstl for each.
Here Text field name is same for all. How Can I create those many 
setter/Getter methods without knowing.
Please let me know How to handle this with Jsp - form bean.
 
I really appriciate your help.
 
Thanks,


--
Ted Husted,
  Junit in Action  - <http://www.manning.com/massol/>,
  Struts in Action - <http://husted.com/struts/book.html>,
  JSP Site Design  - <http://www.amazon.com/exec/obidos/ISBN=1861005512>.


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


Re: How to find out all of pages (links) in a directory on website.

2003-10-28 Thread Ted Husted
At this point, we're definitely moving into Lucene territory.

http://jakarta.apache.org/lucene/docs/index.html

-T.

Dinh Nguyen wrote:

Hi Rajat/all,

The thing is, I need to detect which files and how many files, that contain word "Privacy", on a directory on a website.  
Assume that, http://www.xyz.com is a live site, and myfolder is one of the directories on the site (http://www.xyz.com/myfolder.html).  This folder contains some files that are privacy.  I don't know how many files are there, and I don't know which file that contains word "Privacy".  
I think that there are steps: 
1) Implement a small Java program/class that dectects if a certain word appears on a file or not.
2) Implement a smalll Java program/class that lists (and counts) all of the URLs/links (or/and sub-folders) that from a URL (given URL) has.  
I got step 1 done already and I am stuck at step #2.

I know that Sun has one of those examples, I downloaded it, compiled it, but it gave me errors at the line ==> ListlistMatches; 
http://developer.java.sun.com/developer/technicalArticles/ThirdParty/WebCrawler/#demo

I wasn't able to this compile.  I am not sure that if anyone ran into this problem before.

Thanks,
Dinh Nguyen
Rajat Pandit <[EMAIL PROTECTED]> wrote:
The solution also depends on the fact that you want to "explore" a
remote file or a local file. For local files, I belive using the DOM is
the best option to solve the problem. (see javascript for more info). 
-Original Message-
From: Dinh Nguyen [mailto:[EMAIL PROTECTED] 
Sent: Monday, October 27, 2003 8:30 PM
To: [EMAIL PROTECTED]
Subject: How to find out all of pages (links) in a directory on website.

Hi all,

I know that this is probably not a right place to ask the question, 
but I am sure that there are some experts on this forum knows the 
answer. Here is the question:

I am about the write a program to list (and count) all of the pages 
(URL) in a directory from a website.
Let say, given a URL below:
http://www.xyz.com/myfolder
or http://www.xyz.com 
there are lots of directories, each directory has number of pages. 
So in this case, let say there are five pages located in myfolder 
directory. I'd like to find out those five URLs or links, for 
example:
http://www.xyz.com/myfolder/page1.html
http://www.xyz.com/myfolder/design.doc
http://www.xyz.com/myfolder/faqs.html
http://www.xyz.com/myfolder/links.htm
http://www.xyz.com/myfolder/mynews.html

How would I do this? Can you please guide me step by step (or some 
ideas) to design this program?

Thanks for your help.
Dinh Nguyen
--
Ted Husted,
  Junit in Action  - <http://www.manning.com/massol/>,
  Struts in Action - <http://husted.com/struts/book.html>,
  JSP Site Design  - <http://www.amazon.com/exec/obidos/ISBN=1861005512>.


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


Re: Unit Test Actions

2003-10-28 Thread Ted Husted
Steven Woody wrote:
> Can I unit test Action subclasses with JUnit without running of a
> Servlet container?
http://strutstestcase.sourceforge.net/



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


Re: GURU NEEDED: Tiles Definitions and new ActionForward(TILES_DEFINITION_NAME);

2003-10-28 Thread Ted Husted
Technically, it will return an ActionForward with the path set to the 
String passed as TILES_DEFINITION_NAME. Later, the RequestProcessor 
would check to see if the path matches the name of the Tiles definition 
before using it as an URI. Of course, you have to have Tiles configured 
and all that.

Often the best thing is to just jump in and try something like this 
yourself. If you don't have a working application open, install one of 
the many examples and play with that. The best way to learn Struts can 
be to just roll-up your sleeves and start trying things.

Micael wrote:
If I return "new ActionForward(TILES_DEFINITION_NAME);", will that 
return the page the definition defines?  This is seemingly so.  If so, I 
can dynamically choose definitions in the Action and not bother with 
either global forwards or defining forwards in action mappings.  Is that 
right?

I would really appreciate an answer to this from some guru.  Thanks 
ahead of time.

Micael


--
Ted Husted,
  Junit in Action  - <http://www.manning.com/massol/>,
  Struts in Action - <http://husted.com/struts/book.html>,
  JSP Site Design  - <http://www.amazon.com/exec/obidos/ISBN=1861005512>.


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


Re: html:cancel

2003-10-27 Thread Ted Husted
Not as such. What you can do is have the Action class look for a a 
"cancel" forward when there is a cancelled command. This lets you define 
a local cancel forward when needed or rely on a global one otherwise.

HTH, Ted.

Gandle, Panchasheel wrote:
Is there a way to go back to previous, previous page
without having a extra forward in the config file.
say I'm on list page
then I go to add page
which calls pageAddAction on cancel
I want to go back to list page and not on pageAdd when users cancel it.



Thanks
Panchasheel


--
Ted Husted,
  Junit in Action  - <http://www.manning.com/massol/>,
  Struts in Action - <http://husted.com/struts/book.html>,
  JSP Site Design  - <http://www.amazon.com/exec/obidos/ISBN=1861005512>.


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


[FRIDAY] YA Stuts In Action Triva Quiz

2003-10-24 Thread Ted Husted
Last time, we asked what famous (or perhaps infamous) computer scientist 
advises:

>   "When you've got a bug, don't fix it. Write another piece of code to
> recognize that it's about to happen and head it off."
There were several right answers and only a few unexpected answers. The 
notable unexpected answers included:



"'Melinda French Gates' -> the wife of Microsoft's Bill Gates. Women 
prefer a straightly way, irrational but at the end there is always a 
more or less working result. [Koni]"

"Bill Gates, who also added 'And then charge the customer for the
new software package'" [Ian Vellosa]
---

Apparently, if the infamous computer scientist in question ever tires of 
MIT, there's a spot for him in Redmond WA. :) As many of you noted, it 
was MARVIN MINSKY who gave us this unique perspective on debugging.

Our winner of a signed copy of Struts in Action, selected arbitrarily by 
an artificially intelligent algorithm, is ... Nathan Rogers.

And, for posting the OT link to an article by Marvin's Java-bashing MIT 
colleague, which gave me the idea, another copy is slated for the 
equally infamous Mark Galbraith. :)

(Gentlemen, please send your surface mail addresses to [EMAIL PROTECTED])

NEXT:

Name the famous science fiction series whose various peoples and 
institutions were made to say:



"Truth is a chameleon."

"All persons are contained within a single individual, just as all time 
is in a moment, and the entire universe is in a grain of sand."

"One observes the survivors, and learns from them."



PLEASE be sure to reply to [EMAIL PROTECTED]

The winner will be selected at random (or at least arbitrarily) from the
correct responses. [The correct response being the one I expected =:)]
The contest will run until Friday, October 31, 2003, 23:59:59, so
everyone has a chance to participate.
The lucky winner selected from the correct responses will receive a
signed copy of Struts in Action.
PLEASE be sure to reply to [EMAIL PROTECTED]

If you have an interesting science fiction or computer science quote
that is hard to google, please send it to me. The first to suggest a
quote that we use also wins!
-Ted.

PLEASE be sure to reply to [EMAIL PROTECTED]



--
Ted Husted,
  Junit in Action  - <http://www.manning.com/massol/>,
  Struts in Action - <http://husted.com/struts/book.html>,
  JSP Site Design  - <http://www.amazon.com/exec/obidos/ISBN=1861005512>.


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


Re: Please Help!!! A Validation Rule Fail On A Second-Page Causes A Blank Page To Show Up

2003-10-24 Thread Ted Husted
Kam Lung Leung wrote:
> Why don't I get a pop up dialog box with error messages?
> Why the secondPage.jsp did not get executed when a validation
> error occurred?
> Why do I get a blank screen?
Are you sure that it's blank? Sometimes the page doesn't render because 
of errors in the HTML, which might only be exposed when the page is 
trying to display error messages.

I'm not sure why you would reset everything if getPage() is equal to 2. 
The usual approach is to allow the properties to accumulate, until the 
end of the workflow, and then dispose of the (session-scoped ActionForm 
altogether. Generally, the only thing you ever need to reset is a 
checkbox to false on a session-scope ActionForm.

-Ted.


Hi,

I have been looking at this problem for the last four days and can't figure
out. I have an application that required workflow form. I created a
CreateUserAccountAction class that extends the DispatchAction and a form
MultiCreateUserAccountForm that extends the ValidatorForm.  The reset method of
the MultiCreateUserAccountForm clears all attributes under the current session
when the getPage() is equal to 2. The CreateUserAccountAction has two methods
that are similar to the execute method that are named createUserAccountActionOne
and createUserAccountActionTwo. I got this concept out of chapter 12 of the book
Profession Jakarta Struts by James Goodwill and Richard Hightower.
*** Here are the symptoms  **
If there is a required field that is missing (leaved out) or does not fulfill
the validation rule on the firstPage.jsp when the submit button is pressed. A new
dialog box popped up on the screen with the validation message(s) from the
resource property file. When all fields are validated the control is forwarded to
the secondPage.jsp.
If there is a required field that is missing (leaved out) or does not fulfill
the validation rule on the secondPage.jsp when the submit button is pressed. A
blank page is showed up on the window without a new dialog box shows up on the
screen. The server.log indicates an error occurred and the control returns to the
same page (secondPage.jsp). To fixing this problem, I pressed the back page
button of the browser and correctly filled in all missing fields or making sure
the input is conforming to the validation rule. When all fields on the second
page are filled in correctly according to the validation rules then the control
is correctly forwarded back to the firstPage.jsp.
**  My questions

Any suggestion and how to fix this problem is deeply appriciated.

Kam Lung Leung 



*** ***More detail on how the jsp was set up  **
The createUserAccountActionOne method calls the
MultiCreateUserAccountForm.validate() method to validate the user input fields of
the firstPage.jsp. Second, it calls the setPage() method with  "1" as its input
parameter. Finally, it calls the MultiCreateUserAccountForm.setMethodToDispatch()
with "createUserAccountActionTwo" as the input parameter.
 
The createUserAccountActionTwo method calls the
MultiCreateUserAccountForm.validate() method to validate the user input fields of
the secondPage.jsp. Secondly, it remove the obsolete form bean with
session.removeAttribute(mapping.getAttribute()). Thirdly, it calls the setPage()
method with  "2" as its input parameter. Finally, it calls the reset() method to
clear all attributes under the current session.

** This are action mapping ***

 


 

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

--
Ted Husted,
  Junit in Action  - <http://www.manning.com/massol/>,
  Struts in Action - <http://husted.com/struts/book.html>,
  JSP Site Design  - <http://www.amazon.com/exec/obidos/ISBN=1861005512>.


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


Re: Can I get an answer?

2003-10-24 Thread Ted Husted
david Liles wrote:
I am using struts 1.1 and have a link on a page that makes a javascript call to open a popup window and execute the requested action.
 
Below is the action mapping in the struts-config.xml file:
 






It doesn't appear that the link on the jsp is calling the action mapping, I have a System.out.println() in the action class. any suggestions?
My first suggestion is to be patient. You've posted the same question to 
the list three times in the same afternoon. It is not good netiquette. 
We all have only so many *volunteer* hours to give, please don't waste 
our limited resources.

Second, I'd suggest viewing the HTML source to be sure the link renders 
correct.

Third, I would try entering the URI directly,

  /yourApp/ReadMessage.do

to see what happens.

You might also try entering

  /yourApp/messages/read_message.jsp

to see what happens then.

Fourth, if you are just mapping the page flow, you can also do things like:



and keep the Actions out of it until you're ready to add functionality.

Fifth, I'd *strongly* suggest using a modern IDE like Eclipse or 
IntelliJ so you can step through the Actions rather than rely on logging 
statements. :)

HTH, Ted.



--
Ted Husted,
  Junit in Action  - <http://www.manning.com/massol/>,
  Struts in Action - <http://husted.com/struts/book.html>,
  JSP Site Design  - <http://www.amazon.com/exec/obidos/ISBN=1861005512>.


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


Re: Hi Ted, any more on ?

2003-10-24 Thread Ted Husted
Sonam Belbase wrote:
Has the  you mention below been implemented already
or is it in the works at all?
Not as such. The idea's come up a few times. I've been using FormProc 
for validation lately, and might try to extend that sometime to support 
more of the attributes you'd need for something like html:control. Once 
the appropriate attributes were available, the rest starts to fall into 
place. Tags, like Mentats, need data. :)

The essential idea would be to abstract a UI component into a generic UI 
object and let the object tell the tag what control to write. So, it's 
the other-way around from how we usually do it now. The object (or 
JavaBean) is running the show, and the tag just does like its told.

One perspective is that we need to define an "field dictionary" for an 
application. We should be able to define a field's label, target type, 
default control, hint, validator, error message, and so forth in a 
single place, and then reuse those field attributes throughout the 
application. A form could then become a collection of reusable fields.

And, this isn't just a UI thing, the business tier uses these fields 
too. In the Commons Chain work (and DynaBean before that), we're finding 
it convenient to use named attributes rather than strict JavaBean 
properties. This is another place where a concrete dictionary that says 
this field uses this attribute key would be useful.

So, essentially, it would be helpful if there a meta-class that combined 
the properties required by Swing, SWT, and HTML 4.1 controls with 
selected properties from ResultMetaData. For extra credit, it could also 
support the Java Metadata Interface <http://java.sun.com/products/jmi/>. :)

The point of this class would not be to *store* the data, but to 
*describe* the data we're storing.

Once in place, packages like Hibernate and iBATIS  might offer support 
for the metaclass, and so you'd have something to help glue the User 
Interface layer of your choice with the Data Persistence layer of your 
choice.

It's quite possible several packages offer such a thing already, but 
buried within a larger implementation, making it difficult to share. 
(Hark! I hear the Commons calling.)

This could be an interesting space to explore with Jelly, which is 
already doing things with Swing and SWT, along the the usual taglib stuff.

Of course, I'm sure there's overlap with JSF in this space, but I'm 
waiting for the dust to settle before spending too much time with that 
gorilla. :)

Hmmm, how long before we see JellyFaces, I wonder.

-Ted.



--
Ted Husted,
  Junit in Action  - <http://www.manning.com/massol/>,
  Struts in Action - <http://husted.com/struts/book.html>,
  JSP Site Design  - <http://www.amazon.com/exec/obidos/ISBN=1861005512>.


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


Re: Db usage in bean [design issue]

2003-10-24 Thread Ted Husted
My very best advice is to have a look at the iBATIS DAO framework 
<http://ibatis.com>. For the time being, it's bundled with the iBATIS 
SqlMap package, but you don't need to use them together. It uses the 
same general pattern you see in the current Struts MailReader example, 
but raises the DAO pattern to a reusable framework.

While DAO is an acromym for Data Access Object, the current trend is 
toward a data access API (all action no data) coupled with a data 
transfer object (all properties, no actions). This is the strategy that 
the Struts Mailreader uses, to good effect.

HTH, Ted.

Rajat Pandit wrote:
Hello all,
I am new to servlets development as such. And have this design issue. I
want to ensure that the applications that I build can be used with other
databases, which might have different tables or column names or
different structures on the whole.
I mean the basic buisness logic remains the same and other things around
it might change. This is what I am doing right now.
My Action - extended - Struts Action  -> the execute / perform method
calls the buisness logic bean.
The buisness logic bean is passed the connection resource (orginally
created in the action bean itself). 

This connection resource is used by the methods inside the bean for
getting their data.
I am not sure, but is there a possibility that I have buisness beans in
such a way that they don't have anytihng to do with the database
connection and all they need is data as arguments and return data back
_AND_ I am also don't need to clutter up my (extended) action class with
SQL fetches!.
This essentially means that there will be 
A. a buisness logic bean. Which contains the buisness logic to do
datamanipulation.
B. a database  bean which does the work of
fetching and returning back data to the db.
C. an extended action class which manages both of these.

All this might sound rather silly, but there are times when I really
drive my self nuts about keeping all the tiers clean and independent of
each other.
Can someone shed some light on this. (other alternatives being, turn on
the floodlights ;) )
Also any pointers on design patterns...

Rajat Pandit | [EMAIL PROTECTED]
+91 612 3117606
[ Developer and Part Time Human Being]
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

--
Ted Husted,
  Junit in Action  - <http://www.manning.com/massol/>,
  Struts in Action - <http://husted.com/struts/book.html>,
  JSP Site Design  - <http://www.amazon.com/exec/obidos/ISBN=1861005512>.


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


Re: How To Use request.tld?

2003-10-24 Thread Ted Husted
Request is a Jakarta Taglibs taglib.

http://jakarta.apache.org/taglibs/doc/request-doc/intro.html

HTH, Ted.

Caroline Jen wrote:
Where can I find any doc regarding how to use
request.tld?  

I have seen request.tld be imported in a JSP and the
role of the logged-in user is validated this way: 



I would like to find out how to use the request.tld to
express this statement:
user.setName( request.getRemoteUser );

--
Ted Husted,
  Junit in Action  - <http://www.manning.com/massol/>,
  Struts in Action - <http://husted.com/struts/book.html>,
  JSP Site Design  - <http://www.amazon.com/exec/obidos/ISBN=1861005512>.


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


Re: HAPPY DIWALI! - To Everyone, and we're done now

2003-10-23 Thread Ted Husted
First, I would like to wish everyone a Happy Diwali. I do have Indian 
and Hindu relatives, and the thought is very much appreciated.

But, as the list moderator, I would respectfully ask everyone to stop 
posting to this thread, now. It's no longer about wishing everyone in 
our community well, or about helping each other use Struts. I'm sure 
there are places where interested parties can carry on such threads, but 
this is not one of those place.

So, let's get back to work guys.

-Ted.



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


Re: select & default value

2003-10-23 Thread Ted Husted
The HTML tags are designed to work with an ActionForm, which describes 
all the properties on the form, including the one you would use with the 
select tag.

http://jakarta.apache.org/struts/userGuide/building_model.html#actionform

The name you give the form in the struts-config is also its attribute 
name in request or session scope. If you save the ActionForm to the 
session under the appropriate name, when you come back to the page, the 
value will be selected again. By default, Struts will save the form to 
session scope for you, so you don't really have to do anything. This 
much is automatic  =:)

If you are working on a small application for a modest number of users, 
you can just create an ActionForm for each of your HTML forms, each 
using a unique name. Each will be saved in the session for you, and 
preserve the last thing they entered. If you need to populate the form, 
you can transfer data to it in the Action.

The one thing to watch for are checkboxes. If you use checkboxes on a 
session-scoped ActionForm, you need to clear them in the reset method. 
Otherwise, you do not need to clear any other properties of the rest 
method.

-Ted.

koen boutsen wrote:
Hi

I'm using a .
When an option is selected, I put the selected value in the session.  When come back 
on the page with this select, I want the previously selected option to be selected.
Can anyone tell me how I can do that ?
thanks

Koen


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


Re: [ANN] Struts IRC Channel: Square off with Mark

2003-10-23 Thread Ted Husted
+1

The Struts USER list is suppose to be a place where people who need help 
with Struts can connect with people who want to offer help with Struts.

Posts regarding beer are tolerated :), but lets leave the econonmy, 
politics, and religion out of it. :|

-Ted.

Brandon Goodin wrote:

Greetings,

The struts IRC channel at irc.darkmyst.org #struts_users was created
for two reasons:
1) To provide a place where struts questions can receive more
interactive and immediate dialog.
2) To relieve [OT] tensions from the list.
Please feel free to visit the IRC channel to participate in either. It
is good practice to keep the struts list clean from renegade threads.
Brandon

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

--
Ted Husted,
  Junit in Action  - <http://www.manning.com/massol/>,
  Struts in Action - <http://husted.com/struts/book.html>,
  JSP Site Design  - <http://www.amazon.com/exec/obidos/ISBN=1861005512>.


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


Re: multiple struts-config.xml - multiple modules?

2003-10-22 Thread Ted Husted
If the tools are being developed by the same people, you'll probably be 
better off using mutiple struts configuration files than modules. 
Modules are best suited for when things are being developed by 
independant parties who aren't working together.

If that doesn't describe you, then just give each tool it's own 
subdirectory and use that same name to identify everything else that 
goes with the tool.

Even if you used modules, you can't distribute them as separate WARs.

If your container supports single logon, as Tomcat does, you can 
distribute each tool as a separate application and flip back and forth 
between after a single logon. With a modern container, you can also 
share JARs and save some resources. The applications can't share session 
information, though, so you'd have to pass everything through the 
request or cookies or a database.

HTH, Ted.

--
Ted Husted,
  Junit in Action  - <http://www.manning.com/massol/>,
  Struts in Action - <http://husted.com/struts/book.html>,
  JSP Site Design  - <http://www.amazon.com/exec/obidos/ISBN=1861005512>.
Michael Blair wrote:
I have a question regarding overall architecture. I am going to have a huge
web app; well it will be a suite of web based tools. Lets say I will have
one main menu, and from there possibly 5 separate modules (separate content
areas). First, how hard is it to have a struts-config for each module (I
have an example below). Second, can each "module" be in its own war and
still be able to go back and forth among the other modules?
web.xml

config
/WEB-INF/config/struts-config.xml


config/module1
/WEB-INF/config/struts-module1-config.xml

now the actions work fine in the default config, but how do I call an action
FROM the default to module 1? Here is what I have tried in my .jsp. Note,
this .jsp is part of the default and im trying to call something in module1.

Thanks,
Mike


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


Re: Dynamic creation of the input types on the form

2003-10-22 Thread Ted Husted
Shishir K. Singh wrote:
> Is there a way that I can create a form dynamically based on some XML
> configurable file. The configurable file will say  what kind of  input
> type it is. Eg "text", "checkbox" etc and accordingly, I  create the
> form input types and  then display the fields.
AFAIK, there's no such beast right now, though I keep thinking there 
should be.

Essentially, the idea would be to represent the entire form and all of 
its fields as a JavaBean (or Map of JavaBeans, or Map of Maps), which 
could be instantiated by an XML file. Not unlike the XML form element 
the Validator uses, only more so.

A JSP Tag (or Velocity Tool) could then render the control based on the 
properties of the JavaBean form. So instead of having something like



you'd have something like



The tag would then lookup the "xyz" property, and then the "controlType" 
property on the xyz JavaBean, and use that value to decide which control 
to render (input, select, ... ).

For extra credit, there could also be tag/tool that could write a 
plain-vanilla version of the entire form as a simple table.

I end up doing this myself eventually, but keep hoping someone will beat 
me to it =:)

-Ted.

--
Ted Husted,
  Junit in Action  - <http://www.manning.com/massol/>,
  Struts in Action - <http://husted.com/struts/book.html>,
  JSP Site Design  - <http://www.amazon.com/exec/obidos/ISBN=1861005512>.
Shishir K. Singh wrote:
Hello,

Is there a way that I can create a form dynamically based on some XML
configurable file. The configurable file will say  what kind of  input
type it is. Eg "text", "checkbox" etc and accordingly, I  create the
form input types and  then display the fields. 

Eg 

My JSP looks like this right now (I am using tiles and this is the
content section )


<%@ taglib uri="/core"  prefix="c" %>
<%@ taglib uri="/struts-tiles"  prefix="tiles" %>
<%@ taglib uri="/struts-html"   prefix="html" %>





			   
			
value="${lines.attributeName}"/> 
			
name="lines" property="attributeValue"/>
			
		
			   
			
			
	

   







Basically my intent is to load  some predefined attributes (by parsing
an XML file) and creating the 
Form on the fly using indexed DynaActionForm (contentForm) . I have been
able to get the fields up in the form, but only 
as text input fields as I am using 
type can be check boxes, or select type and 
I would like that to be configurable instead of hard coding in the JSP.
Is this doable ??

Any hints/tips would be appreciated. 

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


Re: Display Mode | Edit Mode

2003-10-22 Thread Ted Husted
[EMAIL PROTECTED] wrote:
> Does STRUTS provide any feature so that the same jsp can be used for
> showing the page in Display Mode as well as Edit Mode without having
> to manually code the same in JSP ?
The bundled Struts taglibs do not have a display mode property, but the 
Struts Layout tags do:

http://struts.application-servers.com/

Another very good taglib is DisplayTag

http://displaytag.sourceforge.net/

DisplayTag is not Struts-specific, but it sure is pretty :)

-Ted.

--
Ted Husted,
  Junit in Action  - <http://www.manning.com/massol/>,
  Struts in Action - <http://husted.com/struts/book.html>,
  JSP Site Design  - <http://www.amazon.com/exec/obidos/ISBN=1861005512>.


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


Re: [NEWBIE] Struts and Applets

2003-10-19 Thread Ted Husted
You might try thinking about it from the other direction.

How about if there were a generic "component" or context object that was 
used by your business layer. So whatever it is your clients want either 
Swing application or a web application to do, is handled by your 
business layer code, which communicates to the rest of the world through 
a generic context.

Things like Struts Actions and Applets then become adapters between 
their presentation components and the business layer. The business layer 
works through context that everyone else can learn to read and write.

This is the general direction we are going with the Common Chain package.

http://cvs.apache.org/viewcvs/jakarta-commons-sandbox/chain/

So, to answer your question, it's no so much that we need to pass a 
generic component object to an Action, but that the Action (and Applet) 
should pass a generic object to your business layer. (The less done in 
Action classes, the better.)

-Ted.

Marco Tedone wrote:
Hi, I'm just entering the AWT and Applet world in java (in the sense that
I'm going to study those technologies). I was wondering if an Action can
process information in an Applet. In few words if it would be possible to
specify the following?:
1) From within an Applet, a link (by means of a button or a link) to a
Struts Action (this shouldn't be a problem);
2) From within the Struts Action, access the Applet layout components (text,
radio, check, etc.)
If this is not possible, would it be worthwhile to think at passing a
generic 'component' object to an Action execute method, instead of a Form
one, where this component is parent of both Form, Applets, and whatever
other kind of web component possible?
Have a nice w-e,

Marco
--
Ted Husted,
  Junit in Action  - <http://www.manning.com/massol/>,
  Struts in Action - <http://husted.com/struts/book.html>,
  JSP Site Design  - <http://www.amazon.com/exec/obidos/ISBN=1861005512>.


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


Re: IMPORTANT: internationalize large chunks of text/HTML

2003-10-15 Thread Ted Husted
I haven't had to do this myself, but I believe that when you have entire 
pages that can be maintained separately, people start developing 
separate page trees. The idea being that you can have an Action check 
the locale and fork to one set of ActionForwards or another, based on 
the locale.

-Ted.

Mick Knutson wrote:

I have posted this before, and I still am trying to understand the best way
to approach this.
I have 100% of my labels in a Resource bundle currently. But I also have
larger pages of text (1-2 pages at a time), that I need to be
internationalized just like my labels. I am wondering what the best way to
do this is?
I just want to know what other people are doing that is easy on maintenance.
---
Thanks
Mick Knutson
The world is a playground...Play Hard, Play Smart.
Visit  http://www.YourSoS.com to learn how our "Personal Emergency Alert &
Contact System" can help you Play Smart.
+00 1 (708) 570-2772 Fax
MSN: mickknutson
ICQ: 316498480
ICQ URL: http://wwp.icq.com/316498480
---

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

--
Ted Husted,
  Junit in Action  - <http://www.manning.com/massol/>,
  Struts in Action - <http://husted.com/struts/book.html>,
  JSP Site Design  - <http://www.amazon.com/exec/obidos/ISBN=1861005512>.


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


Re: JavaServer Faces

2003-10-13 Thread Ted Husted
Chen, Gin wrote:
> alternative to the integrated Struts Bean/Logic functionality.
The original Struts taglibs are *NOT* integrated with the Struts 
controller. The Struts controller has absolutely no idea that these tags 
exist. Struts works just as well (or even better) with JSTL, or JSF, or 
Velocity Tools, or the Stxx XML tools, and whatever else may be out 
there. At the present time, the original Struts taglibs are simply 
*bundled* with the core distribution. These classes could be pulled out 
of the JAR at any time, and the controller would not know the difference.

-Ted.

Chen, Gin wrote:
See.. Anyone reason that this should be kept public is to correct our
understanding of what JSF is really about. ;)
With the talks of JSF and it's UI/Action like capabilities it is no wonder
that we think of it as a possible alternative to Struts. To use it with
Struts seems to me as saying that you are using only part of the
functionality of JSF. Just like your using part of the functionality of
Struts if you use JSTL instead of Bean/Logic tags currently. While it is
probably a better solution than the Bean/Logic tags, JSTL is still just and
alternative to the integrated Struts Bean/Logic functionality.
-Tim

-Original Message-
From: Craig R. McClanahan [mailto:[EMAIL PROTECTED] 
Sent: Friday, October 10, 2003 2:41 PM
To: Struts Users Mailing List
Subject: Re: JavaServer Faces

Chen, Gin wrote:


Since JSF is *supposed* to replace Struts, so to speak,



This statement is *not* a correct understanding of what is happening!  
Anyone who claims that doesn't get it.

You should absolutely, positively plan on evaluating the use of 
JavaServer Faces components instead of the Struts HTML tags, and the 
JSTL tags instead of the corresponding bean and logic tags.  Besides 
being standadized (which means, for example, that you can import and use 
*anyone's* JavaServer Faces tags, not be stuck with ones that are 
provided only by Struts), they are more powerful and more functional -- 
and they work fine in conjunction with Struts based applications.

That has nothing to do with whether or not you need the other features 
of Struts (the core controller mechanisms, plugins, Tiles, Validator, 
...) -- which can be used just fine with JavaServer Faces components as 
well.  There is a functionality overlap in the core controller role, and 
for some people JavaServer Faces will be sufficient by itself.  But it's 
our job as Struts developers to ensure that the gap continues to exist 
and increases; there's a lot of things required to build good web apps 
that are not UI components or tags, and are therefore outside the scope 
of JavaServer Faces and JSTL.

Craig McClanahan



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

--
Ted Husted,
  Junit in Action  - <http://www.manning.com/massol/>,
  Struts in Action - <http://husted.com/struts/book.html>,
  JSP Site Design  - <http://www.amazon.com/exec/obidos/ISBN=1861005512>.
"Get Ready, We're Moving Out!!" - <http://www.clark04.com>



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


Re: Hi Ted, where is scaffold.ExistsAttributeAction??

2003-10-13 Thread Ted Husted
The source is under the Struts contrib folders.

Yes, the scaffold package has been stable for some time now.

The next thing might be a similar set of classes that work with the 
Commons Chain package. It would be the same strategy, though: use the 
Action as an adapter to call reusable business layer classes.

-Ted.

ZYD wrote:
Hi Ted,
 
I'm studying your artimus_1_1 codes.

I'm confused by some scaffold classes, such as org.apache.struts.scaffold.ExistsAttributeAction.

I cannot find it's source code, compiled class file and it's documentation anywhere. There are some other classes like this one.

I noticed that scaffold's last update was about one year ago.

Is scaffold still being working on?

Sincerely,
Bruce.
--
Ted Husted,
  Junit in Action  - <http://www.manning.com/massol/>,
  Struts in Action - <http://husted.com/struts/book.html>,
  JSP Site Design  - <http://www.amazon.com/exec/obidos/ISBN=1861005512>.


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


Re: communication between control layer & factory/model

2003-10-11 Thread Ted Husted
How about the Commons MessageResources?

http://jakarta.apache.org/commons/sandbox/resources/index.html

We ported the message collection over there for precisely this reason.  :)

HTH, Ted.

Adam Hardy wrote:

I've been happy until now passing objects backwards and forwards between 
my actions and my factories, and occasionally a int with the number of 
updates or deletes done, for example, to include in the status messages 
I show to the user, and throwing exceptions for anything else.

However I've just programmed a page with nested beans and the factory 
does the whole process in one transaction, covering three different 
operations which I would like to give three different status messages for.

In brief it is the realm user admin page and the list of nested beans 
are users - on which the admin op can update the email address, reset 
the password or delete the user entirely.

I want to tell the admin how many of each operation were done. I could 
either pass back an ActionMessages, but I don't want to mix struts into 
my factory layer, or I could pass back a string with different parts:

# of email updates
# of password resets
# of deletions
Which is not exactly elegant, since I have to tokenize it.

Anybody got any better solutions?

Adam

--
Ted Husted,
  Junit in Action  - <http://www.manning.com/massol/>,
  Struts in Action - <http://husted.com/struts/book.html>,
  JSP Site Design  - <http://www.amazon.com/exec/obidos/ISBN=1861005512>.


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


[FRIDAY] YA Stuts In Action Triva Quiz

2003-10-11 Thread Ted Husted
Last time, we asked the immortal question:

  "Open source developers don't make backups, they ..."

and received several very good answers:

  "... make branches." [Heya Gosper]

  "... know that a re-write every now and again is good for the 
design." [Adam Hardy]

  "... either create nonbreakable software or they love big time to 
work all night long when their application crashes." [Koni Roth]

  "... just keep a spare pair of trousers by their computer." [Adam Hardy]

And, of course, the expected answer:

  "... they upload it via ftp and let the world mirror it," as 
attributed to Linus Torvalds.

There were several entries of the expected answers. The winner arbitrary 
selected from these is ... Denis of BestWay.net

As a special bonus, we also selected a winner from the "unexpected" 
answers ... Heya Gosper.

* Denis and Heya, please send me your mailing addresses by private email 
to [EMAIL PROTECTED]

NEXT:

What famous (or perhaps infamous) computer scientist advises:

  "When you've got a bug, don't fix it. Write another piece of code to 
recognize that it's about to happen and head it off."

PLEASE be sure to reply to [EMAIL PROTECTED]

The winner will be selected at random (or at least arbitrarily) from the
correct responses. [The correct response being the one I expected =:)]
The contest will run until Friday, October 17, 2003, 23:59:59, so
everyone has a chance to participate.
The lucky winner selected from the correct responses will receive a
signed copy of Struts in Action.
PLEASE be sure to reply to [EMAIL PROTECTED]

If you have an interesting science fiction or computer science quote
that is hard to google, please send it to me. The first to suggest a
quote that we use also wins!
 -Ted.

PLEASE be sure to reply to [EMAIL PROTECTED]

--
Ted Husted,
  Junit in Action  - <http://www.manning.com/massol/>,
  Struts in Action - <http://husted.com/struts/book.html>,
  JSP Site Design  - <http://www.amazon.com/exec/obidos/ISBN=1861005512>.


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


Re: Keeping Actions clean - separating actions from business mode l from persistence

2003-10-11 Thread Ted Husted
Mahesh Joshi wrote:
I have always wondered where is the best place to do connection management
with the dataStore. 
Should the business Logic do connectionManagement (e.g. opening a connection
(via  a connection pool or otherwise)) or should that be the responsibility
of the persistence layer. Doing it in the latter(PersistenceLayer) frees up
the BusinessLayer of connection Mgt code. 
If you are implementing connectionpool, the overhead is the time to return
the connection to the pool and get it back.
The iBATIS DAO splits the difference and makes transaction management 
part of the logical DAO API.  So you can specify different connection 
mechanisms at instantiation, and the implementating code does not need 
to know the details. The DAO implementation can just call high-level 
methods like startTransaction, commitTransaction, or rollbackTrnasction.

This strategy limits what the implementaton needs to know about the 
connection management, but still lets the business logic determine what 
constitutes a transaction (which is often a business decision).

-Ted.

--
Ted Husted,
  Junit in Action  - <http://www.manning.com/massol/>,
  Struts in Action - <http://husted.com/struts/book.html>,
  JSP Site Design  - <http://www.amazon.com/exec/obidos/ISBN=1861005512>.


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


Re: Keeping Actions clean - separating actions from business model from persistence

2003-10-11 Thread Ted Husted
think of it as API with DAO.

The current Struts MailReader example also demonstrates this same DAO 
pattern, but without a formal framework. Makes for a nice comparison.

Without something like Commons Chain, you end up having to make a few 
API calls from within your Action. The Command code shown would either 
be in a little class of it's own (e.g. ProcessBean) or embedded in the 
Action.

The neat part about Chain, is it gives us a place to put that stuff 
where it can be accessed by a logical name. This severely limits the 
coupling between your Actions and the business layer.

I'm in the middle of an iteration that uses Chain and iBATIS DAO in a 
working application. Once that's done, I'll start abstracting things 
into a toolkit, like the Scaffold stuff.

HTH, Ted.

Sasha Borodin wrote:
Ted, Matt, Joe, and all the other helpful folks that chimed in earlier on
persistence mechanisms:
In trying to keep with best practices, I've managed to remove all "model"
related code (business logic, and persistence) out of the Actions' execute()
method.  Now I'd like to take it one step further and decouple the business
model classes from the implementing persistence technology (btw, settled on
OJB for now :).  From Joe's post, it seems like the DAO pattern is called
for to accomplish this.
My (slightly off topic) question is this:  who develops their own DAO
framework (like the dao and dao factory interfaces), and who uses a 3rd
party framework (like iBATIS's Database Layer) and why?  There was something
mentioned about the discovery of the persistence mechanism as well...
Any references to webpages/books would be appreciated.

BTW, I've been shamelessly posting to this list questions that are probably
better directed elsewhere.  What would be a more appropriate list?
Thank you,

-Sasha

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

--
Ted Husted,
  Junit in Action  - <http://www.manning.com/massol/>,
  Struts in Action - <http://husted.com/struts/book.html>,
  JSP Site Design  - <http://www.amazon.com/exec/obidos/ISBN=1861005512>.


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


Re: OT - book on Java patterns

2003-10-11 Thread Ted Husted
As mentioned, Core J2EE Patterns 2d is quite good. The other key tests 
are "Design Patterns" and "Patterns in Enterprise Architecture". We list 
such books here:

http://jakarta.apache.org/struts/resources/related_books.html

HTH, Ted.

Sasha Borodin wrote:
All this talk lately of various official "patterns" has my brain hurting
from the Unknown again.
Can anyone recommend a good book on *patterns* - business delegate, visitor,
dao, etc. etc. etc.
Thanks,

-Sasha
--
Ted Husted,
  Junit in Action  - <http://www.manning.com/massol/>,
  Struts in Action - <http://husted.com/struts/book.html>,
  JSP Site Design  - <http://www.amazon.com/exec/obidos/ISBN=1861005512>.


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


Re: [OT] Is Java Overkill?

2003-10-10 Thread Ted Husted
I have to admit, there are days when I would tend to agree :>

MIT is a place where they take pride in trying to invent the future. 
Something we should all keep in mind is that our world is still young. 
We've only scratched the surface, and there's a lot of future left to 
invent.

No matter how we decide to do something today, we'll be doing it 
differently ten years from now. (And, dammit, I *still* won't be 
eligible for retirement!)

-Ted.



--
Ted Husted,
  Junit in Action  - <http://www.manning.com/massol/>,
  Struts in Action - <http://husted.com/struts/book.html>,
  JSP Site Design  - <http://www.amazon.com/exec/obidos/ISBN=1861005512>.
"Get Ready, We're Moving Out!!" - <http://www.clark04.com>



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


  1   2   3   4   5   6   7   8   9   10   >