Merge remote-tracking branch 'origin/master' into merge/master-to-7xx-2024-04-07

# Conflicts:
#	pom.xml
This commit is contained in:
Lukasz Lenart
2024-04-07 07:58:50 +02:00
39 changed files with 736 additions and 191 deletions
+7 -1
View File
@@ -13,7 +13,13 @@ notifications:
github:
del_branch_on_merge: true
protected_branches:
master: { }
master:
# contexts are the names of checks that must pass.
contexts:
- build
required_pull_request_reviews:
require_code_owner_reviews: true
required_approving_review_count: 1
autolink_jira:
- WW
dependabot_alerts: true
+1 -1
View File
@@ -17,7 +17,7 @@
The Apache Struts web framework
-------------------------------
[![Jenkins Build](https://builds.apache.org/buildStatus/icon?job=Struts%2FStruts+Core%2Fmaster)](https://ci-builds.apache.org/job/Struts/job/Struts%20Core/job/master/)
[![Build Status](https://ci-builds.apache.org/buildStatus/icon?job=Struts%2FStruts+Core%2Fmaster)](https://ci-builds.apache.org/job/Struts/job/Struts%20Core/job/master/)
[![Java Build](https://github.com/apache/struts/actions/workflows/maven.yml/badge.svg)](https://github.com/apache/struts/actions/workflows/maven.yml)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.apache.struts/struts2-core/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.apache.struts/struts2-core/)
[![Javadocs](https://javadoc.io/badge/org.apache.struts/struts2-core.svg)](https://javadoc.io/doc/org.apache.struts/struts2-core)
@@ -25,7 +25,6 @@ import org.apache.struts2.action.UploadedFilesAware;
import org.apache.struts2.dispatcher.multipart.UploadedFile;
import org.apache.struts2.interceptor.parameter.StrutsParameter;
import java.io.File;
import java.util.List;
/**
@@ -34,7 +33,7 @@ import java.util.List;
public class FileUploadAction extends ActionSupport implements UploadedFilesAware {
private String contentType;
private UploadedFile<File> uploadedFile;
private UploadedFile uploadedFile;
private String fileName;
private String caption;
private String originalName;
@@ -81,7 +80,7 @@ public class FileUploadAction extends ActionSupport implements UploadedFilesAwar
}
@Override
public void withUploadedFiles(List<UploadedFile<File>> uploadedFiles) {
public void withUploadedFiles(List<UploadedFile> uploadedFiles) {
this.uploadedFile = uploadedFiles.get(0);
this.fileName = uploadedFile.getName();
this.contentType = uploadedFile.getContentType();
@@ -22,61 +22,51 @@
package org.apache.struts2.showcase.fileupload;
import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.action.UploadedFilesAware;
import org.apache.struts2.dispatcher.multipart.UploadedFile;
import java.io.File;
import java.util.List;
/**
* Showcase action - mutiple file upload using array.
*
* @version $Date$ $Id$
*/
public class MultipleFileUploadUsingArrayAction extends ActionSupport {
public class MultipleFileUploadUsingArrayAction extends ActionSupport implements UploadedFilesAware {
private File[] uploads = new File[0];
private String[] uploadFileNames = new String[0];
private String[] uploadContentTypes = new String[0];
private List<UploadedFile> uploadedFiles;
public String upload() throws Exception {
System.out.println("\n\n upload2");
System.out.println("files:");
for (UploadedFile u : uploadedFiles) {
System.out.println("*** " + u + "\t" + u.length());
}
System.out.println("filenames:");
for (String n : getUploadFileNames()) {
System.out.println("*** " + n);
}
System.out.println("content types:");
for (String c : getUploadContentTypes()) {
System.out.println("*** " + c);
}
System.out.println("\n\n");
return SUCCESS;
}
public String upload() throws Exception {
System.out.println("\n\n upload2");
System.out.println("files:");
for (File u : uploads) {
System.out.println("*** " + u + "\t" + u.length());
}
System.out.println("filenames:");
for (String n : uploadFileNames) {
System.out.println("*** " + n);
}
System.out.println("content types:");
for (String c : uploadContentTypes) {
System.out.println("*** " + c);
}
System.out.println("\n\n");
return SUCCESS;
}
@Override
public void withUploadedFiles(List<UploadedFile> uploadedFiles) {
this.uploadedFiles = uploadedFiles;
}
public File[] getUpload() {
return this.uploads;
}
private String[] getUploadFileNames() {
return this.uploadedFiles.stream()
.map(UploadedFile::getOriginalName)
.toArray(String[]::new);
}
public void setUpload(File[] upload) {
this.uploads = upload;
}
private String[] getUploadContentTypes() {
return this.uploadedFiles.stream()
.map(UploadedFile::getContentType)
.toArray(String[]::new);
}
public String[] getUploadFileName() {
return this.uploadFileNames;
}
public void setUploadFileName(String[] uploadFileName) {
this.uploadFileNames = uploadFileName;
}
public String[] getUploadContentType() {
return this.uploadContentTypes;
}
public void setUploadContentType(String[] uploadContentType) {
this.uploadContentTypes = uploadContentType;
}
}
// END SNIPPET: entire-file
@@ -22,64 +22,56 @@
package org.apache.struts2.showcase.fileupload;
import com.opensymphony.xwork2.ActionSupport;
import org.apache.struts2.action.UploadedFilesAware;
import org.apache.struts2.dispatcher.multipart.UploadedFile;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
/**
* Showcase action - multiple file upload using List
*
* @version $Date$ $Id$
*/
public class MultipleFileUploadUsingListAction extends ActionSupport {
public class MultipleFileUploadUsingListAction extends ActionSupport implements UploadedFilesAware {
private List<File> uploads = new ArrayList<>();
private List<String> uploadFileNames = new ArrayList<>();
private List<String> uploadContentTypes = new ArrayList<>();
private List<UploadedFile> uploads = new ArrayList<>();
public List<UploadedFile> getUpload() {
return this.uploads;
}
public List<File> getUpload() {
return this.uploads;
}
@Override
public void withUploadedFiles(List<UploadedFile> uploads) {
this.uploads = uploads;
}
public void setUpload(List<File> uploads) {
this.uploads = uploads;
}
private List<String> getUploadFileNames() {
return this.uploads.stream()
.map(UploadedFile::getOriginalName)
.collect(Collectors.toList());
}
public List<String> getUploadFileName() {
return this.uploadFileNames;
}
private List<String> getUploadContentTypes() {
return this.uploads.stream()
.map(UploadedFile::getContentType)
.collect(Collectors.toList());
}
public void setUploadFileName(List<String> uploadFileNames) {
this.uploadFileNames = uploadFileNames;
}
public List<String> getUploadContentType() {
return this.uploadContentTypes;
}
public void setUploadContentType(List<String> contentTypes) {
this.uploadContentTypes = contentTypes;
}
public String upload() throws Exception {
System.out.println("\n\n upload1");
System.out.println("files:");
for (File u : uploads) {
System.out.println("*** " + u + "\t" + u.length());
}
System.out.println("filenames:");
for (String n : uploadFileNames) {
System.out.println("*** " + n);
}
System.out.println("content types:");
for (String c : uploadContentTypes) {
System.out.println("*** " + c);
}
System.out.println("\n\n");
return SUCCESS;
}
}
// END SNIPPET: entire-file
public String upload() throws Exception {
System.out.println("\n\n upload1");
System.out.println("files:");
for (UploadedFile u : uploads) {
System.out.println("*** " + u + "\t" + u.length());
}
System.out.println("filenames:");
for (String n : getUploadFileNames()) {
System.out.println("*** " + n);
}
System.out.println("content types:");
for (String c : getUploadContentTypes()) {
System.out.println("*** " + c);
}
System.out.println("\n\n");
return SUCCESS;
}
}
@@ -142,7 +142,9 @@ public abstract class XmlDocConfigurationProvider implements ConfigurationProvid
@Override
public void destroy() {
providerAllowlist.clearAllowlist(this);
if (providerAllowlist != null) {
providerAllowlist.clearAllowlist(this);
}
}
protected Class<?> allowAndLoadClass(String className) throws ClassNotFoundException {
@@ -20,7 +20,6 @@ package org.apache.struts2.action;
import org.apache.struts2.dispatcher.multipart.UploadedFile;
import java.io.File;
import java.util.List;
/**
@@ -36,6 +35,6 @@ public interface UploadedFilesAware {
*
* @param uploadedFiles a list of {@link UploadedFile}, cannot be null. It can be empty.
*/
void withUploadedFiles(List<UploadedFile<File>> uploadedFiles);
void withUploadedFiles(List<UploadedFile> uploadedFiles);
}
@@ -987,10 +987,12 @@ public class Dispatcher {
public HttpServletRequest wrapRequest(HttpServletRequest request) throws IOException {
// don't wrap more than once
if (request instanceof StrutsRequestWrapper) {
LOG.debug("Request already wrapped with: {}", StrutsRequestWrapper.class.getSimpleName());
return request;
}
if (isMultipartSupportEnabled(request) && isMultipartRequest(request)) {
LOG.debug("Wrapping multipart request with: {}", MultiPartRequestWrapper.class.getSimpleName());
request = new MultiPartRequestWrapper(
getMultiPartRequest(),
request,
@@ -999,6 +1001,7 @@ public class Dispatcher {
disableRequestAttributeValueStackLookup
);
} else {
LOG.debug("Wrapping request using: {}", StrutsRequestWrapper.class.getSimpleName());
request = new StrutsRequestWrapper(request, disableRequestAttributeValueStackLookup);
}
@@ -1013,6 +1016,7 @@ public class Dispatcher {
* @since 2.5.11
*/
protected boolean isMultipartSupportEnabled(HttpServletRequest request) {
LOG.debug("Support for multipart request is enabled: {}", multipartSupportEnabled);
return multipartSupportEnabled;
}
@@ -1027,9 +1031,12 @@ public class Dispatcher {
String httpMethod = request.getMethod();
String contentType = request.getContentType();
return REQUEST_POST_METHOD.equalsIgnoreCase(httpMethod) &&
contentType != null &&
multipartValidationPattern.matcher(contentType.toLowerCase(Locale.ENGLISH)).matches();
boolean isPostRequest = REQUEST_POST_METHOD.equalsIgnoreCase(httpMethod);
boolean isProperContentType = contentType != null && multipartValidationPattern.matcher(contentType.toLowerCase(Locale.ENGLISH)).matches();
LOG.debug("Validating if this is a proper Multipart request. Request is POST: {} and ContentType matches pattern ({}): {}",
isPostRequest, multipartValidationPattern, isProperContentType);
return isPostRequest && isProperContentType;
}
/**
@@ -46,7 +46,7 @@ import java.util.Map;
* Abstract class with some helper methods, it should be used
* when starting development of another implementation of {@link MultiPartRequest}
*/
public abstract class AbstractMultiPartRequest<T> implements MultiPartRequest {
public abstract class AbstractMultiPartRequest implements MultiPartRequest {
protected static final String STRUTS_MESSAGES_UPLOAD_ERROR_PARAMETER_TOO_LONG_KEY = "struts.messages.upload.error.parameter.too.long";
@@ -100,7 +100,7 @@ public abstract class AbstractMultiPartRequest<T> implements MultiPartRequest {
/**
* Map between file fields and file data.
*/
protected Map<String, List<UploadedFile<T>>> uploadedFiles = new HashMap<>();
protected Map<String, List<UploadedFile>> uploadedFiles = new HashMap<>();
/**
* Map between non-file fields and values.
@@ -326,8 +326,7 @@ public abstract class AbstractMultiPartRequest<T> implements MultiPartRequest {
/* (non-Javadoc)
* @see org.apache.struts2.dispatcher.multipart.MultiPartRequest#getFile(java.lang.String)
*/
@SuppressWarnings("unchecked")
public UploadedFile<T>[] getFile(String fieldName) {
public UploadedFile[] getFile(String fieldName) {
return uploadedFiles.getOrDefault(fieldName, Collections.emptyList())
.toArray(UploadedFile[]::new);
}
@@ -383,8 +382,8 @@ public abstract class AbstractMultiPartRequest<T> implements MultiPartRequest {
public void cleanUp() {
try {
LOG.debug("Performing File Upload temporary storage cleanup.");
for (List<UploadedFile<T>> uploadedFileList : uploadedFiles.values()) {
for (UploadedFile<T> uploadedFile : uploadedFileList) {
for (List<UploadedFile> uploadedFileList : uploadedFiles.values()) {
for (UploadedFile uploadedFile : uploadedFileList) {
if (uploadedFile.isFile()) {
LOG.debug("Deleting file: {}", uploadedFile.getName());
if (!uploadedFile.delete()) {
@@ -26,7 +26,6 @@ import org.apache.commons.lang3.StringUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.io.File;
import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.file.Path;
@@ -36,7 +35,7 @@ import java.util.List;
/**
* Multipart form data request adapter for Jakarta Commons FileUpload package.
*/
public class JakartaMultiPartRequest extends AbstractMultiPartRequest<File> {
public class JakartaMultiPartRequest extends AbstractMultiPartRequest {
private static final Logger LOG = LogManager.getLogger(JakartaMultiPartRequest.class);
@@ -104,7 +103,7 @@ public class JakartaMultiPartRequest extends AbstractMultiPartRequest<File> {
return;
}
List<UploadedFile<File>> values;
List<UploadedFile> values;
if (uploadedFiles.get(item.getFieldName()) != null) {
values = uploadedFiles.get(item.getFieldName());
} else {
@@ -114,7 +113,7 @@ public class JakartaMultiPartRequest extends AbstractMultiPartRequest<File> {
if (item.isInMemory()) {
LOG.warn("Storing uploaded files just in memory isn't supported currently, skipping file: {}!", item.getName());
} else {
UploadedFile<File> uploadedFile = StrutsUploadedFile.Builder
UploadedFile uploadedFile = StrutsUploadedFile.Builder
.create(item.getPath().toFile())
.withOriginalName(item.getName())
.withContentType(item.getContentType())
@@ -50,7 +50,7 @@ import java.util.UUID;
*
* @since 2.3.18
*/
public class JakartaStreamMultiPartRequest extends AbstractMultiPartRequest<File> {
public class JakartaStreamMultiPartRequest extends AbstractMultiPartRequest {
private static final Logger LOG = LogManager.getLogger(JakartaStreamMultiPartRequest.class);
@@ -247,7 +247,7 @@ public class JakartaStreamMultiPartRequest extends AbstractMultiPartRequest<File
String fileName = fileItemInput.getName();
String fieldName = fileItemInput.getFieldName();
UploadedFile<File> uploadedFile = StrutsUploadedFile.Builder
UploadedFile uploadedFile = StrutsUploadedFile.Builder
.create(file)
.withOriginalName(fileName)
.withContentType(fileItemInput.getContentType())
@@ -256,7 +256,7 @@ public class JakartaStreamMultiPartRequest extends AbstractMultiPartRequest<File
if (uploadedFiles.containsKey(fieldName)) {
uploadedFiles.get(fieldName).add(uploadedFile);
} else {
List<UploadedFile<File>> infos = new ArrayList<>();
List<UploadedFile> infos = new ArrayList<>();
infos.add(uploadedFile);
uploadedFiles.put(fieldName, infos);
}
@@ -58,7 +58,7 @@ public interface MultiPartRequest {
* @param fieldName input field name
* @return a UploadedFile[] object for files associated with the specified input field name
*/
<T> UploadedFile<T>[] getFile(String fieldName);
UploadedFile[] getFile(String fieldName);
/**
* Returns a String[] of file names for files associated with the specified input field name
@@ -26,7 +26,6 @@ import org.apache.struts2.dispatcher.StrutsRequestWrapper;
import jakarta.servlet.http.HttpServletRequest;
import java.io.File;
import java.io.IOException;
import java.util.*;
@@ -139,7 +138,7 @@ public class MultiPartRequestWrapper extends StrutsRequestWrapper {
* @param fieldName input field name
* @return a File[] object for files associated with the specified input field name
*/
public UploadedFile<File>[] getFiles(String fieldName) {
public UploadedFile[] getFiles(String fieldName) {
if (multi == null) {
return null;
}
@@ -20,7 +20,7 @@ package org.apache.struts2.dispatcher.multipart;
import java.io.File;
public class StrutsUploadedFile implements UploadedFile<File> {
public class StrutsUploadedFile implements UploadedFile {
private final File file;
private final String contentType;
@@ -116,7 +116,7 @@ public class StrutsUploadedFile implements UploadedFile<File> {
return this;
}
public UploadedFile<File> build() {
public UploadedFile build() {
return new StrutsUploadedFile(this.file, this.contentType, this.originalName);
}
}
@@ -23,7 +23,7 @@ import java.io.Serializable;
/**
* Virtual representation of an uploaded file used by {@link MultiPartRequest}
*/
public interface UploadedFile<T> extends Serializable {
public interface UploadedFile extends Serializable {
/**
* @return size of the content of file/stream/array
@@ -58,7 +58,7 @@ public interface UploadedFile<T> extends Serializable {
/**
* @return content of the upload file
*/
T getContent();
Object getContent();
/**
* @return content type of the uploaded file
@@ -34,7 +34,6 @@ import org.apache.struts2.dispatcher.multipart.MultiPartRequestWrapper;
import org.apache.struts2.dispatcher.multipart.UploadedFile;
import org.apache.struts2.util.ContentTypeMatcher;
import java.io.File;
import java.text.NumberFormat;
import java.util.Arrays;
import java.util.Collection;
@@ -109,7 +108,7 @@ public abstract class AbstractFileUploadInterceptor extends AbstractInterceptor
* @param inputName - inputName of the file.
* @return true if the proposed file is acceptable by contentType and size.
*/
protected boolean acceptFile(Object action, UploadedFile<File> file, String originalFilename, String contentType, String inputName) {
protected boolean acceptFile(Object action, UploadedFile file, String originalFilename, String contentType, String inputName) {
Set<String> errorMessages = new HashSet<>();
ValidationAware validation = null;
@@ -28,7 +28,6 @@ import org.apache.struts2.action.UploadedFilesAware;
import org.apache.struts2.dispatcher.multipart.MultiPartRequestWrapper;
import org.apache.struts2.dispatcher.multipart.UploadedFile;
import java.io.File;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.List;
@@ -154,19 +153,19 @@ public class ActionFileUploadInterceptor extends AbstractFileUploadInterceptor {
// bind allowed Files
Enumeration<String> fileParameterNames = multiWrapper.getFileParameterNames();
List<UploadedFile<File>> acceptedFiles = new ArrayList<>();
List<UploadedFile> acceptedFiles = new ArrayList<>();
while (fileParameterNames != null && fileParameterNames.hasMoreElements()) {
// get the value of this input tag
String inputName = fileParameterNames.nextElement();
UploadedFile<File>[] uploadedFiles = multiWrapper.getFiles(inputName);
UploadedFile[] uploadedFiles = multiWrapper.getFiles(inputName);
if (uploadedFiles == null || uploadedFiles.length == 0) {
if (LOG.isWarnEnabled()) {
LOG.warn(getTextMessage(action, STRUTS_MESSAGES_INVALID_FILE_KEY, new String[]{inputName}));
}
} else {
for (UploadedFile<File> uploadedFile : uploadedFiles) {
for (UploadedFile uploadedFile : uploadedFiles) {
if (acceptFile(action, uploadedFile, uploadedFile.getOriginalName(), uploadedFile.getContentType(), inputName)) {
acceptedFiles.add(uploadedFile);
}
@@ -0,0 +1,32 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.struts2.interceptor;
import java.util.Map;
@Deprecated
public interface ApplicationAware extends org.apache.struts2.action.ApplicationAware {
void setApplication(Map<String, Object> application);
@Override
default void withApplication(Map<String, Object> application) {
setApplication(application);
}
}
@@ -0,0 +1,32 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.struts2.interceptor;
import org.apache.struts2.dispatcher.HttpParameters;
@Deprecated
public interface HttpParametersAware extends org.apache.struts2.action.ParametersAware {
void setParameters(HttpParameters parameters);
@Override
default void withParameters(HttpParameters parameters) {
setParameters(parameters);
}
}
@@ -0,0 +1,36 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.struts2.interceptor;
import org.apache.struts2.dispatcher.HttpParameters;
import java.util.Map;
import static java.util.stream.Collectors.toMap;
@Deprecated
public interface ParameterAware extends org.apache.struts2.action.ParametersAware {
void setParameters(Map<String, String[]> map);
@Override
default void withParameters(HttpParameters parameters) {
setParameters(parameters.entrySet().stream().collect(toMap(Map.Entry::getKey, e -> e.getValue().getMultipleValues())));
}
}
@@ -0,0 +1,30 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.struts2.interceptor;
@Deprecated
public interface PrincipalAware extends org.apache.struts2.action.PrincipalAware {
void setPrincipalProxy(PrincipalProxy principalProxy);
@Override
default void withPrincipalProxy(PrincipalProxy principalProxy) {
setPrincipalProxy(principalProxy);
}
}
@@ -0,0 +1,41 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.struts2.interceptor;
import org.apache.struts2.dispatcher.RequestMap;
import jakarta.servlet.http.HttpServletRequest;
import java.util.Map;
@Deprecated
public interface RequestAware extends ServletRequestAware {
@Override
default void setServletRequest(HttpServletRequest httpServletRequest) {
// default no-op
}
@Override
default void withServletRequest(HttpServletRequest request) {
ServletRequestAware.super.withServletRequest(request);
setRequest(new RequestMap(request));
}
void setRequest(Map<String, Object> request);
}
@@ -0,0 +1,32 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.struts2.interceptor;
import jakarta.servlet.http.HttpServletRequest;
@Deprecated
public interface ServletRequestAware extends org.apache.struts2.action.ServletRequestAware {
void setServletRequest(HttpServletRequest httpServletRequest);
@Override
default void withServletRequest(HttpServletRequest request) {
setServletRequest(request);
}
}
@@ -0,0 +1,32 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.struts2.interceptor;
import jakarta.servlet.http.HttpServletResponse;
@Deprecated
public interface ServletResponseAware extends org.apache.struts2.action.ServletResponseAware {
void setServletResponse(HttpServletResponse httpServletResponse);
@Override
default void withServletResponse(HttpServletResponse response) {
setServletResponse(response);
}
}
@@ -0,0 +1,32 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.struts2.interceptor;
import java.util.Map;
@Deprecated
public interface SessionAware extends org.apache.struts2.action.SessionAware {
void setSession(Map<String, Object> session);
@Override
default void withSession(Map<String, Object> session) {
setSession(session);
}
}
@@ -0,0 +1,32 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.struts2.util;
import jakarta.servlet.ServletContext;
@Deprecated
public interface ServletContextAware extends org.apache.struts2.action.ServletContextAware {
void setServletContext(ServletContext context);
@Override
default void withServletContext(ServletContext context) {
setServletContext(context);
}
}
@@ -46,9 +46,9 @@ abstract class AbstractMultiPartRequestTest {
protected final String boundary = "_boundary_";
protected final String endline = "\r\n";
protected AbstractMultiPartRequest<File> multiPart;
protected AbstractMultiPartRequest multiPart;
abstract protected AbstractMultiPartRequest<File> createMultipartRequest();
abstract protected AbstractMultiPartRequest createMultipartRequest();
@BeforeClass
public static void beforeClass() throws IOException {
@@ -268,8 +268,8 @@ abstract class AbstractMultiPartRequestTest {
.isEqualTo("5,6,7,8");
});
List<UploadedFile<File>> uploadedFiles = new ArrayList<>();
for (Map.Entry<String, List<UploadedFile<File>>> entry : multiPart.uploadedFiles.entrySet()) {
List<UploadedFile> uploadedFiles = new ArrayList<>();
for (Map.Entry<String, List<UploadedFile>> entry : multiPart.uploadedFiles.entrySet()) {
uploadedFiles.addAll(entry.getValue());
}
@@ -18,12 +18,10 @@
*/
package org.apache.struts2.dispatcher.multipart;
import java.io.File;
public class JakartaMultiPartRequestTest extends AbstractMultiPartRequestTest {
@Override
protected AbstractMultiPartRequest<File> createMultipartRequest() {
protected AbstractMultiPartRequest createMultipartRequest() {
return new JakartaMultiPartRequest();
}
@@ -51,7 +51,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
public class ActionFileUploadInterceptorTest extends StrutsInternalTestCase {
private static final UploadedFile<File> EMPTY_FILE = new UploadedFile<>() {
private static final UploadedFile EMPTY_FILE = new UploadedFile() {
@Override
public Long length() {
return 0L;
@@ -210,7 +210,7 @@ public class ActionFileUploadInterceptorTest extends StrutsInternalTestCase {
URL url = ClassLoaderUtil.getResource("log4j2.xml", ActionFileUploadInterceptorTest.class);
File file = new File(new URI(url.toString()));
assertTrue("log4j2.xml should be in src/test folder", file.exists());
UploadedFile<File> uploadedFile = StrutsUploadedFile.Builder.create(file).withContentType("text/html").withOriginalName("filename").build();
UploadedFile uploadedFile = StrutsUploadedFile.Builder.create(file).withContentType("text/html").withOriginalName("filename").build();
boolean notOk = interceptor.acceptFile(validation, uploadedFile, "filename", "text/html", "inputName");
assertFalse(notOk);
@@ -310,7 +310,7 @@ public class ActionFileUploadInterceptorTest extends StrutsInternalTestCase {
assertFalse(action.hasErrors());
List<UploadedFile<File>> files = action.getUploadFiles();
List<UploadedFile> files = action.getUploadFiles();
assertNotNull(files);
assertEquals(1, files.size());
@@ -345,7 +345,7 @@ public class ActionFileUploadInterceptorTest extends StrutsInternalTestCase {
interceptor.setAllowedTypes("text/html");
interceptor.intercept(mai);
List<UploadedFile<File>> files = action.getUploadFiles();
List<UploadedFile> files = action.getUploadFiles();
assertNotNull(files);
assertEquals("files accepted ", 2, files.size());
@@ -563,14 +563,14 @@ public class ActionFileUploadInterceptorTest extends StrutsInternalTestCase {
}
public static class MyFileUploadAction extends ActionSupport implements UploadedFilesAware {
private List<UploadedFile<File>> uploadedFiles;
private List<UploadedFile> uploadedFiles;
@Override
public void withUploadedFiles(List<UploadedFile<File>> uploadedFiles) {
public void withUploadedFiles(List<UploadedFile> uploadedFiles) {
this.uploadedFiles = uploadedFiles;
}
public List<UploadedFile<File>> getUploadFiles() {
public List<UploadedFile> getUploadFiles() {
return this.uploadedFiles;
}
}
@@ -53,7 +53,7 @@ import static org.assertj.core.api.Assertions.assertThat;
*/
public class FileUploadInterceptorTest extends StrutsInternalTestCase {
private static final UploadedFile<File> EMPTY_FILE = new UploadedFile<>() {
private static final UploadedFile EMPTY_FILE = new UploadedFile() {
@Override
public Long length() {
return 0L;
@@ -204,7 +204,7 @@ public class FileUploadInterceptorTest extends StrutsInternalTestCase {
URL url = ClassLoaderUtil.getResource("log4j2.xml", FileUploadInterceptorTest.class);
File file = new File(new URI(url.toString()));
assertTrue("log4j2.xml should be in src/test folder", file.exists());
UploadedFile<File> uploadedFile = StrutsUploadedFile.Builder.create(file)
UploadedFile uploadedFile = StrutsUploadedFile.Builder.create(file)
.withContentType("text/html")
.withOriginalName("filename")
.build();
@@ -307,7 +307,7 @@ public class FileUploadInterceptorTest extends StrutsInternalTestCase {
HttpParameters parameters = mai.getInvocationContext().getParameters();
assertEquals(3, parameters.keySet().size());
UploadedFile<File>[] files = (UploadedFile<File>[]) parameters.get("file").getObject();
UploadedFile[] files = (UploadedFile[]) parameters.get("file").getObject();
String[] fileContentTypes = parameters.get("fileContentType").getMultipleValues();
String[] fileRealFilenames = parameters.get("fileFileName").getMultipleValues();
@@ -363,7 +363,7 @@ public class FileUploadInterceptorTest extends StrutsInternalTestCase {
HttpParameters parameters = mai.getInvocationContext().getParameters();
assertEquals(3, parameters.keySet().size());
UploadedFile<File>[] files = (UploadedFile<File>[]) parameters.get("file").getObject();
UploadedFile[] files = (UploadedFile[]) parameters.get("file").getObject();
String[] fileContentTypes = parameters.get("fileContentType").getMultipleValues();
String[] fileRealFilenames = parameters.get("fileFileName").getMultipleValues();
@@ -642,14 +642,14 @@ public class FileUploadInterceptorTest extends StrutsInternalTestCase {
}
public static class MyFileUploadAction extends ActionSupport implements UploadedFilesAware {
private List<UploadedFile<File>> uploadedFiles;
private List<UploadedFile> uploadedFiles;
@Override
public void withUploadedFiles(List<UploadedFile<File>> uploadedFiles) {
public void withUploadedFiles(List<UploadedFile> uploadedFiles) {
this.uploadedFiles = uploadedFiles;
}
public List<UploadedFile<File>> getUploadFiles() {
public List<UploadedFile> getUploadFiles() {
return this.uploadedFiles;
}
}
+1 -1
View File
@@ -35,7 +35,7 @@
<dependency>
<groupId>net.sf.jasperreports</groupId>
<artifactId>jasperreports</artifactId>
<version>6.20.6</version>
<version>6.21.0</version>
<scope>provided</scope>
<exclusions>
<!-- not necessary to compile and it force dependency convergence issues -->
@@ -0,0 +1,32 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.struts2.portlet.interceptor;
import javax.portlet.PortletContext;
@Deprecated
public interface PortletContextAware extends org.apache.struts2.portlet.action.PortletContextAware {
void setPortletContext(PortletContext portletContext);
@Override
default void withPortletContext(PortletContext context) {
setPortletContext(context);
}
}
@@ -0,0 +1,32 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.struts2.portlet.interceptor;
import javax.portlet.PortletPreferences;
@Deprecated
public interface PortletPreferencesAware extends org.apache.struts2.portlet.action.PortletPreferencesAware {
void setPortletPreferences(PortletPreferences prefs);
@Override
default void withPortletPreferences(PortletPreferences prefs) {
setPortletPreferences(prefs);
}
}
@@ -0,0 +1,32 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.struts2.portlet.interceptor;
import javax.portlet.PortletRequest;
@Deprecated
public interface PortletRequestAware extends org.apache.struts2.portlet.action.PortletRequestAware {
void setPortletRequest(PortletRequest request);
@Override
default void withPortletRequest(PortletRequest request) {
setPortletRequest(request);
}
}
@@ -0,0 +1,32 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.struts2.portlet.interceptor;
import javax.portlet.PortletResponse;
@Deprecated
public interface PortletResponseAware extends org.apache.struts2.portlet.action.PortletResponseAware {
void setPortletResponse(PortletResponse response);
@Override
default void withPortletResponse(PortletResponse response) {
setPortletResponse(response);
}
}
-3
View File
@@ -35,9 +35,6 @@
<profiles>
<profile>
<id>build-autotags</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<build>
<plugins>
<plugin>
@@ -25,11 +25,6 @@ import ognl.PropertyAccessor;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.apache.tiles.api.TilesContainer;
import org.apache.tiles.request.ApplicationContext;
import org.apache.tiles.request.ApplicationResource;
import org.apache.tiles.request.Request;
import org.apache.tiles.request.render.BasicRendererFactory;
import org.apache.tiles.request.render.ChainedDelegateRenderer;
import org.apache.tiles.core.definition.DefinitionsFactory;
import org.apache.tiles.core.definition.pattern.DefinitionPatternMatcherFactory;
import org.apache.tiles.core.definition.pattern.PatternDefinitionResolver;
@@ -57,6 +52,11 @@ import org.apache.tiles.ognl.PropertyAccessorDelegateFactory;
import org.apache.tiles.ognl.ScopePropertyAccessor;
import org.apache.tiles.ognl.TilesApplicationContextNestedObjectExtractor;
import org.apache.tiles.ognl.TilesContextPropertyAccessorDelegateFactory;
import org.apache.tiles.request.ApplicationContext;
import org.apache.tiles.request.ApplicationResource;
import org.apache.tiles.request.Request;
import org.apache.tiles.request.render.BasicRendererFactory;
import org.apache.tiles.request.render.ChainedDelegateRenderer;
import org.apache.tiles.request.render.Renderer;
import jakarta.el.ArrayELResolver;
@@ -68,7 +68,10 @@ import jakarta.el.MapELResolver;
import jakarta.el.ResourceBundleELResolver;
import jakarta.servlet.jsp.JspFactory;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Locale;
import java.util.Map;
@@ -102,8 +105,19 @@ public class StrutsTilesContainerFactory extends BasicTilesContainerFactory {
/**
* Default pattern to be used to collect Tiles definitions if user didn't configure any
*
* @deprecated since Struts 6.4.0, use {@link #TILES_DEFAULT_PATTERNS} instead
*/
public static final String TILES_DEFAULT_PATTERN = "tiles*.xml";
@Deprecated
public static final String TILES_DEFAULT_PATTERN = "/WEB-INF/**/tiles*.xml,classpath*:META-INF/**/tiles*.xml";
/**
* Default pattern to be used to collect Tiles definitions if user didn't configure any
*/
public static final Set<String> TILES_DEFAULT_PATTERNS = Collections.unmodifiableSet(new HashSet<>(Arrays.asList(
"/WEB-INF/**/tiles*.xml",
"classpath*:META-INF/**/tiles*.xml"
)));
/**
* Supported expression languages
@@ -213,7 +227,7 @@ public class StrutsTilesContainerFactory extends BasicTilesContainerFactory {
if (params.containsKey(DefinitionsFactory.DEFINITIONS_CONFIG)) {
return TextParseUtil.commaDelimitedStringToSet(params.get(DefinitionsFactory.DEFINITIONS_CONFIG));
}
return TextParseUtil.commaDelimitedStringToSet(TILES_DEFAULT_PATTERN);
return TILES_DEFAULT_PATTERNS;
}
protected ELAttributeEvaluator createELEvaluator(ApplicationContext applicationContext) {
@@ -0,0 +1,128 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.struts2.tiles;
import org.apache.tiles.api.TilesContainer;
import org.apache.tiles.core.evaluator.AttributeEvaluatorFactory;
import org.apache.tiles.core.evaluator.impl.DirectAttributeEvaluator;
import org.apache.tiles.core.locale.LocaleResolver;
import org.apache.tiles.core.prepare.factory.BasicPreparerFactory;
import org.apache.tiles.core.prepare.factory.PreparerFactory;
import org.apache.tiles.ognl.OGNLAttributeEvaluator;
import org.apache.tiles.request.ApplicationContext;
import org.apache.tiles.request.ApplicationResource;
import org.apache.tiles.request.locale.URLApplicationResource;
import org.apache.tiles.request.render.BasicRendererFactory;
import org.apache.tiles.request.render.ChainedDelegateRenderer;
import org.apache.tiles.request.render.Renderer;
import org.junit.Before;
import org.junit.Test;
import jakarta.servlet.ServletContext;
import jakarta.servlet.jsp.JspFactory;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
public class StrutsTilesContainerFactoryTest {
private StrutsTilesContainerFactory factory;
private ApplicationContext applicationContext;
@Before
public void setUp() throws Exception {
applicationContext = mock(ApplicationContext.class);
factory = new StrutsTilesContainerFactory();
}
@Test
public void getSources() {
ApplicationResource pathResource = new URLApplicationResource(
"/org/apache/tiles/core/config/tiles-defs.xml",
Objects.requireNonNull(getClass().getResource("/org/apache/tiles/core/config/tiles-defs.xml"))
);
ApplicationResource classpathResource = new URLApplicationResource(
"/org/apache/tiles/core/config/defs1.xml",
Objects.requireNonNull(getClass().getResource("/org/apache/tiles/core/config/defs1.xml"))
);
when(applicationContext.getInitParams()).thenReturn(Collections.emptyMap());
when(applicationContext.getResources("/WEB-INF/**/tiles*.xml")).thenReturn(Collections.singleton(pathResource));
when(applicationContext.getResources("classpath*:META-INF/**/tiles*.xml")).thenReturn(Collections.singleton(classpathResource));
List<ApplicationResource> resources = factory.getSources(applicationContext);
assertEquals("The urls list is not two-sized", 2, resources.size());
assertEquals("The URL is not correct", pathResource, resources.get(0));
assertEquals("The URL is not correct", classpathResource, resources.get(1));
}
@Test
public void createAttributeEvaluatorFactory() {
LocaleResolver resolver = factory.createLocaleResolver(applicationContext);
// explicitly disables support for EL
JspFactory.setDefaultFactory(null);
AttributeEvaluatorFactory attributeEvaluatorFactory = factory.createAttributeEvaluatorFactory(applicationContext, resolver);
assertTrue("The class of the evaluator is not correct",
attributeEvaluatorFactory.getAttributeEvaluator((String) null) instanceof DirectAttributeEvaluator);
assertTrue("The class of the evaluator is not correct",
attributeEvaluatorFactory.getAttributeEvaluator("S2") instanceof StrutsAttributeEvaluator);
assertTrue("The class of the evaluator is not correct",
attributeEvaluatorFactory.getAttributeEvaluator("OGNL") instanceof OGNLAttributeEvaluator);
assertTrue("The class of the evaluator is not correct",
attributeEvaluatorFactory.getAttributeEvaluator("I18N") instanceof I18NAttributeEvaluator);
assertTrue("The class of the evaluator is not correct",
attributeEvaluatorFactory.getAttributeEvaluator("EL") instanceof DirectAttributeEvaluator);
}
@Test
public void createPreparerFactory() {
PreparerFactory preparerFactory = factory.createPreparerFactory(applicationContext);
assertTrue("The class of the preparer factory is not correct", preparerFactory instanceof BasicPreparerFactory);
}
@Test
public void createDefaultAttributeRenderer() {
TilesContainer container = mock(TilesContainer.class);
AttributeEvaluatorFactory attributeEvaluatorFactory = mock(AttributeEvaluatorFactory.class);
BasicRendererFactory rendererFactory = mock(BasicRendererFactory.class);
Renderer stringRenderer = mock(Renderer.class);
Renderer templateRenderer = mock(Renderer.class);
Renderer definitionRenderer = mock(Renderer.class);
when(rendererFactory.getRenderer("string")).thenReturn(stringRenderer);
when(rendererFactory.getRenderer("template")).thenReturn(templateRenderer);
when(rendererFactory.getRenderer("definition")).thenReturn(definitionRenderer);
when(rendererFactory.getRenderer("freemarker")).thenReturn(definitionRenderer);
Renderer renderer = factory.createDefaultAttributeRenderer(rendererFactory, applicationContext, container, attributeEvaluatorFactory);
assertTrue("The default renderer class is not correct", renderer instanceof ChainedDelegateRenderer);
verify(rendererFactory).getRenderer("string");
verify(rendererFactory).getRenderer("template");
verify(rendererFactory).getRenderer("definition");
verify(rendererFactory).getRenderer("freemarker");
}
}
+19 -28
View File
@@ -82,7 +82,7 @@
<modules>
<module>bom</module>
<module>jakarta</module>
<!--<module>jakarta</module>-->
<module>core</module>
<module>plugins</module>
<module>apps</module>
@@ -115,12 +115,12 @@
<freemarker.version>2.3.32</freemarker.version>
<hibernate-validator.version>8.0.1.Final</hibernate-validator.version>
<jackson.version>2.16.0</jackson.version>
<log4j2.version>2.22.1</log4j2.version>
<log4j2.version>2.23.1</log4j2.version>
<maven-surefire-plugin.version>3.2.5</maven-surefire-plugin.version>
<mockito.version>5.8.0</mockito.version>
<ognl.version>3.3.4</ognl.version>
<sitemesh.version>2.5.0</sitemesh.version>
<slf4j.version>2.0.11</slf4j.version>
<slf4j.version>2.0.12</slf4j.version>
<spring.platformVersion>6.0.13</spring.platformVersion>
<tiles.version>3.0.8</tiles.version>
<tiles-request.version>1.0.7</tiles-request.version>
@@ -287,14 +287,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
<version>3.3.0</version>
</plugin>
<plugin>
<groupId>org.apache.rat</groupId>
@@ -349,6 +342,17 @@
<skipRuntimeScope>true</skipRuntimeScope>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.6.0</version>
<configuration>
<skipAssembly>true</skipAssembly>
<runOnlyAtExecutionRoot>true</runOnlyAtExecutionRoot>
<outputDirectory>assembly/out</outputDirectory>
<workDirectory>assembly/work</workDirectory>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
@@ -372,14 +376,6 @@
<artifactId>maven-wrapper-plugin</artifactId>
<version>3.2.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.6.0</version>
<configuration>
<skipAssembly>true</skipAssembly>
</configuration>
</plugin>
</plugins>
</pluginManagement>
@@ -387,7 +383,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<!-- See https://issues.apache.org/jira/browse/MRELEASE-1029 -->
<version>3.0.1</version>
</plugin>
<plugin>
@@ -411,10 +406,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
@@ -426,12 +417,12 @@
<dependency>
<groupId>org.apache.maven.doxia</groupId>
<artifactId>doxia-core</artifactId>
<version>1.9.1</version>
<version>1.12.0</version>
</dependency>
<dependency>
<groupId>org.apache.maven.doxia</groupId>
<artifactId>doxia-module-markdown</artifactId>
<version>1.9.1</version>
<version>1.12.0</version>
</dependency>
</dependencies>
</plugin>
@@ -860,7 +851,7 @@
<dependency>
<groupId>commons-validator</groupId>
<artifactId>commons-validator</artifactId>
<version>1.6</version>
<version>1.8.0</version>
</dependency>
<!-- Mocks for unit testing (by Spring) -->
@@ -991,7 +982,7 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
<version>1.25.0</version>
<version>1.26.0</version>
</dependency>
<dependency>