test_class.declarator: X_FORWARD_HOST_HEADER = "X-Forwarded-Host"
test_class.modifier: private static final
test_class.original_string: private static final String X_FORWARD_HOST_HEADER = "X-Forwarded-Host";
test_class.type: String
test_class.var_name: X_FORWARD_HOST_HEADER
test_class.declarator: X_GWT_MODULE_HEADER = "X-GWT-Module-Base"
test_class.modifier: private static final
test_class.original_string: private static final String X_GWT_MODULE_HEADER = "X-GWT-Module-Base";
test_class.type: String
test_class.var_name: X_GWT_MODULE_HEADER
test_class.file: common-servlet/src/test/java/org/geomajas/servlet/AutomaticDispatcherUrlServiceTest.java
test_class.identifier: AutomaticDispatcherUrlServiceTest
test_case.body: @Test
  	public void testLocalizeAutomatic() {
  		AutomaticDispatcherUrlService adus = new AutomaticDispatcherUrlService();
  
  		// set mock request in context holder
  		MockHttpServletRequest mockRequest = new MockHttpServletRequest();
  		mockRequest.setScheme("http");
  		mockRequest.setServerName("myhost");
  		mockRequest.setServerPort(80);
  		mockRequest.setLocalName("localhost");
  		mockRequest.setLocalPort(8080);
  		mockRequest.setContextPath("/test");
  		mockRequest.addHeader(X_FORWARD_HOST_HEADER, "geomajas.org");
  		ServletRequestAttributes attributes = new ServletRequestAttributes(mockRequest);
  		RequestContextHolder.setRequestAttributes(attributes);
  		Assert.assertEquals("http://localhost:8080/test/d/something", adus.localize("http://geomajas.org/test/d/something"));
  
  		// clean up
  		RequestContextHolder.setRequestAttributes(null);
  	}
test_case.class_method_signature: AutomaticDispatcherUrlServiceTest.testLocalizeAutomatic()
test_case.full_signature: @Test public void testLocalizeAutomatic()
test_case.identifier: testLocalizeAutomatic
test_case.invocations: setScheme setServerName setServerPort setLocalName setLocalPort setContextPath addHeader setRequestAttributes assertEquals localize setRequestAttributes
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testLocalizeAutomatic()
focal_class.declarator: serialVersionUID = 110L
focal_class.modifier: private static final
focal_class.original_string: private static final long serialVersionUID = 110L;
focal_class.type: long
focal_class.var_name: serialVersionUID
focal_class.declarator: X_FORWARD_HOST_HEADER = "X-Forwarded-Host"
focal_class.modifier: private static final
focal_class.original_string: private static final String X_FORWARD_HOST_HEADER = "X-Forwarded-Host";
focal_class.type: String
focal_class.var_name: X_FORWARD_HOST_HEADER
focal_class.declarator: X_GWT_MODULE_HEADER = "X-GWT-Module-Base"
focal_class.modifier: private static final
focal_class.original_string: private static final String X_GWT_MODULE_HEADER = "X-GWT-Module-Base";
focal_class.type: String
focal_class.var_name: X_GWT_MODULE_HEADER
focal_class.declarator: log = LoggerFactory.getLogger(AutomaticDispatcherUrlService.class)
focal_class.modifier: private final
focal_class.original_string: private final Logger log = LoggerFactory.getLogger(AutomaticDispatcherUrlService.class);
focal_class.type: Logger
focal_class.var_name: log
focal_class.declarator: localDispatcherUrl
focal_class.modifier: private
focal_class.original_string: private String localDispatcherUrl;
focal_class.type: String
focal_class.var_name: localDispatcherUrl
focal_class.file: common-servlet/src/main/java/org/geomajas/servlet/AutomaticDispatcherUrlService.java
focal_class.identifier: AutomaticDispatcherUrlService
focal_class.interfaces: implements DispatcherUrlService
focal_class.class_method_signature: AutomaticDispatcherUrlService.getDispatcherUrl()
focal_class.full_signature: @Override public String getDispatcherUrl()
focal_class.identifier: getDispatcherUrl
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getDispatcherUrl()
focal_class.class_method_signature: AutomaticDispatcherUrlService.getLocalDispatcherUrl()
focal_class.full_signature: @Override public String getLocalDispatcherUrl()
focal_class.identifier: getLocalDispatcherUrl
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getLocalDispatcherUrl()
focal_class.class_method_signature: AutomaticDispatcherUrlService.setLocalDispatcherUrl(String localDispatcherUrl)
focal_class.full_signature: @Api public void setLocalDispatcherUrl(String localDispatcherUrl)
focal_class.identifier: setLocalDispatcherUrl
focal_class.modifiers: @Api public
focal_class.parameters: (String localDispatcherUrl)
focal_class.return: void
focal_class.signature: void setLocalDispatcherUrl(String localDispatcherUrl)
focal_class.class_method_signature: AutomaticDispatcherUrlService.localize(String externalUrl)
focal_class.full_signature: @Override public String localize(String externalUrl)
focal_class.identifier: localize
focal_class.modifiers: @Override public
focal_class.parameters: (String externalUrl)
focal_class.return: String
focal_class.signature: String localize(String externalUrl)
focal_class.class_method_signature: AutomaticDispatcherUrlService.getBasePathForHostNamePort(HttpServletRequest request, String hostName, int port)
focal_class.full_signature: private String getBasePathForHostNamePort(HttpServletRequest request, String hostName, int port)
focal_class.identifier: getBasePathForHostNamePort
focal_class.modifiers: private
focal_class.parameters: (HttpServletRequest request, String hostName, int port)
focal_class.return: String
focal_class.signature: String getBasePathForHostNamePort(HttpServletRequest request, String hostName, int port)
focal_method.body: @Override
  	public String localize(String externalUrl) {
  		String localBase = getLocalDispatcherUrl();
  		String dispatcherBase = getDispatcherUrl();
  		if (externalUrl.startsWith(dispatcherBase)) {
  			return localBase + externalUrl.substring(dispatcherBase.length());
  		} else {
  			// not a dispatcher url, return the original one
  			return externalUrl;
  		}
  	}
focal_method.class_method_signature: AutomaticDispatcherUrlService.localize(String externalUrl)
focal_method.full_signature: @Override public String localize(String externalUrl)
focal_method.identifier: localize
focal_method.invocations: getLocalDispatcherUrl getDispatcherUrl startsWith substring length
focal_method.modifiers: @Override public
focal_method.parameters: (String externalUrl)
focal_method.return: String
focal_method.signature: String localize(String externalUrl)