本周对于Java的学习
一、确定jetty-maven-plugin的版本配置
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-maven-plugin</artifactId>
<configuration>
<webApp>
<contextPath>/test</contextPath>
</webApp>
<connectors>
<connector implementation="org.eclipse.jetty.server.nio.SelectChannelConnector">
<port>8081</port>
<maxIdleTime>6000</maxIdleTime>
</connector>
</connectors>
</configuration>
</plugin>
二、设计一个简单的测试类并设置端口后登录查看
1.将默认端口8080改为8081,test为patch的value
2.通过浏览器进行访问http://localhost:8081/test/Login查看
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
resp.setCharacterEncoding("utf-8");
PrintWriter out = resp.getWriter();
out.println("<html>");
out.println("<header>");
out.println("<title>test</title>");
out.println("</h