建立了一个web项目webtestjava resourses -> src -> com.anaker.servlet(包)-> /webtest/src/com/anaker/servlet/HelloServlet.javaweb.xml如下<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5"> <servlet>
<servlet-name>hello</servlet-name>
<servlet-class>com.anaker.servlet.HelloServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>hello</servlet-name>
<url-pattern>/servlet/hello.html</url-pattern>
</servlet-mapping></web-app>
但是访问时会出现 题目 上报的错误该如何解决?谢谢
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5"> <servlet>
<servlet-name>hello</servlet-name>
<servlet-class>com.anaker.servlet.HelloServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>hello</servlet-name>
<url-pattern>/servlet/hello.html</url-pattern>
</servlet-mapping></web-app>
但是访问时会出现 题目 上报的错误该如何解决?谢谢
解决方案 »
- 怎么让xml文件只解析一次就可以了
- html里面的标签可以放在struts里面的<html:from>里面吗
- SQL效率问题:“insert into 表 select * from 表 ”对比“ 多个insert into 表 values(?,?,?)”
- web开发问题,在更新页面如何判断数据值已经更新?
- struts2 上传问题
- 怎样将表格的样式设置成像excel里面中间部分的那种?
- myeclipse6.0打开jsp文件出错,请各位老大帮忙!
- Eclipse+struts连接数据库找不到驱动问题
- 编译出错? 大家说可能是什么原因?
- 帮帮忙?在jsp中,文件下载时,如为txt文件,怎么添加程序,使其直接下载,而不是直接显示内容?谢谢!
- jsp 网页截图代码
- web.xml配置登录过滤器无法访问!
访问的时候就用这个名字访问,http://localhost:8080/servletname
方法中重定向:sendRedirect("http://127.0.0.1:8080/完整jsp页面路径);
为什么要这么设置呢?方法中重定向:sendRedirect("http://127.0.0.1:8080/完整jsp页面路径);这句话是什么意思?
在包中创建HelloServlet.java3、配置WebContent -> WEB-INF 下的web.xml如下
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5"> <servlet>
<servlet-name>hello</servlet-name>
<servlet-class>com.anaker.servlet.HelloServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>hello</servlet-name>
<url-pattern>/servlet</url-pattern>
</servlet-mapping></web-app>4、webtest工程上右键将整个工程 -> Export到tomcat/webapps中请大家指教