Could integrate the old project under 20200831 into the 20200928 with Spring Boot without creating a new archetype (as a new project) and no additonal effort. It took some time to understand what is happening between SBApplication.class and who calls the Dispatcher.class but now it's ok. Here is my DIY. Maybe can be helpful for other people.
Step1.
pom.xml
Code:
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.3.4.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
<groupId>de.xx.xyz</groupId>
<artifactId>xyz</artifactId>
<version>1.0.1-SNAPSHOT</version>
<name>xyz Webapp</name>
and this one :
Code:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<!-- ... -->
<dependency>
<groupId>javax.servlet.jsp</groupId>
<artifactId>javax.servlet.jsp-api</artifactId>
<version>2.3.3</version>
</dependency>
<dependency>
<groupId>org.eclnt</groupId>
<artifactId>eclntjsfserver</artifactId>
<version>${cc.version}</version>
</dependency>
<dependency>
<groupId>org.eclnt</groupId>
<artifactId>eclntjsfserver_jsfimpl</artifactId>
<version>${cc.version}</version>
</dependency>
Step 2.
xyz/src/main/webapp/WEB-INF/web.xml
Code:
<!--listener>
<listener-class>org.eclnt.jsfserver.util.HttpSessionListenerDelegator</listener-class>
</listener-->
<!-- ********** LISTENERS ************************************************ -->
<listener>
<listener-class>org.eclnt.jsfserver.util.CCServletContextListener</listener-class>
</listener>
Step 3.
of course the new new SBApplication should be created under Code:
xyz\src\main\java\springbootstartup\SBApplication.java
with Content:
Code:
package springbootstartup;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import org.eclnt.jsfserver.util.CCInitialize;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletContextInitializer;
import org.springframework.context.annotation.Bean;
@SpringBootApplication
public class SBApplication
{
public static void main(String[] args)
{
SpringApplication.run(SBApplication.class, args);
}
@Bean
public ServletContextInitializer initializer()
{
return new ServletContextInitializer()
{
@Override
public void onStartup(ServletContext servletContext) throws ServletException
{
CCInitialize.initializeCCEnvironment(servletContext);
}
};
}
}
Actually original from new archetype.
Step 4.
The Dispatcher as well. Actually original from new archetype:
Code:
package managedbeans;
import org.eclnt.workplace.WorkpageDispatcher;
import org.eclnt.workplace.IWorkpageContainer;
import org.eclnt.workplace.WorkpageDispatcher;
/*
* The dispatcher is referenced in faces-config.xml. When changing the package
* of the dispatcher, then also update the faces-config.xml link!
*/
public class Dispatcher extends WorkpageDispatcher
{
/**
* This method needs to be implemented if you want to extend the page bean browser tool.
*/
public static DispatcherInfo getStaticDispatcherInfo() { return new DispatcherInfo(Dispatcher.class); }
/**
* Returns the expression under which the dispatcher can be reached.
*/
protected String getRootExpression() { return "#{d}"; }
// ------------------------------------------------------------------------
// constructors
// ------------------------------------------------------------------------
/**
* Dispatcher that is used for the root object, e.g. "#{d}".
*/
public Dispatcher()
{
// add any implementation...
}
/**
* Dispatcher that is used for the sub dispatcher objects, e.g. "#{d.d_1}".
*/
public Dispatcher(IWorkpageContainer workpageContainer)
{
super(workpageContainer);
// add any implementation...
}
}
Step 5.
Extend file [code]src/main/resources/application.properties[code]
[code]
management.endpoints.web.exposure.include=*
management.endpoint.shutdown.enabled=true
endpoints.shutdown.enabled=true
app.name=XYZ
app.description=${app.name} is a Spring Boot application
server.port=9003
[code]
Step 6.
Start project (.war) from terminal automatically with given ports. Type in terminal:
[code]java -jar xyz.war[code]
Step 7.
Shutdown XYZ project and terminate the PID. Type in terminal:
[code]curl -X POST localhost:9003/actuator/shutdown[code]