public String[] getDispatcherNames() { ArrayList<String> result = new ArrayList<String>(); if ((dispatcherMapping & FORWARD) > 0) { result.add(DispatcherType.FORWARD.name()); } if ((dispatcherMapping & INCLUDE) > 0) { result.add(DispatcherType.INCLUDE.name()); } if ((dispatcherMapping & REQUEST) > 0) { result.add(DispatcherType.REQUEST.name()); } if ((dispatcherMapping & ERROR) > 0) { result.add(DispatcherType.ERROR.name()); } if ((dispatcherMapping & ASYNC) > 0) { result.add(DispatcherType.ASYNC.name()); } return result.toArray(new String[result.size()]); }
/** * This method will be used to set the current state of the FilterMap representing the state of * when filters should be applied. */ public void setDispatcher(String dispatcherString) { String dispatcher = dispatcherString.toUpperCase(Locale.ENGLISH); if (dispatcher.equals(DispatcherType.FORWARD.name())) { // apply FORWARD to the global dispatcherMapping. dispatcherMapping |= FORWARD; } else if (dispatcher.equals(DispatcherType.INCLUDE.name())) { // apply INCLUDE to the global dispatcherMapping. dispatcherMapping |= INCLUDE; } else if (dispatcher.equals(DispatcherType.REQUEST.name())) { // apply REQUEST to the global dispatcherMapping. dispatcherMapping |= REQUEST; } else if (dispatcher.equals(DispatcherType.ERROR.name())) { // apply ERROR to the global dispatcherMapping. dispatcherMapping |= ERROR; } else if (dispatcher.equals(DispatcherType.ASYNC.name())) { // apply ERROR to the global dispatcherMapping. dispatcherMapping |= ASYNC; } }