Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

½â¾öJSPÂÒÂëµÄ¹ýÂËÆ÷

----*web.xml *----
----*web.xml *----
  <filter>
    <filter-name>MyFilter</filter-name>
    <filter-class>cray.util.MyFilter</filter-class>
  </filter>
 
  <filter-mapping>
    <filter-name>MyFilter</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>
------------MyFilter.java-------------
import javax.servlet.*;
import javax.servlet.http.HttpServlet;
import java.io.IOException;
public class MyFilter extends HttpServlet implements Filter
{
 private FilterConfig filterConfig;
 public void init(FilterConfig filterConfig) throws ServletException
 {
  this.filterConfig = filterConfig;
 }
 public void doFilter(ServletRequest request, ServletResponse response,
   FilterChain filterChain)
 {
  try
  {
   request.setCharacterEncoding("GBK");
   filterChain.doFilter(request, response);
  } catch (ServletException sx)
  {
   filterConfig.getServletContext().log(sx.getMessage());
  } catch (IOException iox)
  {
   filterConfig.getServletContext().log(iox.getMessage());
  }
 }
 public void destroy()
 {
 }
}
 


Ïà¹ØÎĵµ£º

jsp·ÖÒ³£¨oracle+jsp+apache£©

Ò» Ç°Ìá 
Ï£Íû×îеļͼÔÚ¿ªÍ·¸øÄãµÄ±í½¨Á¢²éѯ£º
±í£ºmytable 
²éѯ£ºcreate or replace view as mytable_view from mytable order by id desc ÆäÖУ¬×îºÃʹÓÃÐòÁкÅcreate sequence mytable_sequence À´×Ô¶¯Ôö¼ÓÄãµÄ¼ ......

jsp ¼òµ¥·ÖÒ³

//×ܼǼÊý
                int count = personDao.getCount();
                //ÿҳÏÔʾ5Ìõ
                int pageSi ......

jspÁ¬½Óoracle£¨javabean£©


package DBbean;
import java.sql.*;
public class ConnBean
{
private Connection con;
//³õʼ»¯Á¬½Ó¡£
public ConnBean()
{
        
  try
  {
   Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
   ......

jsp notes

<%@   page   c   language="java"%>  
  <%@   page   import="com.dragon.*"   %>  
  <%@   page   import="lotus.domino.*"   %>  
  <%!  ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ