fix modify request path on virtual host
*/
package org.codelibs.fess.mylasta.direction.sponsor;
+import org.codelibs.core.lang.StringUtil;
+import org.codelibs.fess.util.ComponentUtil;
import org.dbflute.util.DfTypeUtil;
import org.lastaflute.web.path.ActionAdjustmentProvider;
import org.lastaflute.web.path.FormMappingOption;
@@ -36,6 +38,22 @@ public class FessActionAdjustmentProvider implements ActionAdjustmentProvider {
});
}
+ @Override
+ public String customizeActionMappingRequestPath(String requestPath) {
+ if (StringUtil.isBlank(requestPath)) {
+ return null;
+ }
+ final String virtualHostKey = ComponentUtil.getFessConfig().getVirtualHostKey();
+ if (StringUtil.isBlank(virtualHostKey)) {
+ return null;
+ }
+ final String prefix = "/" + virtualHostKey;
+ if (requestPath.startsWith(prefix)) {
+ return requestPath.substring(prefix.length());
+ }
+ return null;
+ }
+
@Override
public String toString() {
return DfTypeUtil.toClassTitle(this) + ":{}";
