简单web项目注意

来源:互联网 发布:手机淘宝链接转换 编辑:程序博客网 时间:2024/06/13 08:31

晚上写一个原生的web项目,留一些记录:
1. 记忆下servlet 3.0的web.xml文件格式:

<?xml version="1.0" encoding="UTF-8"?><web-app version="3.0"     xmlns="http://java.sun.com/xml/ns/javaee"     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"     xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"></web-app>
  1. 做好的项目无法访问url
    看了下是tomcat发布的WEB-INF/classes文件里没有class文件
    首先确认项目会自动build,eclipse-project-build automatically
    再次查看build的目录,原来使用了默认的build/classes目录,修改为当前项目的WebContent/WEB-INF/classes目录,没有的话就新建。重启eclipse后可以运行了。
0 0