Nathan,

I think "hack job" is an unfair characterization. If beanClass didn't throw an exception for a non-existent ActionBean, there would be lots of people complaining here about Stripes being brittle as a result of typos and botched refactorings. Personally, I'd prefer fail-fast to a log message. Demoting this scenario to a log message would create confusion for newcomers and new projects especially. The same goes for invalid action URL mappings. For an example, see the thread "problem in finding the ActionBean class by jsp" from October 9th. If that person had an incorrectly configured log4j setup, there would have been no indication of an ActionBean naming problem.

I usually build my JSPs alongside stubbed ActionBeans. The naming and folder/package structure often mirror each other so its convenient to think about both at the same time. I use the IntelliStripes IDE plugin which will autocomplete the beanClass attribute for me, and I rely on the IDE to catch raw string ActionBean classname references when I refactor them. I'm a happy camper with that approach.

The "Maybe it's just me" comment in the Struts vs Stripes comparison that Tim (Stone) originally posted about implies the href approach, but the more prominently placed Stripes best practices document advocates using the beanClass attribute.

Chris.

On Oct 14, 2008, at 8:57 PM, Nathan Maves wrote:

all in all this sounds like a hack job when we could just make that exception into a warning.

On Mon, Oct 13, 2008 at 9:49 PM, Will Hartung <[EMAIL PROTECTED]> wrote:

On Oct 13, 2008, at 12:46 PM, Freddy Daoud wrote:

> As Chris said, normally you would switch back to beanclass once you
> wrote the action bean. In the meantime, as you said, the href would
> point directly to the JSP. This would break the preaction pattern,
> and wouldn't work if you're placing your JSPs under WEB-INF. You
> could always point the href attribute to a static page in the
> meantime,
> since you are prototyping at this point.

Or simply do:

<s:link href="com.you.YourActionBean"/>

Since the link is bad no matter what you do, here you only have to
change "href" to "beanclass" to convert it over.

You won't get any errors until you click the link.

You could even do:

<s:link href="fixmecom.you.YourActionBean"/>

and follow it with a global search and replace:

:s/href="fixme/beanclass="/g

Makes it even simpler to clean up your pages after you get the beans
implemented.

Regards,

Will Hartung


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to