summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorStefan Suhren <suhren.stefan@fh-swf.de>2015-11-16 10:29:28 +0100
committerStefan Suhren <suhren.stefan@fh-swf.de>2015-11-16 10:29:28 +0100
commit6df322a7475686908bb7634fdfab85182f46d336 (patch)
treebbd2f0953c89a8c545d572021332789d5f658477 /src
parentbe337434a721178cc3efeb468e873b571855b605 (diff)
downloadFIT-master.tar.gz
FIT-master.zip
Use jsp:useBean with the Account objectHEADmaster
Diffstat (limited to 'src')
-rw-r--r--src/de/fhswf/in/inf/fit/aufgabe6/LoginServletWithJpaAndJsp.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/de/fhswf/in/inf/fit/aufgabe6/LoginServletWithJpaAndJsp.java b/src/de/fhswf/in/inf/fit/aufgabe6/LoginServletWithJpaAndJsp.java
index e5611b8..498582b 100644
--- a/src/de/fhswf/in/inf/fit/aufgabe6/LoginServletWithJpaAndJsp.java
+++ b/src/de/fhswf/in/inf/fit/aufgabe6/LoginServletWithJpaAndJsp.java
@@ -64,9 +64,15 @@ public class LoginServletWithJpaAndJsp extends HttpServlet
// This is very insecure and can be exploited via timing attacks
if (account != null && account.isPasswordCorrect(requestPassword))
{
- request.getSession().setAttribute("username", account.getUsername());
+ request.getSession().setAttribute("user", account);
- response.sendRedirect("LoginSuccess.jsp");
+ // RequestDispatcher dispatcher = getServletContext()
+ // .getRequestDispatcher("/LoginSuccess.jsp");
+ //
+ // dispatcher.forward(request, response);
+
+ response
+ .sendRedirect(response.encodeRedirectURL("LoginSuccess.jsp"));
}
else
{