I've tried debugging UrlBuilder now and have the direct cause of my problems caught.

In UrlBuilder:472 there's a line

        if (baseUrl.equals(binding.toString())) {

In my code baseUrl is /organization/{$event}/{schoolId}/{param1}
and binding.toString() is /organization/{$event=index}/{schoolId}/{param1}

Note the extra =index after {$event

It causes the line 473 (baseUrl = binding.getPath();) to be skipped and after check at line 477 (if (binding.getPath().length() < baseUrl.length()) {) the baseUrl with { and }s is returned.

But if I hit "refresh" in the browser, the next time I debug the same code for the same page, baseUrl also has that $event=index part and everything works ok.



W dniu 10.03.2014 13:16, VANKEISBELCK Remi pisze:
I've had a peek at the sources.

When using FormTag, the "action" attribute it computed by (in short) replacing the placeholders in the @UrlBinding. The binding prototype is used and the "base url" is built, including clean-URL params if any :

net.sourceforge.stripes.util.UrlBuilder#getBaseURL

I have no idea why the placeholders (UrlBindingParameter instances in the components list) don't get replaced in your case.

Thinking out loud :
- are the parameters (the ones that you need in your query) present in the FORM ?
- do you have validation constraints ?

In order to help debugging, you can try to step in UrlBuilder. What I'd do is either :

1/ toss a conditional breakpoint in net/sourceforge/stripes/util/UrlBuilder.java:543, that breaks when the "url" variable contains a brace for example

or

2/ patch the source by adding stuff like :
if (url.contains("{")) {
  throw new RuntimeException("shit happens");
}
and break on the "throw new..." line.

This way, you'll have the whole environment, stack, variables, and logs. Of course, turn stripes logs to DEBUG before you do this.

One note though : I fail to understand how the {$event} param can be used in a form's action. I mean, it is not known until the user presses a submit, which happens *after* the action attribute gets generated...

Cheers

Rémi






2014-03-10 11:45 GMT+01:00 Grzegorz Krugły <g...@karko.net <mailto:g...@karko.net>>:

    No, there's nothing "fancy" in the code, the request goes to
    ActionBean
    and it returns ForwardResolution to JSP.

    W dniu 10.03.2014 11:43, Marcus Kraßmann pisze:
    > Maybe it happens when you call the JSP directly while it works
    when being called by an action bean?
    >
    > Am 10.03.2014 11:36 schrieb =?UTF-8?Q?Grzegorz_Krug=C5=82y?=
    <g...@karko.net <mailto:g...@karko.net>>:
    >


    
------------------------------------------------------------------------------
    Learn Graph Databases - Download FREE O'Reilly Book
    "Graph Databases" is the definitive new guide to graph databases
    and their
    applications. Written by three acclaimed leaders in the field,
    this first edition is now available. Download your free book today!
    http://p.sf.net/sfu/13534_NeoTech
    _______________________________________________
    Stripes-users mailing list
    Stripes-users@lists.sourceforge.net
    <mailto:Stripes-users@lists.sourceforge.net>
    https://lists.sourceforge.net/lists/listinfo/stripes-users




------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech


_______________________________________________
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
Stripes-users mailing list
Stripes-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to