Hi Stephane,

sure you can do a redirect in your action-method - you have access to
all servlet-specific methods by casting:

facesContext.getExternalContext().getResponse()

to HttpServletResponse and then call:

response.sendRedirect(response.encodeRedirectURL(contextPath + "/maps"));

regards,

Martin

On 6/20/07, Adam Winer <[EMAIL PROTECTED]> wrote:
I'd just handle this on the server:  set defaultCommand
on the enclosing form, and make the actionListener
on the server do the redirect.

-- Adam



On 6/20/07, Stéphane Poirier <[EMAIL PROTECTED]> wrote:
> Hi,
>
> My problem include 2 know issues in the same time:
>
> When a use hit the "Enter" key in a inputText, I want the form to submit.
> There are 2 different destinations where to redirect :
> - refresh the same page with an error message if input is not correct
> - redirect to an external link if input is OK
>
> My problem is: with an external link, I don't think a standard Action can bu
> used to redirect, so I can't simply add a Javascript to call onClick() on a
> commandButton (to simulate the Enter key submit)
>
> Anyone knows how to achieve this?
>
> Thanks in advance!



--

http://www.irian.at

Your JSF powerhouse -
JSF Consulting, Development and
Courses in English and German

Professional Support for Apache MyFaces

Reply via email to