See comments inline..

[PS:
  Because it's hard to read and hard to reply to.
  Why is top-posting bad?]

Yee CN wrote:
Graig,

I think that JSF is perhaps forgetting too much about URL. Bookmarking from client browser is almost impossible at present. Firstly with JSF the URL shown in the client browser usually trail one step behind the actual page being shown, and secondly we no longer have a URL of the form http://..../viewProduct.jsf?id=234.

I actually think URL parameter is very meaningful for both the web client and the server. It is a way to request a service from the server in a way that both the web client and the server can understand. I like to hear what you have to say on this.


For a true *web application* it doesn't make much sense for a user to leap right into the middle of the application. Only for very simply websites can a "get" command (which is all a bookmark can do) provide sufficient state to provide a useful page to the user. And JSF really isn't aimed at that "simple site" type market I think.

For any reasonablly complex webapp, I think the only thing that can be done is to take the user to the "start page" of that application, so bookmarking a page deep within the app doesn't make sense anyway.

However if you have a "view product" module that can reasonably be thought of as a separate web application that happens to be part of your site then you can allow users to bookmark the "start page" of that "application" by specifying REDIRECT in your navigation rules. This will ensure that the browser gets the right URL for bookmarking, at the price of some loss of performance.

NB: Just my personal opinion of course...

Regards,

Simon

------------------------------------------------------------------------

*From:* [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] *On Behalf Of *Craig McClanahan
*Sent:* Friday, 28 October 2005 9:42 AM
*To:* MyFaces Discussion
*Cc:* [EMAIL PROTECTED]
*Subject:* Re: How to pass parameters between pages..

On 10/27/05, *Lucio Piccoli* <[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:


    if u are going from page A - page B using a commandlink then u the
    <f:param>

    <h:commandLink immediate="true" action="#{BForm.detail}">
            <f:param name="username" value="#{ summary.id
    <http://summary.id>}"/>
              <h:outputText value="#{summary.id <http://summary.id>}"/>
    </h:commandLink>


While this solution is technically feasible, it has some problems, too:

* It restricts you to using hyperlinks instead of submit buttons.

* It requires the view tier to be aware of implementation details that
  properly belong in the model and controller tiers, so it makes your
  application more fragile when you change things later.

I'm somewhat of a radical on this topic, but I believe that developers of web *applications* should forget that URLs even exist, and focus on passing information on the server side (via request or session scoped attributes, as appropriate). Then, if you really really really find you need to get the view tier involved, use a hidden variable instead of explicit query string parameters. That way you can still leverage the standard form processing capabilities JSF provides.

Craig McClanahan


Reply via email to