📄 modifyaction_jsp.java
字号:
package org.apache.jsp.teacher;
import javax.servlet.*;
import javax.servlet.http.*;
import javax.servlet.jsp.*;
import base.page.Show;
import base.db.Data;
public final class modifyaction_jsp extends org.apache.jasper.runtime.HttpJspBase
implements org.apache.jasper.runtime.JspSourceDependent {
private static java.util.Vector _jspx_dependants;
public java.util.List getDependants() {
return _jspx_dependants;
}
public void _jspService(HttpServletRequest request, HttpServletResponse response)
throws java.io.IOException, ServletException {
JspFactory _jspxFactory = null;
PageContext pageContext = null;
HttpSession session = null;
ServletContext application = null;
ServletConfig config = null;
JspWriter out = null;
Object page = this;
JspWriter _jspx_out = null;
PageContext _jspx_page_context = null;
try {
_jspxFactory = JspFactory.getDefaultFactory();
response.setContentType("text/html; charset=gb2312");
pageContext = _jspxFactory.getPageContext(this, request, response,
null, true, 8192, true);
_jspx_page_context = pageContext;
application = pageContext.getServletContext();
config = pageContext.getServletConfig();
session = pageContext.getSession();
out = pageContext.getOut();
_jspx_out = out;
out.write("\r\n\r\n\r\n");
request.setCharacterEncoding("GB2312");
out.write('\r');
out.write('\n');
base.Teacher tea = null;
synchronized (session) {
tea = (base.Teacher) _jspx_page_context.getAttribute("tea", PageContext.SESSION_SCOPE);
if (tea == null){
tea = new base.Teacher();
_jspx_page_context.setAttribute("tea", tea, PageContext.SESSION_SCOPE);
}
}
out.write('\r');
out.write('\n');
Show show=new Show();
String strPassword=(String)request.getParameter("password");
String strrPassword=(String)request.getParameter("rpassword");
if (strPassword.equals(strrPassword)){
if(strPassword.equals("")){
out.print(show.errorBox("请填写密码!","错误信息"));
return;
}else{
int intT=0;
Data data=new Data();
intT=data.update("UPDATE teacher SET password="+strPassword+" WHERE id="+tea.getId()+";");
if(intT<=0){
out.print(show.errorBox("修改失败,数据库错误!","错误信息"));
return;
}else{
tea.setPassword(strPassword);
out.print("<script>alert('修改成功!');document.location='index.jsp';</script>");
}
}
}
else{
out.print(show.errorBox("两次输入的密码不一致!","错误信息"));
}
out.write('\r');
out.write('\n');
} catch (Throwable t) {
if (!(t instanceof SkipPageException)){
out = _jspx_out;
if (out != null && out.getBufferSize() != 0)
out.clearBuffer();
if (_jspx_page_context != null) _jspx_page_context.handlePageException(t);
}
} finally {
if (_jspxFactory != null) _jspxFactory.releasePageContext(_jspx_page_context);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -