⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dispatch.java

📁 resinweb服务器源文件
💻 JAVA
字号:
/* * Copyright 1998-2000 Caucho Technology -- all rights reserved */package xsl;import java.io.*;import javax.servlet.*;import javax.servlet.http.*;/** * A simple example of using the same XTP page with multiple stylesheets. * * Dispatch handles the *.xml extension.  If the filename ends with * /plain, use the plain.xsl stylesheet.  Otherwise use the default * stylesheet. */public class Dispatch extends GenericServlet {  public void service(ServletRequest request,                      ServletResponse response)    throws IOException, ServletException  {    HttpServletRequest req = (HttpServletRequest) request;        // Based on getPathInfo, use either plain.xsl or default.xsl        if ("plain".equals(req.getQueryString())) {      req.setAttribute("caucho.xsl.stylesheet", "plain.xsl");    }    else {      req.setAttribute("caucho.xsl.stylesheet", "default.xsl");    }    // Now forward to the XTP servlet.    ServletContext app = getServletContext();        RequestDispatcher disp = app.getNamedDispatcher("xtp");    disp.forward(req, response);    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -