Adam,
That's solved straightforwardly with indirection, so that
you have, say, a DocumentProviderBean with get/setId() and
getDocument() on it, and getDocument() has the code to handle
converting the ID into an appropriate object - presumably with a
trivial call to your DAO layer. The request parameter goes
to the DocumentProviderBean, and your page gets the document
out of the document provider.
Do other frameworks make this pattern significantly simpler?
If so, how?
-- Adam
On 4/14/06, Adam Brod <[EMAIL PROTECTED]> wrote:
>
> Hey Adam-
>
> The most common type of GET requests I've had trouble with in JSF is binding
> request parameters to complex managed bean parameters.
>
> For (a simple) example, say I have a link
> /faces/vewDocument.xhtml?documentID=1234.
> viewDocument.xhtml has a backing bean ("documentController") with a managed
> property named "documentID" and value "#{params.documentID}".
> DocumentController.setDocumentID() takes a
> DocumentIdentifier object, not a primitive.
>
> Can JSF convert the request parameter to an object even though the request
> goes directly to the render phase? Will a Converter work or will JSF
> auto-wire this since it can see that the target setDocumentID(...) method
> takes a parameter of type DocumentIdentifier?
>
> Thanks for your input.
>
> Adam Brod
> Product Development Team
>