Hi Tim,
I have raised the JIRA request for the enhancement to the errors tag.
The messages tag and the Message interface seem to be what I want. I
will try them out and let you know how it goes.
By the way, here's another thing I want some thoughts on.
I am using the Stripes layout tags and I have a header jsp, a
navigation jsp and a content component defined in the layout. I want
to display the name of the current user (available in the context) in
the header. I know I could get at the context in a jsp via the action
bean (${actionBean.context}). But in the header jsp I don't have
access to an action bean. I could directly access the user attribute
from the session instead, but then I lose the advantage of using the
context and hiding the session attributes behind 'secret' attribute
names.
Any suggestions?
Regards,
Akbar
On 12/12/05, Tim Fennell <hidden> wrote:
> Hi Akbar,
>
> Thank you very much for your feedback! It's always great to hear how
> people are doing with Stripes. On your two questions:
>
> 1. You're right that there's no built in way to do this (yet).
> That's just a use case that I hadn't though of. Seems entirely
> reasonable though ;) Could you log a JIRA request for it at http://
> mc4j.org/jira/browse/STS ? It should be a fairly trivial change.
>
> 2. I'm not sure if you've seen it, but with Stripes 1.1.2 I've made
> some steps towards this. There is now a <stripes:messages/> tag that
> can read a set of messages and display them - it's a slighly
> simpified version of the errors tag. There's also a new interface in
> play called simply "Message". It's the new superclass of
> ValidationError and the getMessage(Locale) has been sucked up into
> it. The messages tag, not surprisingly, deals with Messages. The
> only implementations of the Message interface are still the various
> validation error classes. That may change in future releases...and
> it's also trivial to implement the Message interface yourself if you
> have a strong aversion to using LocalizableError. One thing to watch
> out for is that by default messages get stored into request
> attributes. It's all fairly clearly documented on the MessagesTag
> and ActionBeanContext; if you want it to work for redirect-after-post
> you'll just need to override a single method in ActionBeanContext
> (getMessages(String key).
>
> And thank you for letting me know about the errors in the doco, I'll
> get those cleaned up. If you see anything else like that either in
> the doco or in exception messages etc, please let me know!
>
> -t
>
>
> On Dec 11, 2005, at 10:47 PM, Akbar Ibrahim wrote:
>
> > Tim,
> >
> > I recently stumbled over Stripes and got to reading the documentation.
> > I must say, I am amazed at how intuitive it is to accomplish most
> > things with it. All the things that you had to bend over backwards to
> > get done with other frameworks are so easy (and did I mention
> > intuitive) with Stripes. And, by the way, The documentation is
> > excellent. Kudos for the great work.
> >
> > I am trying out Stripes with Spring and Hibernate. Here are two things
> > that I came up against and would like some suggestions on.
> >
> > 1. The errors tag either displays all errors or errors for each form
> > field. How do I display only the global error messages without getting
> > all the field errors? For instance, I would like to display all the
> > global errors at the top of the page and the field based errors next
> > to each form field. The errors tag doesn't provide me any way to do
> > that, short of hard-coding the value of the GLOBAL_ERROR constant as
> > the field name in the tag (haven't tried this yet, just imagining that
> > it might work).
> >
> > 2. After an action has completed successfully, I would lke to show a
> > success message to the user. There is no direct way to do this now,
> > except for using ValidationError along with the errors tag (as has
> > been suggested earlier in this mailing list for the same question by
> > someone else). But I feel using ValidationError for this purpose is a
> > bit kludgy (maybe just because of the fact that it is called
> > 'ValidationError'). What would be the best way to do this with
> > Stripes?
> >
> > And finally, a few nitpicks on the documentation (to be taken in the
> > nature of flicking off specks of dust off your shiny new Apple
> > hardware :)
> >
> > 1. Layout Reuse Page
> > The sentence 'So we could happily define another JSP that passes the
> > pageContext this way:' should be 'So we could happily define another
> > JSP that passes the pageTitle this way:'
> >
> > 2. State Management Page / Using a co-variant return type in your
> > ActionBean Section
> >
> > a. return type 'void' missing in the setter method.
> >
> > b. getter method implementation should be
> >
> > return context;
> >
> > instead of
> >
> > return getContext();
> >
> > Regards,
> > Akbar
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_idv37&alloc_id865&op=click
_______________________________________________
Stripes-users mailing list
hidden
https://lists.sourceforge.net/lists/listinfo/stripes-users