Package org.ocpsoft.urlbuilder

Examples of org.ocpsoft.urlbuilder.Address


   @Override
   public boolean evaluate(final Rewrite event, final EvaluationContext context)
   {
      if ((event instanceof HttpOutboundServletRewrite) && rule.isOutbound())
      {
         Address outboundResource = ((HttpOutboundServletRewrite) event).getAddress();
         String outboundUrl = outboundResource.toString();

         String contextPath = ((HttpServletRewrite) event).getContextPath();
         if (!contextPath.equals("/") && outboundUrl.startsWith(contextPath))
            outboundUrl = outboundUrl.substring(contextPath.length());
View Full Code Here


               .perform(new HttpOperation() {

                  @Override
                  public void performHttp(HttpServletRewrite event, EvaluationContext context)
                  {
                     Address address = event.getAddress();
                     Response.addHeader("InboundURL", address.getPath() + "?" + address.getQuery())
                              .and(Response.addHeader("OutboundURL", event.getResponse().encodeURL(
                                       "/12345-query.xhtml?foo=bar&other=cab&kitty=meow")))
                              .and(SendStatus.code(207))
                              .perform(event, context);
                  }
View Full Code Here

                  query.addParameter(string, values.subList(1, values.size()).toArray(new String[] {}));
               }
            }
         }

         Address outboundAddress = ((HttpOutboundServletRewrite) event).getOutboundAddress();

         Substitute substitute = Substitute.with(requestPattern + query.toQueryString());
         substitute.setParameterStore(store);

         substitute.perform(event, context);

         Address rewrittenAddress = ((HttpOutboundServletRewrite) event).getOutboundAddress();
         String rewrittenPath = rewrittenAddress.getPath();
         String contextPath = ((HttpServletRewrite) event).getContextPath();
         if (!contextPath.equals("/") && rewrittenPath.startsWith(contextPath))
            rewrittenPath = rewrittenPath.substring(contextPath.length());

         if (!outboundAddress.equals(rewrittenAddress)
View Full Code Here

   }

   @Override
   public String encodeRedirectURL(final String url)
   {
      Address address = AddressBuilder.create(URLBuilder.createFrom(url).toURL());
      OutboundServletRewrite<ServletRequest, ServletResponse, Address> event = rewrite(address);

      if (event.getFlow().is(ServletRewriteFlow.ABORT_REQUEST))
      {
         return event.getOutboundAddress().toString();
View Full Code Here

   }

   @Override
   public String encodeURL(final String url)
   {
      Address address = AddressBuilder.create(URLBuilder.createFrom(url).toURL());
      OutboundServletRewrite<ServletRequest, ServletResponse, Address> event = rewrite(address);

      if (event.getFlow().is(ServletRewriteFlow.ABORT_REQUEST))
      {
         return event.getOutboundAddress().toString();
View Full Code Here

TOP

Related Classes of org.ocpsoft.urlbuilder.Address

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.