资源简介
基于JSP+Sevlet+mysql实现的人工智能专家系统——简易动物识别系统。
代码片段和文件信息
package com.st.servlet;
import java.io.IOException;
import java.io.PrintWriter;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
public class ManageServlet extends HttpServlet {
/**
* Constructor of the object.
*/
public ManageServlet() {
super();
}
/**
* Destruction of the servlet.
*/
public void destroy() {
super.destroy(); // Just puts “destroy“ string in log
// Put your code here
}
/**
* The doGet method of the servlet.
*
* This method is called when a form has its tag value method equals to get.
*
* @param request the request send by the client to the server
* @param response the response send by the server to the client
* @throws ServletException if an error occurred
* @throws IOException if an error occurred
*/
public void doGet(HttpServletRequest request HttpServletResponse response)
throws ServletException IOException {
response.setContentType(“text/html“);
PrintWriter out = response.getWriter();
out.println(““);
out.println(““);
out.println(“ tle>A Servlet tle>“);
out.println(“ “);
out.print(“ This is “);
out.print(this.getClass());
out.println(“ using the GET method“);
out.println(“ “);
out.println(““);
out.flush();
out.close();
}
/**
* The doPost method of the servlet.
*
* This method is called when a form has its tag value method equals to post.
*
* @param request the request send by the client to the server
* @param response the response send by the server to the client
* @throws ServletException if an error occurred
* @throws IOException if an error occurred
*/
public void doPost(HttpServletRequest request HttpServletResponse response)
throws ServletException IOException {
/*response.setContentType(“text/html“);
PrintWriter out = response.getWriter();
out.println(““);
out.println(““);
out.println(“ tle>A Servlet tle>“);
out.println(“ “);
out.print(“ This is “);
out.print(this.getClass());
out.println(“ using the POST method“);
out.println(“ “);
out.println(““);
out.flush();
out.close();*/
request.setCharacterEncoding(“UTF-8“);
//String username=request.getParameter(“name“);
//System.out.println(“用户名:“ + username);
/*测试用,查看前台传来的数据*/
String[] attr = request.getParameterValues(“attr“);
for(int i=0;i System.out.println(“第“+(i+1)+“属性值是:“+attr[i]);
/*跳转到结果界面*/
response.sendRedirect(“result.jsp“);
}
/**
* Initialization of the servlet.
*
* @throws ServletException if an error occurs
*/
public
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2017-10-16 09:33 animal_identifier\
文件 529 2017-10-12 15:27 animal_identifier\.classpath
目录 0 2017-10-16 09:33 animal_identifier\.myeclipse\
文件 324 2017-10-12 15:27 animal_identifier\.myme
文件 1760 2017-10-12 15:38 animal_identifier\.project
目录 0 2017-10-16 09:33 animal_identifier\.settings\
文件 500 2017-10-12 15:27 animal_identifier\.settings\.jsdtscope
文件 364 2017-10-12 15:27 animal_identifier\.settings\org.eclipse.jdt.core.prefs
文件 489 2017-10-12 15:27 animal_identifier\.settings\org.eclipse.wst.common.component
文件 252 2017-10-12 15:27 animal_identifier\.settings\org.eclipse.wst.common.project.facet.core.xm
文件 49 2017-10-12 15:27 animal_identifier\.settings\org.eclipse.wst.jsdt.ui.superType.container
文件 6 2017-10-12 15:27 animal_identifier\.settings\org.eclipse.wst.jsdt.ui.superType.name
目录 0 2017-10-16 09:33 animal_identifier\WebRoot\
目录 0 2017-10-16 09:33 animal_identifier\WebRoot\me
文件 36 2017-10-12 15:27 animal_identifier\WebRoot\me
目录 0 2017-10-16 09:33 animal_identifier\WebRoot\WEB-INF\
目录 0 2017-10-16 09:33 animal_identifier\WebRoot\WEB-INF\classes\
目录 0 2017-10-16 09:33 animal_identifier\WebRoot\WEB-INF\classes\com\
目录 0 2017-10-16 09:33 animal_identifier\WebRoot\WEB-INF\classes\com\st\
目录 0 2017-10-16 09:33 animal_identifier\WebRoot\WEB-INF\classes\com\st\servlet\
文件 2377 2017-10-16 09:17 animal_identifier\WebRoot\WEB-INF\classes\com\st\servlet\ManageServlet.class
目录 0 2017-10-16 09:33 animal_identifier\WebRoot\WEB-INF\lib\
文件 808 2017-10-12 15:53 animal_identifier\WebRoot\WEB-INF\web.xm
目录 0 2017-10-16 09:33 animal_identifier\WebRoot\images\
文件 499 2017-10-12 17:17 animal_identifier\WebRoot\images\btn2.png
文件 97481 2017-10-12 15:27 animal_identifier\WebRoot\images\cat.jpg
文件 4040 2017-10-16 09:31 animal_identifier\WebRoot\index.jsp
文件 847 2017-10-16 09:15 animal_identifier\WebRoot\result.jsp
目录 0 2017-10-16 09:33 animal_identifier\src\
目录 0 2017-10-16 09:33 animal_identifier\src\com\
目录 0 2017-10-16 09:33 animal_identifier\src\com\st\
............此处省略2个文件信息
评论
共有 条评论