Andrew Robinson wrote:
Just to add to your list
3) Create a "bookmark this page" link as part of each page (create a
custom control, or just use a facelets template) and have that link
represent all the query string parameters needed to re-build your
backing beans. Then, using managed properties or, if you use Seam, use
the @RequestParameter attribute, or just check the request parameters,
re-load the data. You could make a special servlet to auto-load data
as you see fit for these URLs as well.

There are many ways to approach this one, all with pros and cons.
Perhaps someone can build a reusable one at some point.

A con shared by any variation on this scheme is the users - they
are used to using a browser control not an on-page control and
some users stick to what they know like glue. Also, IE users
don't even know what "bookmarks" are, because they have
"favourites" instead.

J.

On 5/14/06, Jonathan Harley <[EMAIL PROTECTED]> wrote:

Chrisi wrote:
> Quoting Quintin:
>
>> > One way to do it is mark all your navigation for redirect .....
>
> That's possible. But you still have two major drawbacks:
> - Your request-scope bean-data get lost if you use the redirect navigation
> - You still can't bookmark and crawl all those pages, because
> parameters are not shown in the url and the first JSF request contains
> always "empty data"

Indeed - but if there are parameters, that's normally because they are
things that a user has chosen. Spiders do not choose things from forms.
In general, you do not want spiders to index pages which are built
dynamically from choices made by a user (although there are exceptions).

> Quoting Francesco:
>
>> .....We obtained
>> this result mainly by using outputLinks instead of commandLinks for
>> passing parameters to pages.
>
> Ok, this seems to work. ;) But then, what is the advantage of using JSF
> when
> using outputLinks?  You are leaving the typicall JSF life-cycle and
> therefore the nice JSF features.  It's comparable to use the good old
> MVC style...

One approach is to use outputLinks (or just plain HTML) to reach pages
which you want indexed, and commandLinks where you want JSFy goodness.
Mix and match! After all, many apps will have some pages which are
fairly static and need to be indexable (eg product pages) and some
which are fully dynamic (eg pages for placing an order).

That solves the crawling problem but not bookmarking. Users will
bookmark any JSF page, expecting this to work in the normal way, only
of course it doesn't if you've just posted a form because then the
browser has the URL for the old page. There are (at least) two
approaches to this:

1) disallow bookmarking by using a filter to catch direct accesses
to JSF pages without a session (as when a user jumps into the middle
of the app from a bookmark); the filter can redirect them to a "start
here" page.

2) use a redirect for pages that you want to be bookmarkable. Again,
some pages should be bookmarkable (products) and some not (ordering).

Jon.
--
.....................................................................
           Dr Jonathan Harley   .
                                .   Email: [EMAIL PROTECTED]
            Zac Parkplatz Ltd   .   Office Telephone: 024 7633 1375
            www.parkplatz.net   .   Mobile: 079 4116 0423



--
____________________ ____ ____________________________________________________
 With metta from:    \ _/__   In the north sky time flies fast to the morning
  [EMAIL PROTECTED]        \X  /  The cold of the dawn it meant nothing to us, 
you
 http://serf.org/jon/   \/  were keeping your best situation an answer to yes

Reply via email to