You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Yaron Spektor <ya...@b6systems.com> on 2008/01/16 23:10:11 UTC

conversion in jsf

Hi ,
I was wondering about the conversion mechanism that is done
automatically in jsf.
When I bind a value to an input field, for example, how and where in the
code does JSF realize which converter to setup ( Long or a String etc.)
I see it is doing it, I know how to override it but I am interested to
know the inside details of it.

Thanks,
Yaron 


RE: conversion in jsf

Posted by Yaron Spektor <ya...@b6systems.com>.
Thanks for your answer,

I Googled it and found your article about customizing it for JSF.

I was wondering though, can I get the default property resolver to work
for me in cases where I do not use the binding (I am creating a
framework that does not use the concept of binding but would like to
engage the existing JSF code to do the job for it)

Any hints would be great.

 

Yaron 

 

________________________________

From: Cagatay Civici [mailto:cagatay.civici@gmail.com] 
Sent: Wednesday, January 16, 2008 5:46 PM
To: MyFaces Discussion
Subject: Re: conversion in jsf

 

When you bind sth, like #{mybean.someInteger}

The property resolver resolves the type of someInteger property to an
integer, and later this is used to figure out the necessary converter to
use automatically, in this case it is numberconverter to convert the
submitted string value to an integer. This is same in other cases. 

In order to override this process, write a converter and add it via
<f:converter tag or the converter attribute. So your converter will be
picked before jsf tries to identify a converter by type.

Cagatay 

On Jan 17, 2008 12:10 AM, Yaron Spektor <ya...@b6systems.com>
wrote:

Hi ,
I was wondering about the conversion mechanism that is done
automatically in jsf.
When I bind a value to an input field, for example, how and where in the
code does JSF realize which converter to setup ( Long or a String etc.) 
I see it is doing it, I know how to override it but I am interested to
know the inside details of it.

Thanks,
Yaron

 


Re: conversion in jsf

Posted by Cagatay Civici <ca...@gmail.com>.
When you bind sth, like #{mybean.someInteger}

The property resolver resolves the type of someInteger property to an
integer, and later this is used to figure out the necessary converter to use
automatically, in this case it is numberconverter to convert the submitted
string value to an integer. This is same in other cases.

In order to override this process, write a converter and add it via
<f:converter tag or the converter attribute. So your converter will be
picked before jsf tries to identify a converter by type.

Cagatay

On Jan 17, 2008 12:10 AM, Yaron Spektor <ya...@b6systems.com> wrote:

> Hi ,
> I was wondering about the conversion mechanism that is done
> automatically in jsf.
> When I bind a value to an input field, for example, how and where in the
> code does JSF realize which converter to setup ( Long or a String etc.)
> I see it is doing it, I know how to override it but I am interested to
> know the inside details of it.
>
> Thanks,
> Yaron
>
>