incubator-jspwiki-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Jaquith (JIRA)" <>
Subject [jira] Commented: (JSPWIKI-578) Get rid of *.action URLs.
Date Tue, 19 Jan 2010 05:34:54 GMT


Andrew Jaquith commented on JSPWIKI-578:

Sorry, what do you mean by "name clash?" If you mean, Wiki.jsp and @UrlBinding("/wiki/{page}"}
would resolve to the same ViewActionBean event (for example), that's going to happen whenever
the URLBinding is different from the .jsp URL. But that's not too much different from today,
right? (For example, the ShortURLConstructor essentially dual-binds Wiki.jsp?page=${page}
and /wiki/${page} to the same event.) 

If we wanted just ONE URL binding, then we'd have to use UrlBindings that are identical to
the JSP (e.g., @UrlBinding("/Wiki.jsp"). It's worth testing whether we could bind .jsp URLs
to ActionBeans. Per my previous comment, I think there were some complications when I tried
it before, but I don't remember exactly. Worth testing.

Regardless, we could use FileBasedActionResolver for this... and in fact we SHOULD because
some site operators will want to use their own URL schemes. All FileBasedActionResolver does
is externalize the UrlBindings, rather than having them hard-coded in the class files via

On a related note, I have a crazy idea. What would you think about merging the *Content.jsps
INTO the top-level JSPs? These would be the defaults, in other words. Admins could still put
stuff in /templates/*/, and if found they would be used.

To make this work smoothly, we could create a (new) TemplateForwardResolution type that works
exactly like ForwardResolution, EXCEPT that if a custom template JSP exists, it is forwarded
to that instead, otherwise the top-level JSP. Example:

return new TemplateForwardResolution( "/Wiki.jsp" )

...would actually forward to /templates/mytemplate/Wiki.jsp if that file exists. If it doesn't,
it just goes to /Wiki.jsp.

What's nice about this is that we:
1) preserve the ability to call top-level JSPs directly, and have them mapped to the correct
ActionBean (with parameters bound correctly, of course)
2) simplify the JSP directory structure radically, while still allowing customization 
3) preserved the ability to add any URL binding schemes that the admin might want (using FileBasedActionResolver)

Thoughts? (On both issues...)

> Get rid of *.action URLs.
> -------------------------
>                 Key: JSPWIKI-578
>                 URL:
>             Project: JSPWiki
>          Issue Type: Improvement
>          Components: Core & storage, Default template
>            Reporter: Janne Jalkanen
>             Fix For: 3.0
> We currently have two URLs for each ActionBean - both the Wiki.jsp and Wiki.action are
available. Now, since the URLs are different, it has some nasty side-effects:
> * Users don't know which URL to bookmark, or they end up bookmarking both pages
> * Browsers don't know which pages are equal, and therefore both caching and page highlights
work inconsistently
> * Bots will index both pages, therefore giving odd results
> Since one of the design maxims of 3.0 is that URLs should not change, we should figure
out a way to get rid of the Stripes-induced *.action URLs.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message