Package com.ocpsoft.pretty.faces.config.mapping

Examples of com.ocpsoft.pretty.faces.config.mapping.UrlAction


                        + "' referenced at method '" + actionSpec.getMethod().getName() + "' in class '"
                        + actionSpec.getMethod().getDeclaringClass().getName() + "'.");
            }

            // build UrlMapping
            UrlAction urlAction = new UrlAction();
            urlAction.setPhaseId(actionSpec.getPhaseId());
            urlAction.setOnPostback(actionSpec.isOnPostback());
            urlAction.setInheritable(actionSpec.isInheritable());

            // try to get bean name
            Class<?> clazz = actionSpec.getMethod().getDeclaringClass();

            // build expression
            PrettyExpression expression = buildPrettyExpression(clazz, actionSpec.getMethod().getName());
            urlAction.setAction(expression);

            // trace
            if (log.isTraceEnabled())
            {
               log.trace("Adding action expression '" + urlAction.getAction() + "' to mapping: " + mapping.getId());
            }

            // register this action
            mapping.addAction(urlAction);
View Full Code Here


      return result;
   }

   private UrlAction copy(UrlAction urlAction)
   {
      UrlAction result = new UrlAction();
      result.setAction(urlAction.getAction());
      result.setOnPostback(urlAction.onPostback());
      result.setPhaseId(urlAction.getPhaseId());
      result.setInheritable(urlAction.isInheritable());
      return result;
   }
View Full Code Here

      assertEquals(0, mapping.getQueryParams().size());
      assertEquals(1, mapping.getActions().size());
      assertEquals(0, mapping.getPathValidators().size());

      // validate action
      UrlAction action = mapping.getActions().get(0);
      assertEquals(PhaseId.RESTORE_VIEW, action.getPhaseId());

      // validate PrettyExpression
      assertNotNull(action.getAction());
      assertEquals(LazyExpression.class, action.getAction().getClass());
      LazyExpression actionExpression = (LazyExpression) action.getAction();
      assertEquals(ClassWithSingleLazyExpressionAction.class, actionExpression.getBeanClass());
      assertEquals("actionMethod", actionExpression.getComponent());

   }
View Full Code Here

      assertEquals(0, mapping.getQueryParams().size());
      assertEquals(1, mapping.getActions().size());
      assertEquals(0, mapping.getPathValidators().size());

      // validate action
      UrlAction action = mapping.getActions().get(0);
      assertEquals(PhaseId.RESTORE_VIEW, action.getPhaseId());

      // validate PrettyExpression
      assertNotNull(action.getAction());
      assertEquals(ConstantExpression.class, action.getAction().getClass());
      assertEquals("#{someBean.actionMethod}", action.getAction().getELExpression());

   }
View Full Code Here

      assertEquals(0, mapping.getQueryParams().size());
      assertEquals(2, mapping.getActions().size());
      assertEquals(0, mapping.getPathValidators().size());

      // validate first action
      UrlAction firstAction = mapping.getActions().get(0);
      assertEquals(PhaseId.RENDER_RESPONSE, firstAction.getPhaseId());
      assertNotNull(firstAction.getAction());
      assertEquals(LazyExpression.class, firstAction.getAction().getClass());
      LazyExpression firstActionExpression = (LazyExpression) firstAction.getAction();
      assertEquals(ClassWithMultipleActions.class, firstActionExpression.getBeanClass());
      assertEquals("actionMethod", firstActionExpression.getComponent());

      // validate second action
      UrlAction secondAction = mapping.getActions().get(1);
      assertEquals(PhaseId.INVOKE_APPLICATION, secondAction.getPhaseId());
      assertNotNull(secondAction.getAction());
      assertEquals(LazyExpression.class, secondAction.getAction().getClass());
      LazyExpression secondActionExpression = (LazyExpression) secondAction.getAction();
      assertEquals(ClassWithMultipleActions.class, secondActionExpression.getBeanClass());
      assertEquals("actionMethod", secondActionExpression.getComponent());

   }
View Full Code Here

                     + "' referenced at method '" + actionSpec.getMethod().getName() + "' in class '"
                     + actionSpec.getMethod().getDeclaringClass().getName() + "'.");
            }

            // build UrlMapping
            UrlAction urlAction = new UrlAction();
            urlAction.setPhaseId(actionSpec.getPhaseId());
            urlAction.setOnPostback(actionSpec.isOnPostback());

            // try to get bean name
            Class clazz = actionSpec.getMethod().getDeclaringClass();

            // build expression
            PrettyExpression expression = buildPrettyExpression(clazz, actionSpec.getMethod().getName());
            urlAction.setAction(expression);

            // trace
            if (log.isTraceEnabled())
            {
               log.trace("Adding action expression '" + urlAction.getAction() + "' to mapping: " + mapping.getId());
            }

            // register this action
            mapping.addAction(urlAction);
View Full Code Here

TOP

Related Classes of com.ocpsoft.pretty.faces.config.mapping.UrlAction

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.