Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

JSF question

  Asked By: Jose    Date: Jun 02    Category: Java    Views: 824

I have an update page which I can call from many places. after user clicks update button I need to go back to the caller page which can be different each time.
how do I get the navigation rule name?
I can get the caller servlet from url request but I need to return a string in my action method which is the name of navigation rule.



1 Answer Found

Answer #1    Answered By: Neil Turner     Answered On: Jun 02

It could be a rapid solution for the problem.



public class YourController {

String lastOutcomeName = "list";

public String edit() {
String param =

if(param != null && !param.trim().eaquals("")) {
lastOutcomeName = param;
} else {
lastOutcomeName = "list";

return "edit";

public String save() {
return lastOutcomeName;

public String cancel() {
return lastOutcomeName;


<h:commandLink value="Edit" action="#{yourController.edit}">
<f:param name="outcomeName" value="list"/>

<h:commandLink value="Edit" action="#{yourController.edit}">
<f:param name="outcomeName" value="view"/>

Didn't find what you were looking for? Find more on JSF question Or get search suggestion and latest updates.