?? matchselect.java
字號(hào):
//通用查詢模塊2的入口servlet
package find;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;
import javax.servlet.ServletException;
import javax.servlet.RequestDispatcher;
import java.io.IOException;
import java.io.PrintWriter;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.Enumeration;
public class MatchSelect extends HttpServlet{
private HttpSession hs;
private String xml;
private String matchString;
public void service(HttpServletRequest req,HttpServletResponse res) throws ServletException,IOException{
res.setContentType("text/html;charset=gb2312");
PrintWriter out = res.getWriter();
hs = req.getSession();
//req.setCharacterEncoding("gb2312");
Enumeration enum = req.getParameterNames();
String temp;
while(enum.hasMoreElements()){
temp = enum.nextElement().toString();
if(temp.startsWith("xml")) this.xml= req.getParameter(temp);
if(temp.startsWith("match")) this.matchString= req.getParameter(temp);//new String(.getBytes("ISO-8859-1"),"GB2312");
}
//System.out.println(xml);
String realpath = getServletContext().getRealPath("/");// +"/classes"+'/';
//System.out.println(realpath+xml);
MatchSelectBean msb = new MatchSelectBean();
//new SqlConnection().getSQLConnection();
try{
msb.parse(realpath+this.xml);
}catch(Exception e){
e.printStackTrace();
}
/*
System.out.println(msb.getTitle());
System.out.println(msb.getBack());
System.out.println(msb.getHide());
System.out.println(msb.getMatchColumn());
System.out.println(msb.getSql());
String ss[] = msb.getColumn();
for(int i=0;i<ss.length;i++)System.out.println(ss[i]);
*/
//hs.setAttribute("title",mscp.getTitle());
//重定向
res.sendRedirect("MatchList.jsp?xml="+realpath+this.xml+"&match="+this.matchString);
}
public static void main(String args[]){
}
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -