mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-12 16:35:45 +01:00
25 lines
773 B
Java
25 lines
773 B
Java
|
|
package sonia.scm;
|
||
|
|
|
||
|
|
import javax.servlet.RequestDispatcher;
|
||
|
|
import javax.servlet.ServletException;
|
||
|
|
import javax.servlet.http.HttpServletRequest;
|
||
|
|
import javax.servlet.http.HttpServletResponse;
|
||
|
|
import java.io.IOException;
|
||
|
|
|
||
|
|
/**
|
||
|
|
* This dispatcher forwards every request to the index.html of the application.
|
||
|
|
*
|
||
|
|
* @since 2.0.0
|
||
|
|
*/
|
||
|
|
public class ForwardingPushStateDispatcher implements PushStateDispatcher {
|
||
|
|
@Override
|
||
|
|
public void dispatch(HttpServletRequest request, HttpServletResponse response, String uri) throws IOException {
|
||
|
|
RequestDispatcher dispatcher = request.getRequestDispatcher("/index.html");
|
||
|
|
try {
|
||
|
|
dispatcher.forward(request, response);
|
||
|
|
} catch (ServletException e) {
|
||
|
|
throw new IOException("failed to forward request", e);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|