亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? servlet-config.xtp

?? 解壓在c盤
?? XTP
字號:
<s1 title="Servlet"><p>Servlets are Java classes which service HTTP requests.  The onlyrequirement for writing a servlet is that it implements thejavax.servlet.Servlet interface.</p><p>Servlets are loaded from the classpath like all Java classes.Normally, users put servlets in <var/WEB-INF/classes/> so Resin willautomatically reload them when they change.</p><p><a href='jsp.xtp'>JSP</a> pages are implemented asServlets, and tend to be more efficient for pages with lots of text.</p><s2 title='Examples'><s3 title='Configuring the web.xml'><p>The following is a complete working web.xml to run this example.</p><p>The <var/servlet-mapping/> tells Resin that the URL<var//hello/> should invoke the <var/hello-world/> servlet.</p><p>The <var/servlet/> tells Resin that <var/hello-world/> uses the<var/test.HelloWorld/> class and that the value of the <var/greeting/>init parameter is <var/Hello World/>.</p><example title='WEB-INF/web.xml'>&lt;web-app>  &lt;servlet-mapping url-pattern='/hello'                   servlet-name='hello-world'/>  &lt;servlet servlet-name='hello-world'           servlet-class='test.HelloWorld'>    &lt;init-param greeting='Hello, World'/>&lt;/web-app></example><p>The Java code, <var/HelloWorld.java/> belongs in</p><def>$app-dir/WEB-INF/classes/test/HelloWorld.java</def><p>Or, if you're compiling the servlet yourself, the class file belongs in</p><def>$app-dir/WEB-INF/classes/test/HelloWorld.class</def><p>Following is the actual servlet code.  It just prints a trivialHTML page filled with the greeting specified in the web.xml.</p><p><var/init()/> and <var/destroy()/> are included mostly forillustration.  Resin will call <var/init()/> when it starts the servletand <var/destroy/> before Resin destroys it.</p><example>package test;import java.io.*;import javax.servlet.*;import javax.servlet.http.*;public class HelloWorld extends HttpServlet {  private String greeting;  public void init()    throws ServletException  {    greeting = getInitParameter("greeting");  }  public void doGet(HttpServletRequest request,                    HttpServletResponse response)    throws ServletException, IOException  {    PrintWriter out = response.getWriter();    out.println("&lt;title>" + greeting + "&lt;/title>");    out.println("&lt;h1>" + greeting + "&lt;/h1>");  }    public void destroy()  {    // nothing to do  }}</example></s3><s3 title='Servlet Example for JSP Programmers'><p>Because Resin compiles JSP pages into servlets, programmers familiarwith JSP can start writing servlets fairly easily.  The following templatecan be used to see how to write a servlet for someone familiar with JSP.</p><example>package test;import java.io.*;import javax.servlet.*;import javax.servlet.http.*;public class HelloWorld extends HttpServlet {  public void service(HttpServletRequest request,                      HttpServletResponse response)    throws ServletException, IOException  {    PrintWriter out = response.getWriter();    ServletContext application = getServletContext();    HttpSession session = request.getSession();    try {      // <var/code goes here/>      // The equivalent of jsp:include:      // request.getRequestDispatcher("/inc.jsp").include(request, response);    } catch (ServletException e) {      throw e;    } catch (Exception e) {      throw new ServletException(e);    }  }}</example></s3><s3 title='Using Databases from a Servlet'><p>The following is a sample design pattern for getting new databaseconnections.  The <var/try ... finally/> block is very important.  Withoutthe close in the finally block, Resin's database pool can loose connections.</p><p>Configuring the database is described in the<a href="db-config.xtp">database configuration</a> page.</p><example title="TestDatabase.java">package test;import java.io.*;import java.sql.*;import javax.servlet.*;import javax.servlet.http.*;import javax.naming.*;import javax.sql.*;public class TestDatabase extends HttpServlet {  DataSource pool;  public void init()    throws ServletException  {    try {      Context env = (Context) new InitialContext().lookup("java:comp/env");      pool = (DataSource) env.lookup("jdbc/test");      if (pool == null)        throw new ServletException("`jdbc/test' is an unknown DataSource");    } catch (NamingException e) {      throw new ServletException(e);    }  }  public void doGet(HttpServletRequest request,                    HttpServletResponse response)    throws IOException, ServletException  {    response.setContentType("text/html");    PrintWriter out = response.getWriter();    Connection conn = null;    try {      conn = pool.getConnection();      // <var/code for the servlet using the database goes here/>      rs.close();      stmt.close();    } catch (SQLException e) {      throw new ServletException(e);    } finally {      try {        if (conn != null)          conn.close();      } catch (SQLException e) {      }    }  }}</example></s3></s2><s2 title="Servlet Configuration"><defun title="init" version="Resin 2.1.3"><p>Configures servlets using bean-style initialization.Each entry in an &lt;init> tag will configure a <code/setFoo/>method in a Servlet. JSP EL expressions are allowed.</p><p>The <code/init(config)/> method is called afterall the bean setters are called.</p><example title="Bean-style Configuration">&lt;servlet servlet-name='test.HelloWorld'&gt;  &lt;init&gt;    &lt;greeting&gt;Hello, ${host.url}&lt;/greeting>  &lt;/init&gt;&lt;/servlet&gt;</example><example title="HelloWorld bean">public HelloWorld extends GenericServlet {  private String _greeting;  public void setGreeting(String greeting)  {    _greeting = greetin;  }  public void service(ServletRequest req,                      ServletResponse res)    throws IOException, ServletException  {    PrintWriter out = res.getWriter();    out.println("Greeting: " + _greeting);  }}</example></defun><defun title='init-param'><p>Initializes servlet variables. <code/servlet-param/>defines initial values for <code/getServletConfig().getInitParameter("foo")/>.</p><p>The full servlet 2.2 syntax is supported and allows a simple shortcut.</p><example>&lt;web-app id='/'&gt;&lt;servlet servlet-name='test.HelloWorld'&gt;  &lt;init-param foo='bar'/&gt;  &lt;init-param&gt;    &lt;param-name&gt;baz&lt;/param-name&gt;    &lt;param-value&gt;value&lt;/param-value&gt;  &lt;/init-param&gt;&lt;/servlet&gt;&lt;/web-app></example></defun><defun title="load-on-startup"><p>If present, starts the servlet when the server starts.</p><example>&lt;web-app id='/'>&lt;servlet servlet-name='hello'         servlet-class='test.HelloWorld'&gt;  &lt;load-on-startup/&gt;&lt;/servlet&gt;&lt;/web-app&gt;</example></defun><defun title='run-at' version='Resin 1.1'><p>If present, calls the servlet's <var/service()/> methodat the specified times.&lt;run-at> lets servlet writers execute periodic tasks without worryingabout creating a new Thread.</p><p>The value is a list of 24-hour times when theservlet should be automatically executed.  To run the servlet every 6hours, you could use:</p><example>&lt;servlet servlet-name='test.HelloWorld'&gt;  &lt;run-at&gt;0:00, 6:00, 12:00, 18:00&lt;/run-at&gt;&lt;/servlet&gt;</example><p>If the hour is omitted, the servlet runs every hour at thespecified minute.  To run the server every 15 minutes, you could use:</p><example>&lt;servlet servlet-name='test.HelloWorld'&gt;  &lt;run-at&gt;:00, :15, :30, :45&lt;/run-at&gt;&lt;/servlet&gt;</example></defun><defun title='servlet'><p>Defines a servlet alias for later mapping.</p><deftable><tr><th>Attribute<th>Description<tr><td>servlet-name<td>The servlet's name (alias)<tr><td>servlet-class<td>The servlet's class (defaults to servlet-name)<tr><td>init-param<td>Initialization parameters<tr><td>load-on-startup<td>Initializes the servlet when the server starts.<tr><td>run-at<td>Times to execute the servlet automatically</deftable><p>The following example defines a servlet alias 'hello'</p><example>&lt;web-app id='/'&gt;&lt;servlet-mapping url-pattern='/hello.html'                 servlet-name='hello'/&gt;&lt;servlet servlet-name='hello'         servlet-class='test.HelloWorld'&gt;  &lt;init-param title='Hello, World'/&gt;&lt;/servlet&gt;&lt;servlet servlet-name='cron'         servlet-class='test.DailyChores'&gt;  &lt;run-at&gt;3:00&lt;/run-at&gt;&lt;/servlet&gt;&lt;/web-app&gt;</example></defun><defun title='servlet-class'><p>Class of the servlet.  The CLASSPATH for servlets includesthe WEB-INF/classes directory and all jars in the WEB-INF/lib directory.</p></defun><defun title="servlet-name"><p>Alias of the servlet, uniquely naming a servlet configuration.Several &lt;servlet> configurations might configure the sameservlet class with different &lt;init-param> values.  Each willhave a separate servlet-name.</p><example title="Multiple Servlets">&lt;web-app>  &lt;servlet servlet-name='foo-a'>    &lt;servlet-class>test.FooServlet&lt;/servlet-class>    &lt;init-param name='foo-a sample'/>  &lt;/servlet>  &lt;servlet servlet-name='foo-b'>    &lt;servlet-class>test.FooServlet&lt;/servlet-class>    &lt;init-param name='foo-b sample'/>  &lt;/servlet>&lt;/web-app></example></defun><defun title="servlet-mapping"><p>Maps from a URL to the servlet to execute.  The servlet-mappinghas a url-pattern to match the URL and a servlet-name to match theconfigured servlet.</p><example title="typical servlet-mapping">&lt;servlet>  &lt;servlet-name>hello&lt;/servlet-name>  &lt;servlet-class>test.HelloServlet&lt;/servlet-class>&lt;/servlet>&lt;servlet-mapping>  &lt;url-pattern>/hello/*&lt;/url-pattern>  &lt;servlet-name>hello&lt;/servlet-name>&lt;/servlet-mapping></example><p>Resin allows for a shortcut combining the servlet andthe servlet mapping:</p><example title="shortcut servlet-mapping">&lt;servlet-mapping url-pattern="/hello/*"                 servlet-class="test.HelloServlet"/></example></defun><defun title="url-pattern" version="Servlet 2.2"><p>Matches a set of URLs for servlet-mapping.</p><deftable><tr><th width='25%'>Pattern<th>Description<tr><td>/foo/bar.html<td>Matches exactly the /foo/bar.html URL.<tr><td>/foo/*<td>Matches /foo and any children<tr><td>*.foo<td>Matches any URL with a .foo extension<tr><td>/<td>Replaces the default servlet.</deftable><p><var///> defines a default handler and <var//*/> defines a prefix handler.<var//*/> will override extension handlers like <var/*.foo/>. <var///>will only be used if no other pattern matches.</p><p>No default.  Either url-pattern or url-regexp is required.</p></defun></s2></s1>

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品私人影院| 午夜av一区二区三区| 欧美日韩久久一区| 丁香一区二区三区| 偷拍一区二区三区四区| 国产精品乱人伦中文| 欧美成人性福生活免费看| 99久久精品99国产精品| 激情六月婷婷久久| 婷婷综合五月天| 亚洲私人黄色宅男| 久久久精品欧美丰满| 欧美一区二区三区的| 欧美亚日韩国产aⅴ精品中极品| 成人爽a毛片一区二区免费| 日本不卡不码高清免费观看| 亚洲黄色录像片| 中文字幕一区二区三区四区不卡| 精品人伦一区二区色婷婷| 国产精品区一区二区三| 3atv一区二区三区| 欧美亚洲国产bt| 一本色道久久综合狠狠躁的推荐| 欧美r级在线观看| 亚洲国产人成综合网站| 在线一区二区三区四区五区| 波多野结衣在线aⅴ中文字幕不卡| 精品中文av资源站在线观看| 日韩经典一区二区| 午夜久久久久久久久久一区二区| 亚洲精品久久7777| 亚洲女同ⅹxx女同tv| 中文字幕中文在线不卡住| 国产精品免费久久| 国产精品久久久99| 综合婷婷亚洲小说| 亚洲美女偷拍久久| 一区二区三区加勒比av| 亚洲男女一区二区三区| 亚洲男帅同性gay1069| 一区二区免费在线播放| 亚洲愉拍自拍另类高清精品| 亚洲成a人片在线观看中文| 亚洲国产精品久久不卡毛片| 午夜亚洲国产au精品一区二区| 亚洲午夜久久久久中文字幕久| 亚洲成人激情av| 日韩高清在线观看| 精品一区二区在线看| 国产一区久久久| 国产91露脸合集magnet| 成人av在线电影| 91网址在线看| 欧美在线一二三| 欧美一区二区在线免费观看| 日韩三级av在线播放| 久久五月婷婷丁香社区| 国产精品三级视频| 亚洲精品老司机| 日韩av在线播放中文字幕| 欧美一级欧美三级在线观看| 精品久久久久av影院 | 91精品国产免费久久综合| 欧美精品免费视频| 日韩欧美国产一区二区三区| 久久精品视频在线看| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆| 中文字幕日韩精品一区| 一区二区三区国产豹纹内裤在线| 青青草视频一区| 国产精品一区二区不卡| 一本大道久久a久久精二百 | 欧美色网站导航| 日韩美一区二区三区| 国产精品丝袜久久久久久app| 亚洲蜜臀av乱码久久精品| 免费成人在线视频观看| 成人毛片老司机大片| 欧美日韩一区二区三区免费看| 精品少妇一区二区三区在线播放| 国产精品欧美久久久久一区二区 | 亚洲曰韩产成在线| 精品一区二区三区免费观看| 99热99精品| 欧美变态tickling挠脚心| 亚洲精品免费看| 国产精品一区二区x88av| 欧美在线观看视频在线| 久久久久青草大香线综合精品| 亚洲久草在线视频| 国产一区二区三区免费观看| 在线观看日韩高清av| 国产丝袜欧美中文另类| 亚洲成av人片在线| 不卡一区在线观看| 精品日本一线二线三线不卡| 亚洲一区二区成人在线观看| 成人在线一区二区三区| 欧美一级高清大全免费观看| 亚洲精品水蜜桃| 国产精品综合一区二区三区| 欧美女孩性生活视频| 国产精品国产三级国产三级人妇| 久久99精品久久久久| 欧美视频在线播放| 亚洲欧美在线另类| 国产一区二区福利视频| 在线不卡一区二区| 亚洲精品v日韩精品| 成人免费视频caoporn| 精品国产三级a在线观看| 性做久久久久久久久| 一本大道久久a久久精品综合| 中文文精品字幕一区二区| 美女精品自拍一二三四| 欧美精品高清视频| 亚洲综合色视频| 91蝌蚪porny| 国产精品毛片大码女人| 精品一区二区三区视频在线观看| 欧美一区二区三区四区在线观看| 一区二区久久久久| 日本电影欧美片| 亚洲视频在线观看一区| 99re免费视频精品全部| 国产精品久久99| 成人app软件下载大全免费| 久久精品人人做人人爽人人| 韩国视频一区二区| 久久久另类综合| 国产成人在线看| 亚洲国产精品黑人久久久| 国产成人午夜精品5599| 中文字幕av不卡| a在线欧美一区| 亚洲天堂av老司机| 在线观看视频一区二区欧美日韩| 亚洲精品日产精品乱码不卡| 91老司机福利 在线| 亚洲一二三区在线观看| 欧美日韩一卡二卡三卡| 午夜精品久久久久久不卡8050| 欧美老年两性高潮| 日韩成人伦理电影在线观看| 日韩欧美一区在线| 国产乱码精品一品二品| 国产精品视频看| 色哟哟在线观看一区二区三区| 亚洲精品视频一区二区| 欧美日韩国产免费| 奇米精品一区二区三区四区 | 99九九99九九九视频精品| 自拍偷拍国产精品| 欧美视频一区二区| 美女任你摸久久| 国产欧美日本一区视频| 91麻豆精品视频| 亚洲国产成人91porn| 精品欧美一区二区三区精品久久| 丰满白嫩尤物一区二区| 18欧美亚洲精品| 欧美日本在线一区| 国产在线精品一区二区夜色| 中文欧美字幕免费| 精品视频一区三区九区| 久久国产尿小便嘘嘘尿| 国产精品免费av| 欧美精品v日韩精品v韩国精品v| 久久成人麻豆午夜电影| 国产精品午夜春色av| 欧美色爱综合网| 国产在线国偷精品产拍免费yy| 久久网这里都是精品| 亚洲一级不卡视频| 日韩一二在线观看| 丁香婷婷综合五月| 亚洲成人一二三| 久久亚洲影视婷婷| 日本高清不卡aⅴ免费网站| 看电影不卡的网站| 国产精品网站在线播放| 在线播放中文字幕一区| 高清av一区二区| 午夜精品久久久久久久99水蜜桃| 国产欧美一区二区三区鸳鸯浴 | 成人午夜电影小说| 亚洲图片欧美视频| 精品福利二区三区| 91久久精品国产91性色tv| 久久精品国产亚洲a| 一区二区三区美女| 欧美激情在线一区二区| 欧美精品精品一区| 一本久久精品一区二区| 国产麻豆91精品| 午夜精品久久久久久久99樱桃| 中文字幕亚洲不卡| 精品国产1区2区3区| 欧美日本一区二区| 91蜜桃网址入口|