Why do you say that parameters do not stay put? JSF uses the normal
servlet API to handle parameters, the code is excactly the same as JSP
which also just uses the servlet container code
On 5/4/08, Guy Bashan <[EMAIL PROTECTED]> wrote:
> Hi,
>
>
>
> I read about JSF pretty url solution, for solving JSF post problem, when url
> parameters are getting lost after submitting the page.
>
> As far as I understand, the parameters in the url are injected directly to
> the bean.
>
> The thing that I cannot understand, in what cases this solution is usable?
> In most of the pages, parameters used to load data to the object.
>
> For example, for editing car details I would use: car_details.jspx?carId=5.
>
> The data of the form is being loaded in the constructor.
>
> So I will do something like this in the bean constructor:
>
> Id = getParamFromRequest("carId");
>
> If (Id != null) // Edit existing car
>
> {
>
> car = loadCar(Id);
>
> }
>
> Else // Enter new car details
>
> {
>
> Car = new Car();
>
> }
>
>
>
> Now, how can I use prett url? By injecting the parameter directly to the
> bean, the constructor will be activated first, then the setter.
>
> One may say, initialize the Car object in the setter method of the bean.
>
> Is it a trivial solution? (It looks a bit not neat initializing object in a
> setter method).
>
>
>
> Why JSF has never supplied a decent solution to this problem? This is a
> critical issue in web development (not loosing parameters after a post
> operation).
>
> Why are parameters does not stay after post? In regular JSP post operation,
> the parameters are preserved.
>
>
>
> Thanks,
>
> Guy.
>
>