diff --git a/src/main/java/edu/kit/typicalc/view/main/NotFoundView.java b/src/main/java/edu/kit/typicalc/view/main/NotFoundView.java new file mode 100644 index 0000000..72f0fda --- /dev/null +++ b/src/main/java/edu/kit/typicalc/view/main/NotFoundView.java @@ -0,0 +1,27 @@ +package edu.kit.typicalc.view.main; + +import com.vaadin.flow.component.html.Div; +import com.vaadin.flow.component.html.Label; +import com.vaadin.flow.router.*; + +import javax.servlet.http.HttpServletResponse; + +@ParentLayout(MainViewImpl.class) +public class NotFoundView extends Div + implements HasErrorParameter { + + private final Label error = new Label(); + + public NotFoundView() { + add(error); // todo make more beautiful + } + + @Override + public int setErrorParameter( + BeforeEnterEvent event, + ErrorParameter parameter) { + + error.setText("Cannot find URL: " + event.getLocation().getPath()); + return HttpServletResponse.SC_NOT_FOUND; + } +} \ No newline at end of file