Class WicketUtils


  • public class WicketUtils
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      WicketUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String getAbsoluteUrlToContextRoot()
      Will return a full URL such as "http://hostname:port/main/" Implemented as:
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • WicketUtils

        public WicketUtils()
    • Method Detail

      • getAbsoluteUrlToContextRoot

        public static java.lang.String getAbsoluteUrlToContextRoot()
        Will return a full URL such as "http://hostname:port/main/" Implemented as:

         Request request = RequestCycle.get().getRequest();
         HttpServletRequest servletReq = (HttpServletRequest) request.getContainerRequest();
         String ctx = request.getContextPath();
         String host = servletReq.getServerName();
         int port = servletReq.getServerPort();
         String scheme = servletReq.getScheme();
         return String.format("%s://%s:%d%s", scheme, host, port, ctx);