本文整理了Java中org.eclipse.jetty.webapp.WebAppContext.getWelcomeFiles()
方法的一些代码示例,展示了WebAppContext.getWelcomeFiles()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebAppContext.getWelcomeFiles()
方法的具体详情如下:
包路径:org.eclipse.jetty.webapp.WebAppContext
类名称:WebAppContext
方法名:getWelcomeFiles
暂无
代码示例来源:origin: org.eclipse.jetty/jetty-webapp
public void addWelcomeFiles(WebAppContext context, XmlParser.Node node)
{
Iterator<XmlParser.Node> iter = node.iterator("welcome-file");
while (iter.hasNext())
{
XmlParser.Node indexNode = (XmlParser.Node) iter.next();
String welcome = indexNode.toString(false, true);
//Servlet Spec 3.0 p. 74 welcome files are additive
if (welcome != null && welcome.trim().length() > 0)
context.setWelcomeFiles((String[])ArrayUtil.addToArray(context.getWelcomeFiles(),welcome,String.class));
}
}
代码示例来源:origin: jenkinsci/winstone
public void addWelcomeFiles(WebAppContext context, XmlParser.Node node)
{
Iterator<XmlParser.Node> iter = node.iterator("welcome-file");
while (iter.hasNext())
{
XmlParser.Node indexNode = (XmlParser.Node) iter.next();
String welcome = indexNode.toString(false, true);
//Servlet Spec 3.0 p. 74 welcome files are additive
if (welcome != null && welcome.trim().length() > 0)
context.setWelcomeFiles((String[])ArrayUtil.addToArray(context.getWelcomeFiles(),welcome,String.class));
}
}
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-plus
/**
* @param context
* @param node
*/
protected void addWelcomeFiles(WebAppContext context, XmlParser.Node node)
{
Iterator<XmlParser.Node> iter = node.iterator("welcome-file");
while (iter.hasNext())
{
XmlParser.Node indexNode = (XmlParser.Node) iter.next();
String welcome = indexNode.toString(false, true);
//Servlet Spec 3.0 p. 74 welcome files are additive
if (welcome != null && welcome.trim().length() > 0)
context.setWelcomeFiles((String[])LazyList.addToArray(context.getWelcomeFiles(),welcome,String.class));
}
}
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-all-server
/**
* @param context
* @param node
*/
protected void addWelcomeFiles(WebAppContext context, XmlParser.Node node)
{
Iterator<XmlParser.Node> iter = node.iterator("welcome-file");
while (iter.hasNext())
{
XmlParser.Node indexNode = (XmlParser.Node) iter.next();
String welcome = indexNode.toString(false, true);
//Servlet Spec 3.0 p. 74 welcome files are additive
if (welcome != null && welcome.trim().length() > 0)
context.setWelcomeFiles((String[])LazyList.addToArray(context.getWelcomeFiles(),welcome,String.class));
}
}
代码示例来源:origin: org.eclipse.jetty.aggregate/jetty-webapp
/**
* @param context
* @param node
*/
protected void addWelcomeFiles(WebAppContext context, XmlParser.Node node)
{
Iterator<XmlParser.Node> iter = node.iterator("welcome-file");
while (iter.hasNext())
{
XmlParser.Node indexNode = (XmlParser.Node) iter.next();
String welcome = indexNode.toString(false, true);
//Servlet Spec 3.0 p. 74 welcome files are additive
if (welcome != null && welcome.trim().length() > 0)
context.setWelcomeFiles((String[])LazyList.addToArray(context.getWelcomeFiles(),welcome,String.class));
}
}
代码示例来源:origin: com.ovea.tajin.server/tajin-server-jetty9
/**
* @param context
* @param node
*/
protected void addWelcomeFiles(WebAppContext context, XmlParser.Node node)
{
Iterator<XmlParser.Node> iter = node.iterator("welcome-file");
while (iter.hasNext())
{
XmlParser.Node indexNode = (XmlParser.Node) iter.next();
String welcome = indexNode.toString(false, true);
//Servlet Spec 3.0 p. 74 welcome files are additive
context.setWelcomeFiles((String[])ArrayUtil.addToArray(context.getWelcomeFiles(),welcome,String.class));
}
}
代码示例来源:origin: com.ovea.tajin.servers/tajin-server-jetty9
/**
* @param context
* @param node
*/
protected void addWelcomeFiles(WebAppContext context, XmlParser.Node node)
{
Iterator<XmlParser.Node> iter = node.iterator("welcome-file");
while (iter.hasNext())
{
XmlParser.Node indexNode = (XmlParser.Node) iter.next();
String welcome = indexNode.toString(false, true);
//Servlet Spec 3.0 p. 74 welcome files are additive
context.setWelcomeFiles((String[])ArrayUtil.addToArray(context.getWelcomeFiles(),welcome,String.class));
}
}
代码示例来源:origin: org.onebusaway/onebusaway-quickstart-mains
@Override
public void handle(String target, Request baseRequest,
HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException {
String[] welcomeFiles = _context.getWelcomeFiles();
if (welcomeFiles != null && target.endsWith("/")) {
for (String welcomeFile : welcomeFiles) {
String path = target;
path += welcomeFile;
Context context = _context.getServletContext();
URL resource = context.getResource(path);
if (resource != null) {
target = path;
baseRequest.setPathInfo(target);
_context.handle(target, baseRequest, request, response);
return;
}
}
}
}
}
代码示例来源:origin: OneBusAway/onebusaway-application-modules
@Override
public void handle(String target, Request baseRequest,
HttpServletRequest request, HttpServletResponse response)
throws IOException, ServletException {
String[] welcomeFiles = _context.getWelcomeFiles();
if (welcomeFiles != null && target.endsWith("/")) {
for (String welcomeFile : welcomeFiles) {
String path = target;
path += welcomeFile;
Context context = _context.getServletContext();
URL resource = context.getResource(path);
if (resource != null) {
target = path;
baseRequest.setPathInfo(target);
_context.handle(target, baseRequest, request, response);
return;
}
}
}
}
}
代码示例来源:origin: org.eclipse.jetty/jetty-quickstart
if (_webApp.getWelcomeFiles() != null)
for (String welcomeFile:_webApp.getWelcomeFiles())
内容来源于网络,如有侵权,请联系作者删除!