Skip to content

Commit

Permalink
Move code to jakarta namespace and update dependencies to use Jakarta…
Browse files Browse the repository at this point in the history
… EE 9.1
  • Loading branch information
meier-rene committed Oct 23, 2024
1 parent c4c8e17 commit 5620224
Show file tree
Hide file tree
Showing 12 changed files with 69 additions and 83 deletions.
5 changes: 1 addition & 4 deletions MetFragWeb/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,10 @@
<groupId>org.apache.commons</groupId>
<artifactId>commons-email</artifactId>
</dependency>
<dependency>
<groupId>commons-fileupload</groupId>
<artifactId>commons-fileupload</artifactId>
</dependency>
<dependency>
<groupId>org.primefaces</groupId>
<artifactId>primefaces</artifactId>
<classifier>jakarta</classifier>
</dependency>
<dependency>
<groupId>org.primefaces.themes</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@
import java.net.UnknownHostException;
import java.util.List;

import javax.annotation.PostConstruct;
import javax.faces.application.FacesMessage;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;
import javax.faces.model.SelectItem;
import jakarta.annotation.PostConstruct;
import jakarta.faces.application.FacesMessage;
import jakarta.faces.bean.ManagedBean;
import jakarta.faces.bean.SessionScoped;
import jakarta.faces.context.FacesContext;
import jakarta.faces.event.ActionEvent;
import jakarta.faces.model.SelectItem;
import javax.imageio.ImageIO;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import jakarta.servlet.ServletContext;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpSession;

import org.apache.commons.io.FileUtils;
import org.apache.commons.mail.EmailAttachment;
Expand Down Expand Up @@ -277,7 +277,7 @@ public void parametersUploadListener(org.primefaces.event.FileUploadEvent event)
/*
* database search settings
*/
public java.util.List<javax.faces.model.SelectItem> getAvailableDatabases() {
public java.util.List<jakarta.faces.model.SelectItem> getAvailableDatabases() {
return this.beanSettingsContainer.getAvailableParameters().getDatabases();
}

Expand Down Expand Up @@ -908,7 +908,7 @@ public void setExcludedElements(String excludedFilterElements) {
}

//SMARTS inclusion
public java.util.List<javax.faces.model.SelectItem> getAvailableSubstructureSmarts() {
public java.util.List<jakarta.faces.model.SelectItem> getAvailableSubstructureSmarts() {
return this.beanSettingsContainer.getAvailableParameters().getSubstructureSmarts();
}

Expand Down Expand Up @@ -1070,7 +1070,7 @@ public void setSelectedInformationSmarts(String selectedSmarts) {
this.beanSettingsContainer.setSelectedInformationSmarts(selectedSmarts);
}

public java.util.List<javax.faces.model.SelectItem> getAvailableSubstructureInformationSmarts() {
public java.util.List<jakarta.faces.model.SelectItem> getAvailableSubstructureInformationSmarts() {
return this.beanSettingsContainer.getAvailableParameters().getSubstructureInformationSmarts();
}

Expand Down Expand Up @@ -1814,11 +1814,11 @@ private boolean checkScoreSettings() {
/*
* fragmenter settings
*/
public java.util.List<javax.faces.model.SelectItem> getPrecursorModes() {
public java.util.List<jakarta.faces.model.SelectItem> getPrecursorModes() {
return this.beanSettingsContainer.getAvailableParameters().getPrecursorModes();
}

public java.util.List<javax.faces.model.SelectItem> getTreeDepths() {
public java.util.List<jakarta.faces.model.SelectItem> getTreeDepths() {
return this.beanSettingsContainer.getAvailableParameters().getTreeDepths();
}

Expand Down Expand Up @@ -3014,7 +3014,7 @@ public void viewExpiredListener() {
System.out.println("session expired " + this.beanSettingsContainer.getRootSessionFolder());
FacesContext fc = FacesContext.getCurrentInstance();
java.util.Map<String, Object> requestMap = fc.getExternalContext().getRequestMap();
javax.faces.application.NavigationHandler nav =
jakarta.faces.application.NavigationHandler nav =
fc.getApplication().getNavigationHandler();
// Push some useful stuff to the request scope for
// use in the page
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
import java.util.Iterator;
import java.util.Map;

import javax.faces.FacesException;
import javax.faces.application.NavigationHandler;
import javax.faces.application.ViewExpiredException;
import javax.faces.context.ExceptionHandler;
import javax.faces.context.ExceptionHandlerWrapper;
import javax.faces.context.FacesContext;
import javax.faces.event.ExceptionQueuedEvent;
import javax.faces.event.ExceptionQueuedEventContext;
import jakarta.faces.FacesException;
import jakarta.faces.application.NavigationHandler;
import jakarta.faces.application.ViewExpiredException;
import jakarta.faces.context.ExceptionHandler;
import jakarta.faces.context.ExceptionHandlerWrapper;
import jakarta.faces.context.FacesContext;
import jakarta.faces.event.ExceptionQueuedEvent;
import jakarta.faces.event.ExceptionQueuedEventContext;

import org.primefaces.PrimeFaces;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package de.ipbhalle.metfragweb.exception;

import javax.faces.context.ExceptionHandler;
import javax.faces.context.ExceptionHandlerFactory;
import jakarta.faces.context.ExceptionHandler;
import jakarta.faces.context.ExceptionHandlerFactory;
import de.ipbhalle.metfragweb.exception.ViewExpiredExceptionExceptionHandler;

public class ViewExpiredExceptionExceptionHandlerFactory extends ExceptionHandlerFactory {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import java.io.IOException;
import java.util.ArrayList;

import javax.faces.model.SelectItem;
import jakarta.faces.model.SelectItem;
import javax.imageio.ImageIO;

import org.apache.commons.io.FileUtils;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package de.ipbhalle.metfragweb.validator;

import javax.faces.application.FacesMessage;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.validator.Validator;
import javax.faces.validator.ValidatorException;
import jakarta.faces.application.FacesMessage;
import jakarta.faces.component.UIComponent;
import jakarta.faces.context.FacesContext;
import jakarta.faces.validator.Validator;
import jakarta.faces.validator.ValidatorException;

import de.ipbhalle.metfraglib.list.DefaultPeakList;
import de.ipbhalle.metfraglib.peak.TandemMassPeak;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package de.ipbhalle.metfragweb.validator;

import javax.faces.application.FacesMessage;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.validator.Validator;
import javax.faces.validator.ValidatorException;
import jakarta.faces.application.FacesMessage;
import jakarta.faces.component.UIComponent;
import jakarta.faces.context.FacesContext;
import jakarta.faces.validator.Validator;
import jakarta.faces.validator.ValidatorException;

public class PositiveDoubleValueValidator implements Validator {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
package de.ipbhalle.metfragweb.validator;

import javax.faces.application.FacesMessage;
import javax.faces.component.UIComponent;
import javax.faces.component.UIInput;
import javax.faces.context.FacesContext;
import javax.faces.validator.Validator;
import javax.faces.validator.ValidatorException;
import jakarta.faces.application.FacesMessage;
import jakarta.faces.component.UIComponent;
import jakarta.faces.component.UIInput;
import jakarta.faces.context.FacesContext;
import jakarta.faces.validator.Validator;
import jakarta.faces.validator.ValidatorException;

public class SearchPPMValidator implements Validator {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package de.ipbhalle.metfragweb.validator;

import javax.faces.application.FacesMessage;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.validator.Validator;
import javax.faces.validator.ValidatorException;
import jakarta.faces.application.FacesMessage;
import jakarta.faces.component.UIComponent;
import jakarta.faces.context.FacesContext;
import jakarta.faces.validator.Validator;
import jakarta.faces.validator.ValidatorException;
import javax.script.ScriptEngineManager;
import javax.script.ScriptException;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package de.ipbhalle.metfragweb.validator;

import javax.faces.application.FacesMessage;
import javax.faces.component.UIComponent;
import javax.faces.context.FacesContext;
import javax.faces.validator.Validator;
import javax.faces.validator.ValidatorException;
import jakarta.faces.application.FacesMessage;
import jakarta.faces.component.UIComponent;
import jakarta.faces.context.FacesContext;
import jakarta.faces.validator.Validator;
import jakarta.faces.validator.ValidatorException;

import org.openscience.cdk.DefaultChemObjectBuilder;
import org.openscience.cdk.exception.CDKException;
Expand Down
36 changes: 12 additions & 24 deletions MetFragWeb/src/main/webapp/WEB-INF/web.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,16 @@
<mime-type>application/xml</mime-type>
</mime-mapping>
<context-param>
<param-name>javax.faces.FACELETS_BUFFER_SIZE</param-name>
<param-value>65535</param-value>
<param-name>jakarta.faces.FACELETS_BUFFER_SIZE</param-name>
<param-value>65535</param-value> <!-- 64KB -->
</context-param>
<context-param>
<description>State saving method: 'client' or 'server' (=default). See JSF Specification 2.5.2</description>
<param-name>javax.faces.STATE_SAVING_METHOD</param-name>
<param-name>jakarta.faces.STATE_SAVING_METHOD</param-name>
<param-value>server</param-value>
</context-param>
<context-param>
<param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
<context-param>
<param-name>jakarta.servlet.jsp.jstl.fmt.LocalizationContext</param-name>
<param-value>resources.application</param-value>
</context-param>
<context-param>
Expand All @@ -34,7 +34,7 @@
</context-param>
<servlet>
<servlet-name>Faces Servlet</servlet-name>
<servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
<servlet-class>jakarta.faces.webapp.FacesServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
Expand All @@ -45,28 +45,16 @@
<servlet-name>Faces Servlet</servlet-name>
<url-pattern>*.xhtml</url-pattern>
</servlet-mapping>
<!-- <context-param> -->
<!-- <param-name>com.sun.faces.expressionFactory</param-name> -->
<!-- <param-value>com.sun.el.ExpressionFactoryImpl</param-value> -->
<!-- </context-param> -->
<context-param>
<param-name>com.sun.faces.expressionFactory</param-name>
<param-value>com.sun.el.ExpressionFactoryImpl</param-value>
</context-param>
<context-param>
<param-name>primefaces.UPLOADER</param-name>
<param-value>commons</param-value>
</context-param>
<context-param>
<param-name>facelets.SKIP_COMMENTS</param-name>
<param-name>jakarta.faces.FACELETS_SKIP_COMMENTS</param-name>
<param-value>true</param-value>
</context-param>
<filter>
<filter-name>PrimeFaces FileUpload Filter</filter-name>
<filter-class>org.primefaces.webapp.filter.FileUploadFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>PrimeFaces FileUpload Filter</filter-name>
<servlet-name>Faces Servlet</servlet-name>
</filter-mapping>
<error-page>
<exception-type>javax.faces.application.ViewExpiredException</exception-type>
<exception-type>jakarta.faces.application.ViewExpiredException</exception-type>
<location>/includes/errorpages/viewExpired.xhtml</location>
</error-page>
</web-app>
5 changes: 3 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@
<dependency>
<groupId>org.omnifaces</groupId>
<artifactId>omnifaces</artifactId>
<version>3.14.6</version>
<version>4.5.1</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
Expand All @@ -129,6 +129,7 @@
<groupId>org.primefaces</groupId>
<artifactId>primefaces</artifactId>
<version>10.0.0</version>
<classifier>jakarta</classifier>
</dependency>
<dependency>
<groupId>org.primefaces.themes</groupId>
Expand All @@ -138,7 +139,7 @@
<dependency>
<groupId>jakarta.platform</groupId>
<artifactId>jakarta.jakartaee-api</artifactId>
<version>8.0.0</version>
<version>9.1.0</version>
<scope>provided</scope>
</dependency>

Expand Down

0 comments on commit 5620224

Please sign in to comment.