# login success in index ### index.jsp 21~26 ```java= <% String updateErrorCode = (String)session.getAttribute("update_error_code"); String updateErrorMsg = (String)session.getAttribute("update_error_msg"); pageContext.setAttribute("update_error_code", updateErrorCode); pageContext.setAttribute("update_error_msg", updateErrorMsg); %> ``` 207~216 ```java= <script> if ("${update_error_code}" !== "") { Swal.fire({ icon : "${update_error_code}" === "0" ? 'success' : "warning", text : "${update_error_msg}", }) } <%session.removeAttribute("update_error_code");%> <%session.removeAttribute("update_error_msg");%> </script> ``` ### coaServlet 276~279 ```java= /*************************** 3.新增完成,準備轉交(Send the Success view) ***********/ // 用來給alert辨認新增是否成功,成功為0以及成功訊息 String url = "/front-end/index.jsp"; req.getSession().setAttribute("update_error_code", "0"); req.getSession().setAttribute("update_error_msg", "註冊成功!"); res.sendRedirect(req.getContextPath() + url); ``` ### stuServlet 133~137 ```java= /*************************** 3.新增完成,準備轉交(Send the Success view) ***********/ String url = "/front-end/index.jsp"; req.getSession().setAttribute("update_error_code", "0"); req.getSession().setAttribute("update_error_msg", "註冊成功!"); res.sendRedirect(req.getContextPath() + url); ```
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up