Hi Rob,
I'd change the way parameters are supplied. IMHO REST means more the
mapping controllers to human readable URL's. For the scenario you
described I'd 2 ActionBeans: ViewOrganisationAction and
AdminOrganisationAction and bind them to the urls /view/ and /admin/.
So if you want to admin org1 you request /admin/org1. Viewing of org1
is /view/org1.
Can you explain why admin the competition 'tmx4' needs to be done with
such a URI? IMHO there is nothing wrong to view the organisation snc
and a click on the competition tmx4 requests /view/tmx4.
Regards,
Richard

On Fri, Jun 19, 2009 at 12:20 AM, Rob Johnston<[email protected]> wrote:
> Hi list
>
> I've spent some time with google today, investigating using UrlBindings
> to set up a REST-ish architecture. From the looks of things, Stripes
> can't handle this out of the box... is this correct?
>
> Here's my situation... At a basic level, the application allows a number
> of organisations (with 'view' and 'admin' events), each of which can
> have multiple competitions (again with 'view' and 'admin' events). The
> idea being:
> - www.site.com/org/snc/view : should invoke the 'view' event of the
> organisation 'snc'
> - www.site.com/org/snc/comp/tmx4/admin : should invoke the 'admin' event
> of the competition 'tmx4', which belongs to the organisation 'snc'
>
> My web.xml has this fragment:
>   <servlet-mapping>
>       <servlet-name>StripesDispatcher</servlet-name>
>       <url-pattern>/org/</url-pattern>
>   </servlet-mapping>
>
> And two Action Beans as such:
>
> @UrlBinding("/org/{code}/{$event}/")
> public class OrganisationActionBean extends BaseActionBean {
>   ...
> }
>
> @UrlBinding("/org/{orgCode}/comp/{compCode}/{$event}")
> public class CompetitionActionBean extends BaseActionBean {
>   ...
> }
>
> However, going to the "view organisation" url
> (www.site.com/org/snc/view) invokes the CompetitionActionBean with
> 'orgCode' set to 'snc/view'. The most obvious way to get this happening
> correctly is to have one action bean that just parses the url and
> decides what to do, but that's not terribly elegant. What's a
> "stripes-ier" way to go about this?
>
> I'm still getting to grips with web development, so any guidance would
> be greatly appreciated. Cheers
>
> ------------------------------------------------------------------------------
> Crystal Reports - New Free Runtime and 30 Day Trial
> Check out the new simplified licensing option that enables unlimited
> royalty-free distribution of the report engine for externally facing
> server and web deployment.
> http://p.sf.net/sfu/businessobjects
> _______________________________________________
> Stripes-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/stripes-users
>



-- 
Richard Hauswald
Blog: http://tnfstacc.blogspot.com/
LinkedIn: http://www.linkedin.com/in/richardhauswald

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables unlimited
royalty-free distribution of the report engine for externally facing 
server and web deployment.
http://p.sf.net/sfu/businessobjects
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users

Reply via email to