我的servlet的名字是HelloWorld
将.class文件放到...\ROOT\WEB-INF\classes 里
也设置了web.xml:
<servlet-mapping>
<servlet-name>invoker</servlet-name>
<url-pattern>/servlet/HelloWorld</url-pattern>
</servlet-mapping>浏览器http://localhost:1776/servlet/HelloWorld
里显示resource not avavilble
到底哪里错了呢?
将.class文件放到...\ROOT\WEB-INF\classes 里
也设置了web.xml:
<servlet-mapping>
<servlet-name>invoker</servlet-name>
<url-pattern>/servlet/HelloWorld</url-pattern>
</servlet-mapping>浏览器http://localhost:1776/servlet/HelloWorld
里显示resource not avavilble
到底哪里错了呢?
<servlet-name>invoker</servlet-name>
<servlet-class>HelloWorld</servlet-class>
</servlet>这个设没
把你的也放里面了
连tom-cat都启动不了啦
<!--
Copyright 2004 The Apache Software Foundation Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
--><web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4"> <display-name>Welcome to Tomcat</display-name>
<description>
Welcome to Tomcat
</description>
<!-- JSPC servlet mappings start -->
<servlet>
<servlet-name>invoker</servlet-name>
<servlet-class>HelloWorld</servlet-class>
</servlet> <servlet-mapping>
<servlet-name>invoker</servlet-name>
<url-pattern>/servlet/HelloWorld</url-pattern>
</servlet-mapping><!-- JSPC servlet mappings end --></web-app>
我本来就没看这条,我去WC了回来就看见了上面的
我小弟弟说要交管理员删除我的id好叫我不上csnd了
而是和他玩
一般来说web。xml 是不用你来写的亚?
他是可以自主声称的亚
你的工程大麻 如果不打得花 你就在建立一个
在把你的代码放到新的工程里去
你是是web。xml 应该是一个新的了
访问主页都不行了 错误:
type Status reportmessage No Context configured to process this requestdescription The server encountered an internal error (No Context configured to process this request) that prevented it from fulfilling this request.我的web.xml文件:
<?xml version="1.0" encoding="ISO-8859-1"?><!DOCTYPE web-app
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd"><web-app>
<display-name>Welcome to Tomcat</display-name>
<description>
Welcome to Tomcat
</description><!-- JSPC servlet mappings start --><servlet>
<servlet-name>invoker</servlet-name>
<servlet-class>HelloWorld</servlet-class>
</servlet><servlet-mapping>
<servlet-name>invoker</servlet-name>
<url-pattern>/servlet/HelloWorld</url-pattern>
</servlet-mapping><!-- JSPC servlet mappings end --></web-app>
除了:
/conf/server.xml里的port
/webapps/ROOT/WEB-INF/web.xml里添加mapping还有哪里呀?
再在server.xml里改一下comtext里的path="/ROOT" docBase="ROOT"(或自己的文件路径)唉~ 真实让人失望
这么个小问题折腾我一晚上