Examples of UrlMapping


Examples of com.ocpsoft.pretty.faces.annotation.URLMapping

      // list of all mapping IDs found on the class
      List<String> classMappingIds = new ArrayList<String>();

      // get reference to @URLMapping annotation
      URLMapping mappingAnnotation = (URLMapping) clazz.getAnnotation(URLMapping.class);

      // process annotation if it exists
      if (mappingAnnotation != null)
      {
         String mappingId = processPrettyMappingAnnotation(clazz, mappingAnnotation);
View Full Code Here

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

        return mappings;
    }

    private UrlMapping buildPrettyFacesUrlMapping(String viewId, Annotation annotation, String facesMapping) {
        org.jboss.seam.faces.rewrite.UrlMapping urlMappingAnnotation = (org.jboss.seam.faces.rewrite.UrlMapping) annotation;
        UrlMapping urlMapping = new UrlMapping();
        urlMapping.setViewId(buildViewUrl(viewId, facesMapping));
        urlMapping.setId(viewId);
        urlMapping.setOnPostback(urlMappingAnnotation.onPostback());
        urlMapping.setOutbound(urlMappingAnnotation.outbound());
        urlMapping.setPattern(urlMappingAnnotation.pattern());
        return urlMapping;
    }
View Full Code Here

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

      String result = null;
      if (prettyContext.isPrettyRequest() && (viewId != null)
               && viewId.equals(context.getViewRoot().getViewId()))
      {
         ExtractedValuesURLBuilder builder = new ExtractedValuesURLBuilder();
         UrlMapping mapping = prettyContext.getCurrentMapping();
         result = prettyContext.getContextPath() + builder.buildURL(mapping) + builder.buildQueryString(mapping);
      }
      return result;
   }
View Full Code Here

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

   public void validateParameters(final FacesContext context)
   {
      log.trace("Validating parameters.");
      PrettyContext prettyContext = PrettyContext.getCurrentInstance(context);
      URL url = prettyContext.getRequestURL();
      UrlMapping mapping = prettyContext.getCurrentMapping();

      if (mapping != null)
      {
         validatePathParams(context, url, mapping);
         validateQueryParams(context, mapping);
View Full Code Here

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

   }

   @Test
   public void testGetMappingById()
   {
      UrlMapping mapping2 = config.getMappingById("testid");
      assertEquals(mapping, mapping2);
   }
View Full Code Here

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

   }

   @Test
   public void testGetMappingByNullIdReturnsNull()
   {
      UrlMapping mapping2 = config.getMappingById(null);
      assertEquals(null, mapping2);
   }
View Full Code Here

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

   }

   @Test
   public void testGetMappingForUrl()
   {
      UrlMapping mapping2 = config.getMappingForUrl(new URL("/home/en/test/"));
      assertEquals(mapping, mapping2);
   }
View Full Code Here

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

   }

   @Test
   public void testParse()
   {
      UrlMapping mapping = config.getMappingById("0");

      assertEquals("0", mapping.getId());
      assertEquals("/project/#{pid:viewProjectBean.projectId}/", mapping.getPattern());
      assertEquals("/faces/viewProject.xhtml", mapping.getViewId());
   }
View Full Code Here

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

   }

   @Test
   public void testParse()
   {
      UrlMapping mapping = config.getMappingById("0");

      assertEquals("0", mapping.getId());
      assertEquals("/project/#{viewProjectBean.projectId}/", mapping.getPattern());
      assertEquals("#{viewProjectBean.getPrettyTarget}", mapping.getViewId());

      List<UrlAction> actions = mapping.getActions();
      assertTrue(actions.contains(new UrlAction("#{viewProjectBean.load}")));
      assertTrue(actions.contains(new UrlAction("#{viewProjectBean.authorize}")));
   }
View Full Code Here

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

   }

   @Test
   public void testOnPostbackDefaultsToTrue()
   {
      UrlMapping mapping = config.getMappingById("0");
      assertEquals(true, mapping.isOnPostback());
   }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.