chakan11_0002ejsp_jsp.java
资源名称:JSP02.rar [点击查看]
上传用户:top0756
上传日期:2022-08-11
资源大小:6501k
文件大小:7k
源码类别:
Jsp/Servlet
开发平台:
VBScript
- import java.sql.*;
- import java.util.*;
- import proj112.*;
- import javax.servlet.*;
- import javax.servlet.http.*;
- import javax.servlet.jsp.*;
- import org.apache.jasper.runtime.*;
- public class chakan11_0002ejsp_jsp extends HttpJspBase {
- // begin [file="/chakan11.jsp";from=(5,0);to=(5,57)]
- // end
- static {
- }
- public chakan11_0002ejsp_jsp( ) {
- }
- private static boolean _jspx_inited = false;
- public final void _jspx_init() throws org.apache.jasper.runtime.JspException {
- }
- 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;
- String _value = null;
- try {
- if (_jspx_inited == false) {
- synchronized (this) {
- if (_jspx_inited == false) {
- _jspx_init();
- _jspx_inited = true;
- }
- }
- }
- _jspxFactory = JspFactory.getDefaultFactory();
- response.setContentType("text/html; charset=GBK");
- pageContext = _jspxFactory.getPageContext(this, request, response,
- "", true, 8192, true);
- application = pageContext.getServletContext();
- config = pageContext.getServletConfig();
- session = pageContext.getSession();
- out = pageContext.getOut();
- // HTML // begin [file="/chakan11.jsp";from=(0,48);to=(1,0)]
- out.write("rn");
- // end
- // HTML // begin [file="/chakan11.jsp";from=(1,31);to=(2,0)]
- out.write("rn");
- // end
- // HTML // begin [file="/chakan11.jsp";from=(2,27);to=(3,0)]
- out.write("rn");
- // end
- // HTML // begin [file="/chakan11.jsp";from=(3,32);to=(4,0)]
- out.write("rn");
- // end
- // HTML // begin [file="/chakan11.jsp";from=(4,30);to=(5,0)]
- out.write("rn");
- // end
- // begin [file="/chakan11.jsp";from=(5,0);to=(5,57)]
- proj112.dbconn a = null;
- boolean _jspx_speciala = false;
- synchronized (pageContext) {
- a= (proj112.dbconn)
- pageContext.getAttribute("a",PageContext.PAGE_SCOPE);
- if ( a == null ) {
- _jspx_speciala = true;
- try {
- a = (proj112.dbconn) java.beans.Beans.instantiate(this.getClass().getClassLoader(), "proj112.dbconn");
- } catch (ClassNotFoundException exc) {
- throw new InstantiationException(exc.getMessage());
- } catch (Exception exc) {
- throw new ServletException (" Cannot create bean of class "+"proj112.dbconn", exc);
- }
- pageContext.setAttribute("a", a, PageContext.PAGE_SCOPE);
- }
- }
- if(_jspx_speciala == true) {
- // end
- // begin [file="/chakan11.jsp";from=(5,0);to=(5,57)]
- }
- // end
- // HTML // begin [file="/chakan11.jsp";from=(5,57);to=(16,28)]
- out.write("rn<html>rn<head>rn<script language="javascript">rn function a(){alert("修改成功");history.back();}rn</script>rn<title>rnchakan1_1_1rn</title>rn</head>rn<body bgcolor="#ffffff">rn<br /> 学号:<font color="red">");
- // end
- // begin [file="/chakan11.jsp";from=(16,31);to=(16,62)]
- out.print(session.getAttribute("stu_id") );
- // end
- // HTML // begin [file="/chakan11.jsp";from=(16,64);to=(16,105)]
- out.write("</font> 课程号:<font color="red">");
- // end
- // begin [file="/chakan11.jsp";from=(16,108);to=(16,135)]
- out.print(request.getParameter("id") );
- // end
- // HTML // begin [file="/chakan11.jsp";from=(16,137);to=(17,5)]
- out.write("</font> 修改学生成绩:<br><br><hr>rn ");
- // end
- // begin [file="/chakan11.jsp";from=(17,7);to=(27,5)]
- String stu_id=(String)session.getAttribute("stu_id");
- String kechenghao=request.getParameter("id");
- String sql="";
- sql="SELECT * FROM 成绩关联 where stu_id='"+stu_id+"' and 课程号='"+kechenghao+"'";
- ResultSet rs=a.executeQuery(sql);
- if(rs.next()){
- String cj=rs.getString("成绩");
- String cj2=rs.getString("重修成绩");
- // end
- // HTML // begin [file="/chakan11.jsp";from=(27,7);to=(31,69)]
- out.write("rnrn <form action="chakan111.jsp" method="POST">rn <center>rn <br><br>原始成绩: <input type="text" name="cj" value="");
- // end
- // begin [file="/chakan11.jsp";from=(31,72);to=(31,74)]
- out.print(cj);
- // end
- // HTML // begin [file="/chakan11.jsp";from=(31,76);to=(32,66)]
- out.write("">rn <br> <br><br>重修成绩: <input type="text" name="cj2" value="");
- // end
- // begin [file="/chakan11.jsp";from=(32,69);to=(32,72)]
- out.print(cj2);
- // end
- // HTML // begin [file="/chakan11.jsp";from=(32,74);to=(37,1)]
- out.write("">rn <br><br /><br>rn <input type="submit" name="subit" value="确认" onclick="return a()"> <input type="reset" name="reset" value="重写">rn </center>rn </form>rn ");
- // end
- // begin [file="/chakan11.jsp";from=(37,3);to=(40,1)]
- }
- session.setAttribute("stu_id",stu_id);
- session.setAttribute("kechenghao",kechenghao);
- // end
- // HTML // begin [file="/chakan11.jsp";from=(40,3);to=(43,0)]
- out.write("rn</body>rn</html>rn");
- // end
- } catch (Throwable t) {
- if (out != null && out.getBufferSize() != 0)
- out.clearBuffer();
- if (pageContext != null) pageContext.handlePageException(t);
- } finally {
- if (_jspxFactory != null) _jspxFactory.releasePageContext(pageContext);
- }
- }
- }