jetty 插件启动

版权声明:本文为博主原创文章,遵循 CC 4.0 BY 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/qq_41592652/article/details/88312978

HTML中输出格式设定:

response.setContentType("text:html;charset=utf-8");

重定向:

response.sendRedirect("/index.html")

jetty 插件启动(比tomcat启动快几倍)

        <plugin>
				<groupId>org.eclipse.jetty</groupId>
				<artifactId>jetty-maven-plugin</artifactId>
				<version>9.4.11.v20180605</version>
				<configuration>
					<httpConnector>
						<port>80</port>
					</httpConnector>
					<webAppConfig>
						<contextPath>/</contextPath>
					</webAppConfig>
				</configuration>
			</plugin>
展开阅读全文

启动jetty遇到问题

08-18

[code=java]Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/jetty/util/Attributesrn at java.lang.ClassLoader.defineClass1(Native Method)rn at java.lang.ClassLoader.defineClass(ClassLoader.java:800)rn at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)rn at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)rn at java.net.URLClassLoader.access$100(URLClassLoader.java:71)rn at java.net.URLClassLoader$1.run(URLClassLoader.java:361)rn at java.net.URLClassLoader$1.run(URLClassLoader.java:355)rn at java.security.AccessController.doPrivileged(Native Method)rn at java.net.URLClassLoader.findClass(URLClassLoader.java:354)rn at java.lang.ClassLoader.loadClass(ClassLoader.java:425)rn at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)rn at java.lang.ClassLoader.loadClass(ClassLoader.java:358)rn at net.sourceforge.eclipsejetty.starter.embedded.JettyEmbeddedLauncherMain.createAdapter(JettyEmbeddedLauncherMain.java:68)rn at net.sourceforge.eclipsejetty.starter.common.AbstractJettyLauncherMain.launch(AbstractJettyLauncherMain.java:74)rn at net.sourceforge.eclipsejetty.starter.embedded.JettyEmbeddedLauncherMain.main(JettyEmbeddedLauncherMain.java:42)rnCaused by: java.lang.ClassNotFoundException: org.eclipse.jetty.util.Attributesrn at java.net.URLClassLoader$1.run(URLClassLoader.java:366)rn at java.net.URLClassLoader$1.run(URLClassLoader.java:355)rn at java.security.AccessController.doPrivileged(Native Method)rn at java.net.URLClassLoader.findClass(URLClassLoader.java:354)rn at java.lang.ClassLoader.loadClass(ClassLoader.java:425)rn at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)rn at java.lang.ClassLoader.loadClass(ClassLoader.java:358)rn ... 15 morern[/code]rn这什么情况?jdk确定是1.7(在网上看到有说是jdk版本低的原因的) 论坛

没有更多推荐了,返回首页