The required=true validation is running before your setUp() handler
fires, the parameter it's looking for is not present in the URL, and it
tries to find the JSP from which the form was submitted so that it can
go back to the page and let the user fix the input. In this case,
however, there was no form submission and there is no JSP to forward to
so it just pukes up the exception you're seeing. Your event handler does
not fire because the request never makes it beyond the validation stage.
Long story short: add @DontValidate to setUp().
FYI, Stripes 1.5 has a much more informative error report when this
happens so it's not so painful to figure out which validation is causing
the problem.
-Ben
Eric Blossom wrote:
Many thanks for the advice. I am using a filter-mapping:
<filter-mapping>
<filter-name>StripesFilter</filter-name>
<url-pattern>*.jsp</url-pattern>
<dispatcher>REQUEST</dispatcher>
</filter-mapping>
<filter-mapping>
<filter-name>StripesFilter</filter-name>
<servlet-name>StripesDispatcher</servlet-name>
<dispatcher>REQUEST</dispatcher>
</filter-mapping>
The page and associated action bean work fine for other validate
annotations like min=1 etc.
Another page in the same application uses another bean which does have a
required=true validate annotation and it works. I'm comparing the two
pair of jsp and action bean to see if I can spot a difference.
I'm ashamed to ask what is a "pre-action?" I think I'm doing as you
suggest:
@DefaultHandler
public Resolution setUp() {
System.out.println("--------------> setting up...");
return new ForwardResolution("/createCmpPlates.jsp");
}
I have a similar System.out.println in the setContext method and it
shows up in the log where as the "setting up..." one above does not. So
the context is being set OK, but we never get to the default handler.
When I remove the required=true. Everything works as expected.
Thanks again,
Eric
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Tim
Fennell
Sent: Thursday, May 01, 2008 4:00 AM
To: Stripes Users List
Subject: Re: [Stripes-users] "Here's how it is..." Again
This, as the exception explains, happens when a request is filtered by
the StripesFilter but some code requires access to the Stripes
configuration. If you are navigating straight to a JSP and the JSP
contains Stripes tags, you must ensure that the request still goes
through the StripesFilter. This is done by adding a <filter-mapping>
for *.jsp to your web.xml. Do you have that already?
-t
On May 1, 2008, at 4:07 AM, Jasper Fontaine wrote:
Just making sure, are you using a pre-action? (first going through the
actionbean, then forwarding to your JSP)
-j
Eric Blossom wrote:
Greetings! I have found in the archives some discussion of the
error I'm
getting. An exception is thrown with a long message starting with
"Here's how it is. ..." I can avoid this error if I remove all
"@Validate(required=true)" annotations in my action bean. The
solutions
that I have read all suggest using <stripes:form> which will supply a
_sourcePage attribute. However, I have two problems with this
explanation. One is that I am already using <stripes:form> and all
the
other validations like "@Validate(min=1)" work just fine. The other
is
that this exception is thrown when the page loads, not when I try to
submit the form. Does anyone have any other suggestion about where
I can
look?
------------------------------------------------------------------------
-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save
$100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/j
avaone
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users
------------------------------------------------------------------------
-
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/j
avaone
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users
This email (including any attachments) may contain material
that is confidential and privileged and is for the sole use of
the intended recipient. Any review, reliance or distribution by
others or forwarding without express permission is strictly
prohibited. If you are not the intended recipient, please
contact the sender and delete all copies.
Exelixis, Inc. reserves the right, to the extent and under
circumstances permitted by applicable law, to retain, monitor
and intercept e-mail messages to and from its systems.
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users
-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference
Don't miss this year's exciting event. There's still time to save $100.
Use priority code J8TL2D2.
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users