Skip to content

Commit

Permalink
[WFLY-11764] Make getServletPath return action name or jsp name confi…
Browse files Browse the repository at this point in the history
…gurable
  • Loading branch information
spyrkob authored and kabir committed Sep 12, 2019
1 parent d4c961f commit 27baef9
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ public void installRuntimeServices(OperationContext context, ModelNode model, St
final ModelNode fileCacheTtlNode = ServletContainerDefinition.FILE_CACHE_TIME_TO_LIVE.resolveModelAttribute(context, model);
final Integer fileCacheTimeToLive = fileCacheTtlNode.isDefined() ? fileCacheTtlNode.asInt() : null;
final int defaultCookieVersion = ServletContainerDefinition.DEFAULT_COOKIE_VERSION.resolveModelAttribute(context, model).asInt();
final boolean preservePathOnForward = Boolean.parseBoolean(System.getProperty("io.undertow.servlet.dispatch.preserve_path_of_forward", "false"));

Boolean directoryListingEnabled = null;
if(model.hasDefined(Constants.DIRECTORY_LISTING)) {
Expand Down Expand Up @@ -138,7 +139,8 @@ public void installRuntimeServices(OperationContext context, ModelNode model, St
disableCachingForSecuredPages, webSocketInfo != null, webSocketInfo != null && webSocketInfo.isDispatchToWorker(),
webSocketInfo != null && webSocketInfo.isPerMessageDeflate(), webSocketInfo == null ? -1 : webSocketInfo.getDeflaterLevel(),
mimeMappings,
welcomeFiles, directoryListingEnabled, proactiveAuth, sessionIdLength, authenticationMechanisms, maxSessions, crawlerSessionManagerConfig, disableFileWatchService, disableSessionIdReususe, fileCacheMetadataSize, fileCacheMaxFileSize, fileCacheTimeToLive, defaultCookieVersion);
welcomeFiles, directoryListingEnabled, proactiveAuth, sessionIdLength, authenticationMechanisms, maxSessions, crawlerSessionManagerConfig, disableFileWatchService, disableSessionIdReususe, fileCacheMetadataSize, fileCacheMaxFileSize, fileCacheTimeToLive, defaultCookieVersion,
preservePathOnForward);


final CapabilityServiceBuilder<?> builder = context.getCapabilityServiceTarget()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,15 @@ public class ServletContainerService implements Service<ServletContainerService>
private final int fileCacheMaxFileSize;
private final Integer fileCacheTimeToLive;
private final int defaultCookieVersion;
private boolean preservePathOnForward;

public ServletContainerService(boolean allowNonStandardWrappers, ServletStackTraces stackTraces, SessionCookieConfig sessionCookieConfig, JSPConfig jspConfig,
String defaultEncoding, boolean useListenerEncoding, boolean ignoreFlush, boolean eagerFilterInit, int defaultSessionTimeout,
boolean disableCachingForSecuredPages, boolean websocketsEnabled, boolean dispatchWebsocketInvocationToWorker, boolean perMessageDeflate,
int deflaterLevel, Map<String, String> mimeMappings, List<String> welcomeFiles, Boolean directoryListingEnabled, boolean proactiveAuth,
int sessionIdLength, Map<String, AuthenticationMechanismFactory> authenticationMechanisms, Integer maxSessions,
CrawlerSessionManagerConfig crawlerSessionManagerConfig, boolean disableFileWatchService, boolean disableSessionIdReuse, int fileCacheMetadataSize, int fileCacheMaxFileSize, Integer fileCacheTimeToLive, int defaultCookieVersion) {
CrawlerSessionManagerConfig crawlerSessionManagerConfig, boolean disableFileWatchService, boolean disableSessionIdReuse, int fileCacheMetadataSize, int fileCacheMaxFileSize, Integer fileCacheTimeToLive, int defaultCookieVersion,
boolean preservePathOnForward) {

this.allowNonStandardWrappers = allowNonStandardWrappers;
this.stackTraces = stackTraces;
Expand Down Expand Up @@ -121,6 +123,7 @@ public ServletContainerService(boolean allowNonStandardWrappers, ServletStackTra
this.fileCacheMaxFileSize = fileCacheMaxFileSize;
this.fileCacheTimeToLive = fileCacheTimeToLive;
this.defaultCookieVersion = defaultCookieVersion;
this.preservePathOnForward = preservePathOnForward;
}

@Override
Expand Down Expand Up @@ -278,4 +281,8 @@ public Integer getFileCacheTimeToLive() {
public int getDefaultCookieVersion() {
return defaultCookieVersion;
}

public boolean isPreservePathOnForward() {
return preservePathOnForward;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -1083,6 +1083,8 @@ public HttpHandler wrap(HttpHandler handler) {
}
d.setCrawlerSessionManagerConfig(servletContainer.getCrawlerSessionManagerConfig());

d.setPreservePathOnForward(servletContainer.isPreservePathOnForward());

return d;
} catch (ClassNotFoundException e) {
throw new StartException(e);
Expand Down

0 comments on commit 27baef9

Please sign in to comment.