Skip to content
Snippets Groups Projects
Commit e416d2f8 authored by Félix  Sidokhine's avatar Félix Sidokhine Committed by Adrien Béraud
Browse files

fixed issue with default page finally

Change-Id: I78496a2585e061857f6c197750d3553be981be09
parent 58c3f9aa
No related branches found
No related tags found
No related merge requests found
......@@ -78,15 +78,6 @@ public class Server {
public static void main(String[] args) {
//This is a fix to drop old cached stuff from the tomcat classloader.
ClassPool.getDefault().clearImportedPackages();
//TODO: Remove this entirely, as we no longer need to do dynamic codegen.
//ScopedServletAnnotationScanner scanner = new ScopedServletAnnotationScanner();
//Here we need to scan and modify our servlets, this is not necessarily the greatest thing ever.
//try {
// scanner.scanAndModify(PackageScanner.getClasses());
//}
//catch (Exception e){
// log.error("Could not modify the annotated files");
//}
switch (args.length) {
case 1:
tomcatLauncher = new TomcatLauncher(Integer.parseInt(args[0]));
......
......@@ -95,7 +95,7 @@ public class TomcatLauncher {
}
context.setResources(resources);
//We always go to login by default.
context.addWelcomeFile("templates/signup.html");
context.addWelcomeFile("index");
ErrorPage errorPage = new ErrorPage();
errorPage.setErrorCode(404);
context.addErrorPage(errorPage);
......
package net.jami.jams.server.servlets.general;
import jakarta.servlet.ServletException;
import jakarta.servlet.annotation.WebServlet;
import jakarta.servlet.http.HttpServlet;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import java.io.IOException;
@WebServlet("/index")
public class IndexServlet extends HttpServlet {
//This is to by-pass the path issue.
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
resp.sendRedirect("/templates/signup.html");
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment