Doubt in the action method

Should the action method always contain a return type.

The return type is provided to specify the target to navigate.

Can't the target be specified in any other way for an action method without a return type.

I have an application where I have to add the user details to the database. Whenever the profile is added, the application should be notified. The managed bean (myBean) implements a listener, and the notification is done by overriding the abstract method, whose return type is void. I can't change the signature of this method.

The add functionality is implemented in the Listener's abstract method.

and the add functionality is invoked as follows

<h:commandButton action="myBean"/>

But If I have to specify a different target, for eg to display the error page How do i do this?

Please suggest some workaround.

[883 byte] By [sreedevi2006a] at [2007-10-2 21:34:29]
# 1

You can specify the action to return null (mantains the current page).

If return <> than null then given the returned string, navigate to the indicated page.

If you want to go to a error page, then specify someting like "error" and then in the faces-config, do the navigation rules.

pringia at 2007-7-14 0:48:21 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...