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.

 

Regards,

Yee

 


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]> wrote:


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

<h:commandLink immediate="true" action="">         <f:param name="username" value="#{ summary.id}"/>
          <h:outputText value="#{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