Just tried it out of curiosity and reproduced the problem. 

The issue disappears if you have a real JSP to forward to and everything works 
as expected. 

Then if you have a fictious JSP with path starting by "/" you have another 
error (a 404, which is expected). But you have the same "source page not found" 
error if the path doesn't start by "/".

Definitely looks like a bug : you should have a 404 instead of a validation 
error.  

Mikko, you can workaround by forwarding to an actual JSP page (we usually toss 
them under WEB-INF in order to make them available only using intenal forwards 
via ForwardResolution : we usually only expose ActoinBeans, not JSPs). You 
don't need to tell Stripes which converter to use, int is built-in.

I'm gonna file a bug and test case. Thanks for the report. 

Cheers

Remi


Le 4 avr. 2013 à 13:10, Mikko Saarela a écrit :

> Hi,
> 
> I'm getting a Stripes validation error report after going to URL:
> 
> http://www.myserver.com/my-app/some/1
> 
> "The value (1) entered in field My Value must be a valid number"
> 
> I have clean URLs configured.
> 
> My ActionBean is like this:
> 
> @UrlBinding("/some/{myValue}")
> public class SomeActionBean implements ActionBean {
>    private ActionBeanContext context;
> 
>    @Validate(converter=IntegerTypeConverter.class)
>    private int myValue;
> 
>    @DefaultHandler
>    public Resolution view() {
> 
>        System.out.println(myValue);
>        return new ForwardResolution("some.jsp");
>    }
> 
>    @Override
>    public ActionBeanContext getContext() {
>        return context;
>    }
> 
>    @Override
>    public void setContext(ActionBeanContext context) {
>        this.context = context;
>    }
> 
>    public int getMyValue() {
>        return myValue;
>    }
> 
>    public void setMyValue(int myValue) {
>        this.myValue = myValue;
>    }
> }
> 
> The full error message was:
> "Here's how it is. Someone (quite possibly the Stripes Dispatcher) needed to 
> get the source page resolution. But no source page was supplied in the 
> request, and unless you override ActionBeanContext.getSourcePageResolution() 
> you're going to need that value. When you use a <stripes:form> tag a hidden 
> field called '_sourcePage' is included. If you write your own forms or links 
> that could generate validation errors, you must include a value for this 
> parameter. This can be done by calling request.getServletPath()."
> 
> 
> Any ideas how to get this working?
> 
> 
> 
> 
> 
> ------------------------------------------------------------------------------
> Minimize network downtime and maximize team effectiveness.
> Reduce network management and security costs.Learn how to hire 
> the most talented Cisco Certified professionals. Visit the 
> Employer Resources Portal
> http://www.cisco.com/web/learning/employer_resources/index.html
> _______________________________________________
> Stripes-users mailing list
> Stripes-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/stripes-users


------------------------------------------------------------------------------
Minimize network downtime and maximize team effectiveness.
Reduce network management and security costs.Learn how to hire 
the most talented Cisco Certified professionals. Visit the 
Employer Resources Portal
http://www.cisco.com/web/learning/employer_resources/index.html
_______________________________________________
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to