Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tomcat / Catalina upgrade #875

Open
wants to merge 3 commits into
base: trunk
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions applications/accounting/servicedef/services_paypal.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ under the License.
</service>
<service name="payPalCheckoutUpdate" engine="java" auth="false"
location="org.apache.ofbiz.accounting.thirdparty.paypal.PayPalServices" invoke="payPalCheckoutUpdate">
<attribute name="request" mode="IN" type="javax.servlet.http.HttpServletRequest"/>
<attribute name="response" mode="IN" type="javax.servlet.http.HttpServletResponse"/>
<attribute name="request" mode="IN" type="jakarta.servlet.http.HttpServletRequest"/>
<attribute name="response" mode="IN" type="jakarta.servlet.http.HttpServletResponse"/>
</service>

<service name="payPalProcessor" engine="java"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
*/
package org.apache.ofbiz.accounting.accounting

import javax.servlet.http.HttpSession
import jakarta.servlet.http.HttpSession

import org.apache.ofbiz.entity.GenericValue
import org.apache.ofbiz.order.shoppingcart.CheckOutEvents
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
import java.math.BigDecimal;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import org.apache.ofbiz.base.util.Debug;
import org.apache.ofbiz.base.util.UtilDateTime;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
import java.util.List;
import java.util.Map;

import javax.servlet.ServletRequest;
import jakarta.servlet.ServletRequest;

import org.apache.ofbiz.base.util.Debug;
import org.apache.ofbiz.base.util.UtilFormatOut;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@
import java.util.Locale;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import org.apache.ofbiz.base.util.Debug;
import org.apache.ofbiz.base.util.UtilDateTime;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
import java.util.Map;
import java.util.WeakHashMap;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import javax.transaction.Transaction;

import org.apache.commons.lang.StringUtils;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
import java.util.Locale;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import org.apache.ofbiz.base.util.Debug;
import org.apache.ofbiz.base.util.UtilDateTime;
Expand Down
10 changes: 5 additions & 5 deletions applications/content/minilang/layout/LayoutEvents.xml
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ under the License.
<log level="info" message="contentId: ${contentId}"/>
<log level="info" message="dataResourceId: ${dataResourceId}"/>
<call-class-method class-name="org.apache.ofbiz.content.ContentManagementWorker" method-name="mruAdd">
<field field="request" type="javax.servlet.http.HttpServletRequest"/>
<field field="request" type="jakarta.servlet.http.HttpServletRequest"/>
<field field="subContent" type="org.apache.ofbiz.entity.GenericEntity"/>
</call-class-method>
-->
Expand Down Expand Up @@ -169,7 +169,7 @@ under the License.
<log level="info" message="in createLayoutImage."/>

<call-class-method class-name="org.apache.ofbiz.content.layout.LayoutWorker" method-name="uploadImageAndParameters" ret-field="formInput">
<field field="request" type="javax.servlet.http.HttpServletRequest"/>
<field field="request" type="jakarta.servlet.http.HttpServletRequest"/>
<string value="imageData"/>
</call-class-method>

Expand Down Expand Up @@ -229,7 +229,7 @@ under the License.
<log level="info" message="contentId: ${contentId}"/>
<log level="info" message="dataResourceId: ${dataResourceId}"/>
<call-class-method class-name="org.apache.ofbiz.content.ContentManagementWorker" method-name="mruAdd">
<field field="request" type="javax.servlet.http.HttpServletRequest"/>
<field field="request" type="jakarta.servlet.http.HttpServletRequest"/>
<field field="subContent" type="org.apache.ofbiz.entity.GenericEntity"/>
</call-class-method>
-->
Expand Down Expand Up @@ -285,7 +285,7 @@ under the License.
<log level="info" message="contentId: ${contentId}"/>
<log level="info" message="dataResourceId: ${dataResourceId}"/>
<call-class-method class-name="org.apache.ofbiz.content.ContentManagementWorker" method-name="mruAdd">
<field field="request" type="javax.servlet.http.HttpServletRequest"/>
<field field="request" type="jakarta.servlet.http.HttpServletRequest"/>
<field field="subContent" type="org.apache.ofbiz.entity.GenericEntity"/>
</call-class-method>
-->
Expand Down Expand Up @@ -316,7 +316,7 @@ under the License.
<simple-method method-name="createGenericContent" short-description="Create Generic Content">
<call-class-method class-name="org.apache.ofbiz.content.layout.LayoutWorker"
method-name="uploadImageAndParameters" ret-field="formInput">
<field field="request" type="javax.servlet.http.HttpServletRequest"/>
<field field="request" type="jakarta.servlet.http.HttpServletRequest"/>
<string value="dataResourceName"/>
</call-class-method>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
import java.util.Map;
import java.util.Map.Entry;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpSession;

import org.apache.ofbiz.base.util.Debug;
import org.apache.ofbiz.base.util.GeneralException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
import java.util.Map;
import java.util.Map.Entry;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpSession;

import org.apache.ofbiz.base.util.Debug;
import org.apache.ofbiz.base.util.GeneralException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ Licensed to the Apache Software Foundation (ASF) under one
import java.util.List;
import java.util.Locale;

import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import jakarta.servlet.ServletContext;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpSession;

import org.apache.ofbiz.base.util.Debug;
import org.apache.ofbiz.base.util.GeneralException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@
import java.util.Locale;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.io.IOUtils;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@

import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import org.apache.ofbiz.base.util.Debug;
import org.apache.ofbiz.base.util.UtilHttp;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ k Licensed to the Apache Software Foundation (ASF) under one
import java.util.Map;
import java.util.Set;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import org.apache.ofbiz.base.util.Debug;
import org.apache.ofbiz.base.util.GeneralException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpSession;

import org.apache.ofbiz.base.util.UtilValidate;
import org.apache.ofbiz.content.content.ContentSearch.ContentSearchConstraint;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
import java.util.Locale;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpSession;

import org.apache.ofbiz.base.util.Debug;
import org.apache.ofbiz.base.util.UtilGenerics;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@

import java.io.IOException;

import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.Filter;
import jakarta.servlet.FilterChain;
import jakarta.servlet.FilterConfig;
import jakarta.servlet.RequestDispatcher;
import jakarta.servlet.ServletException;
import jakarta.servlet.ServletRequest;
import jakarta.servlet.ServletResponse;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;

import org.apache.ofbiz.base.util.Debug;
import org.apache.ofbiz.base.util.UtilHttp;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,22 @@
*******************************************************************************/
package org.apache.ofbiz.content.content;

import java.io.File;
import java.util.HashMap;
import java.util.LinkedList;
import java.util.List;
import java.util.Locale;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpSession;

import org.apache.commons.fileupload2.core.DiskFileItem;
import org.apache.commons.fileupload2.core.DiskFileItemFactory;
import org.apache.commons.fileupload2.core.FileItem;
import org.apache.commons.fileupload2.core.FileUploadException;
import org.apache.commons.fileupload2.jakarta.JakartaServletFileUpload;

import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.FileUploadException;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.fileupload.servlet.ServletFileUpload;
import org.apache.ofbiz.base.util.Debug;
import org.apache.ofbiz.base.util.StringUtil;
import org.apache.ofbiz.base.util.UtilDateTime;
Expand Down Expand Up @@ -76,13 +77,8 @@ public static String uploadContentAndImage(HttpServletRequest request, HttpServl
HttpSession session = request.getSession();
GenericValue userLogin = (GenericValue) session.getAttribute("userLogin");

long maxUploadSize = UtilHttp.getMaxUploadSize(delegator);
int sizeThreshold = UtilHttp.getSizeThreshold(delegator);
File tmpUploadRepository = UtilHttp.getTmpUploadRepository(delegator);

ServletFileUpload upload = new ServletFileUpload(new DiskFileItemFactory(sizeThreshold, tmpUploadRepository));
upload.setSizeMax(maxUploadSize);
List<FileItem> lst = null;
JakartaServletFileUpload<DiskFileItem, DiskFileItemFactory> upload = UtilHttp.getServletFileUpload(request);
List<FileItem<DiskFileItem>> lst = null;
try {
lst = UtilGenerics.cast(upload.parseRequest(request));
} catch (FileUploadException e4) {
Expand All @@ -99,10 +95,10 @@ public static String uploadContentAndImage(HttpServletRequest request, HttpServl
}

Map<String, Object> passedParams = new HashMap<>();
FileItem fi = null;
FileItem imageFi = null;
FileItem<DiskFileItem> fi = null;
FileItem<DiskFileItem> imageFi = null;
byte[] imageBytes = {};
for (FileItem fileItem : lst) {
for (FileItem<DiskFileItem> fileItem : lst) {
fi = fileItem;
String fieldName = fi.getFieldName();
if (fi.isFormField()) {
Expand Down Expand Up @@ -344,15 +340,8 @@ public static String uploadContentStuff(HttpServletRequest request, HttpServletR
try {
HttpSession session = request.getSession();
GenericValue userLogin = (GenericValue) session.getAttribute("userLogin");
Delegator delegator = (Delegator) request.getAttribute("delegator");

long maxUploadSize = UtilHttp.getMaxUploadSize(delegator);
int sizeThreshold = UtilHttp.getSizeThreshold(delegator);
File tmpUploadRepository = UtilHttp.getTmpUploadRepository(delegator);
ServletFileUpload upload = new ServletFileUpload(new DiskFileItemFactory(sizeThreshold, tmpUploadRepository));
upload.setSizeMax(maxUploadSize);

List<FileItem> lst = null;
JakartaServletFileUpload<DiskFileItem, DiskFileItemFactory> upload = UtilHttp.getServletFileUpload(request);
List<FileItem<DiskFileItem>> lst = null;
try {
lst = UtilGenerics.cast(upload.parseRequest(request));
} catch (FileUploadException e4) {
Expand All @@ -368,11 +357,11 @@ public static String uploadContentStuff(HttpServletRequest request, HttpServletR
}

Map<String, Object> passedParams = new HashMap<>();
FileItem fi = null;
FileItem imageFi = null;
FileItem<DiskFileItem> fi = null;
FileItem<DiskFileItem> imageFi = null;
byte[] imageBytes;
passedParams.put("userLogin", userLogin);
for (FileItem fileItem : lst) {
for (FileItem<DiskFileItem> fileItem : lst) {
fi = fileItem;
String fieldName = fi.getFieldName();
if (fi.isFormField()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
import java.util.Locale;
import java.util.Map;

import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import jakarta.servlet.ServletContext;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpSession;

import org.apache.commons.io.IOUtils;
import org.apache.ofbiz.base.util.Debug;
Expand Down
Loading