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

Reply via email to