From 8365741988bb6c771ff531256844047122299891 Mon Sep 17 00:00:00 2001 From: rit_croque Date: Fri, 2 Feb 2024 17:14:29 +0000 Subject: [PATCH 1/5] feat: configure the project to run on a Tomcat 7 server --- .classpath | 26 +++++++++---------- ...se.wst.validation.validationbuilder.launch | 7 +++++ .project | 7 ++++- ....eclipse.wst.common.project.facet.core.xml | 20 +++++++------- .settings/org.eclipse.wst.validation.prefs | 8 ++++++ 5 files changed, 44 insertions(+), 24 deletions(-) create mode 100644 .externalToolBuilders/org.eclipse.wst.validation.validationbuilder.launch create mode 100644 .settings/org.eclipse.wst.validation.prefs diff --git a/.classpath b/.classpath index ddeaa5b..27469b6 100644 --- a/.classpath +++ b/.classpath @@ -1,13 +1,13 @@ - - - - - - - - - - - - - + + + + + + + + + + + + + diff --git a/.externalToolBuilders/org.eclipse.wst.validation.validationbuilder.launch b/.externalToolBuilders/org.eclipse.wst.validation.validationbuilder.launch new file mode 100644 index 0000000..390d506 --- /dev/null +++ b/.externalToolBuilders/org.eclipse.wst.validation.validationbuilder.launch @@ -0,0 +1,7 @@ + + + + + + + diff --git a/.project b/.project index f106b83..e159237 100644 --- a/.project +++ b/.project @@ -16,8 +16,13 @@ - org.eclipse.wst.validation.validationbuilder + org.eclipse.ui.externaltools.ExternalToolBuilder + full,incremental, + + LaunchConfigHandle + <project>/.externalToolBuilders/org.eclipse.wst.validation.validationbuilder.launch + diff --git a/.settings/org.eclipse.wst.common.project.facet.core.xml b/.settings/org.eclipse.wst.common.project.facet.core.xml index cb10a17..eabe095 100644 --- a/.settings/org.eclipse.wst.common.project.facet.core.xml +++ b/.settings/org.eclipse.wst.common.project.facet.core.xml @@ -1,10 +1,10 @@ - - - - - - - - - - + + + + + + + + + + diff --git a/.settings/org.eclipse.wst.validation.prefs b/.settings/org.eclipse.wst.validation.prefs new file mode 100644 index 0000000..cc2d6d8 --- /dev/null +++ b/.settings/org.eclipse.wst.validation.prefs @@ -0,0 +1,8 @@ +DELEGATES_PREFERENCE=delegateValidatorList +USER_BUILD_PREFERENCE=enabledBuildValidatorListorg.eclipse.jst.j2ee.internal.classpathdep.ClasspathDependencyValidator; +USER_MANUAL_PREFERENCE=enabledManualValidatorListorg.eclipse.jst.j2ee.internal.classpathdep.ClasspathDependencyValidator; +USER_PREFERENCE=overrideGlobalPreferencestruedisableAllValidationtrueversion1.3.0.v202308161955 +eclipse.preferences.version=1 +override=true +suspend=true +vf.version=3 From d577d63b638717ba5d98c5208db08093571b2c14 Mon Sep 17 00:00:00 2001 From: rit_croque Date: Fri, 2 Feb 2024 17:14:49 +0000 Subject: [PATCH 2/5] feat: Add the logout functionality --- .../com/my_app/page/logout/LogoutAction.java | 30 +++++++++++++++++++ src/main/webapp/WEB-INF/struts-config.xml | 2 ++ src/main/webapp/incl/header.jsp | 2 +- 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 src/main/java/com/my_app/page/logout/LogoutAction.java diff --git a/src/main/java/com/my_app/page/logout/LogoutAction.java b/src/main/java/com/my_app/page/logout/LogoutAction.java new file mode 100644 index 0000000..a9fca36 --- /dev/null +++ b/src/main/java/com/my_app/page/logout/LogoutAction.java @@ -0,0 +1,30 @@ +package com.my_app.page.logout; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; + +import org.apache.struts.action.Action; +import org.apache.struts.action.ActionForm; +import org.apache.struts.action.ActionForward; +import org.apache.struts.action.ActionMapping; + +import com.my_app.AppConstants; +import com.my_app.utils.LoginUtils; + +public class LogoutAction extends Action { + + @Override + public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest req, + HttpServletResponse resp) throws Exception { + + if (LoginUtils.isUserNotLoggedIn(req.getSession())) { + return mapping.findForward("actionLoginRedir"); + } + + req.getSession().setAttribute(AppConstants.SESSION_ATTR_KEY_IS_LOGGED_IN, false); + req.getSession().setAttribute("username", null); + + return mapping.findForward("actionLoginRedir"); + } + +} diff --git a/src/main/webapp/WEB-INF/struts-config.xml b/src/main/webapp/WEB-INF/struts-config.xml index 12cd624..8810f1e 100644 --- a/src/main/webapp/WEB-INF/struts-config.xml +++ b/src/main/webapp/WEB-INF/struts-config.xml @@ -23,6 +23,8 @@ + + diff --git a/src/main/webapp/incl/header.jsp b/src/main/webapp/incl/header.jsp index 92be318..09eb7cc 100644 --- a/src/main/webapp/incl/header.jsp +++ b/src/main/webapp/incl/header.jsp @@ -27,7 +27,7 @@ From 160fe30d177be85e3f143efbb6c795de666a7d72 Mon Sep 17 00:00:00 2001 From: rit_croque Date: Fri, 2 Feb 2024 17:51:53 +0000 Subject: [PATCH 3/5] feat: Added private and public static page. --- src/main/webapp/incl/header.jsp | 6 ++++ src/main/webapp/js/static.js | 21 +++++++++++++ src/main/webapp/page-layout/static.jsp | 41 ++++++++++++++++++++++++++ 3 files changed, 68 insertions(+) create mode 100644 src/main/webapp/js/static.js create mode 100644 src/main/webapp/page-layout/static.jsp diff --git a/src/main/webapp/incl/header.jsp b/src/main/webapp/incl/header.jsp index 09eb7cc..1d5f026 100644 --- a/src/main/webapp/incl/header.jsp +++ b/src/main/webapp/incl/header.jsp @@ -16,6 +16,12 @@
  • Default
  • With sidebar
  • Full-width fluid
  • + +
  • Static Logged in
  • +
    + +
  • Static
  • +
    +
  • Companies
  • + +