myfaces-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adam Winer" <awi...@gmail.com>
Subject Re: RESTful JSF
Date Thu, 06 Apr 2006 15:25:17 GMT
On 4/6/06, Martin Marinschek <martin.marinschek@gmail.com> wrote:
> Adam,
>
> we've been through the phase listener approach already. Was nice, but
> with security it doesn't work out.
>
> How do you restrict what can be applied to the backing beans or the
> components? It's just not possible, except you configure it somehow.

Well, sure:  you have to configure it!  To do bookmarking right,
you need new metadata that doesn't exist anywhere .  You can
either put that metadata in the view - where it doesn't fit well - or
in the controller/NavigationHandler layer - where it fits naturally.
That means a custom NavigationHandler with a new configuration
file.

-- Adam


> John (I think) suggested to do it in the navigation rules of the
> faces-config.xml, but there it will be implementation specific, except
> you get it in the spec.
>
> So for now, the best solution will be to do the configuration in the
> view itself.
>
> regards,
>
> Martin
>
> On 4/5/06, Adam Winer <awiner@gmail.com> wrote:
> > Why do we need a component to take values out of the request and
> > apply them to a managed bean?  JSF managed-beans can do this
> > right now without putting anything in the component tree.
> >
> > I don't think bookmarkability is something that should be
> > approached from the perspective of the component tree - it
> > should be tackled as an application-level concern - generate
> > bookmarkable links via ViewHandler.createActionURL(), handle
> > restoring state on the incoming requests via a PhaseListener.
> >
> > -- Adam
> >
> >
> >
> > On 4/5/06, Mario Ivankovits <mario@ops.co.at> wrote:
> > > Hi!
> > > > 3) create a new component, which takes the values out of the request,
> > > > and reapplies them either to another component, or the managed bean.
> > > > It could look much like the aliasBean today.
> > > Ok, finally I think this is not that bad idea :-)
> > >
> > > It defines the possibilities within the view (which is my main
> > > requirement) and thus makes it easily possible to use all the jsf
> > > functionality.
> > >
> > > I propose to also have the possibility to attach converter/validators to it.
> > > So the tag will be something like:
> > >
> > > <t:getParam name="urlParamName" value="#{managedBean.property}">
> > >     <f:convertNumber
> > >         minFractionDigits="2"
> > >         groupingUsed="true" />
> > >     <f:validateLength maximum="10" minimum="2"/>
> > > </t:getParam>
> > >
> > >
> > > May I also propose to put all those getParam into a container elemenent
> > > - e.g. getParams
> > > This might make it possible to do e.g.
> > >
> > > <t:getParams renderBookmarkLink="true">
> > >     <f:facet name="text">
> > >         <h:outputText value="link value" />
> > >     </f:facet>
> > >     <t:getParam name="urlParamName" value="#{managedBean.property}">
> > >         <f:convertNumber
> > >             minFractionDigits="2"
> > >             groupingUsed="true" />
> > >         <f:validateLength maximum="10" minimum="2"/>
> > >     </t:getParam>
> > > </t:getParams>
> > >
> > > This will not only set the parameters to the property in case of a get
> > > request, but will also generate a "bookmark me" link. Using javascript
> > > only a single click will be required to add it to the favorites.
> > >
> > > For those not willing to use such links we can provide a way to add the
> > > parameters to the url by using a special navigation entry.
> > > Someone else on the ML mentioned it, but I dont know who it was - sorry.
> > >
> > >     <navigation-rule>
> > >         <navigation-case>
> > >             <from-outcome>MyOutcome</from-outcome>
> > >
> > > <to-view-id>/Bookmarkable.jsp?param=#{managerBean.property}</to-view-id>
> > >             <redirect />
> > >         </navigation-case>
> > >     </navigation-rule>
> > >
> > > In this case it is not possible to add a special converter, though one
> > > will be used if its possible to find one for the property-type.
> > >
> > > It will only work with <redirect/>, but I'll start fixing
> > > http://issues.apache.org/jira/browse/MYFACES-516 then there should be a
> > > problem with this.
> > > I know, it will work without fixing MYFACES-516 as the page is
> > > "bookmarkable", but I also think that such pages are able in dual mode,
> > > means: with or without previously added request parameters. And we still
> > > have to preserve stuff like messages, locales, etc.
> > >
> > > The real link generation should be routed through an interface to make
> > > it possible to create links ala TinyURL, encryption and/or compression.
> > >
> > >
> > > Looks like this will be a really nice solution.
> > > Lets define who does what ;-)
> > >
> > > Ciao,
> > > Mario
> > >
> > >
> >
>
>
> --
>
> http://www.irian.at
>
> Your JSF powerhouse -
> JSF Consulting, Development and
> Courses in English and German
>
> Professional Support for Apache MyFaces
>

Mime
View raw message