You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Brad Smith <bg...@bendcable.com> on 2006/09/06 00:46:49 UTC
Bookmarkable Application URLs
I am designing and building a web application with JSF (MyFaces of
course) that manages information about Projects for a large organization
with several hundred offices. One requirement is to generate a display
of the projects for a given office, and be able to create a link from
the local office web site to the project listing for that office.
With Struts I could create an http Get with the appropriate query
parameters, e.g. http://project.app/app_context/office_list?id=xyz.
I am somewhat new to JSF and have read that http GET is not allowed (?)
by the spec. In any case, I have read the email from Martin Marinschek
that proposes (Bookmarking, History and JSF) to add this functionality
to MyFaces.
So is this possible now? If so, could someone please point me to the
necessary javadoc or wiki page or other useful information?
Thanks
Brad
Re: Bookmarkable Application URLs
Posted by Paul Devine <de...@gmail.com>.
Hi Brad
This one seems to be a common misconception floating around. There is
nothing to stop you from using GET based requests. A possible approach would
be to have your backing bean have a managed property that is auto-populated
from the request parameter (`id` in your example.) This approach has worked
well for us. For example in your faces-config.xml (this is not all correct
syntax):
<managed-bean>
name: projectListingBean
class: com.acme.ui.ProjectListingBean
<managed-property>
<name>officeId</name>
<value>#{param.officeId}</value>
</managed-property>
</managed-bean>
In projectListing.jsp you would presumably use the faces dataList tag or
something similar to iterate over and display the list of projects:
<h:dataList value="#{projectListingBean.projects}" ....>
....whatever columns you would want to display for each project...
And in the backing bean java code you would have a getProjects() method that
returns a List, and an instance variable officeId that is populated earlier
in the request processing cycle.
-Paul
On 9/5/06, Brad Smith <bg...@bendcable.com> wrote:
>
> I am designing and building a web application with JSF (MyFaces of
> course) that manages information about Projects for a large organization
> with several hundred offices. One requirement is to generate a display
> of the projects for a given office, and be able to create a link from
> the local office web site to the project listing for that office.
>
> With Struts I could create an http Get with the appropriate query
> parameters, e.g. http://project.app/app_context/office_list?id=xyz.
>
> I am somewhat new to JSF and have read that http GET is not allowed (?)
> by the spec. In any case, I have read the email from Martin Marinschek
> that proposes (Bookmarking, History and JSF) to add this functionality
> to MyFaces.
>
> So is this possible now? If so, could someone please point me to the
> necessary javadoc or wiki page or other useful information?
>
> Thanks
>
> Brad
>
>
>
>