Reply To: DynaView causes NPE in PrimeExceptionHandler

Splash Forums PrettyFaces Users DynaView causes NPE in PrimeExceptionHandler Reply To: DynaView causes NPE in PrimeExceptionHandler

#26669

Basically, the inbound part of a rule that forwards an incoming request to some internal URL, looks like this:

.addRule()
.when(Direction.isInbound().and(Path.matches("/view/2")))
.perform(Forward.to("/faces/view.xhtml"))

You can now just created your own HttpOperation which does some calculation upfront to determine which view to forward to. This could look like this:

.addRule()
.when(Direction.isInbound().and(Path.matches("/view/2")))
.perform(new HttpOperation() {
   @Override
   public void performHttp(HttpServletRewrite event, EvaluationContext context)
   {
      
      String viewId = ....;
      
      Forward.to(viewId).perform(event, context);
      
   }
})

I hope this helps.