关于jsp页面放入tomcat5.0的位置???? 看抱错信息:java.lang.NoClassDefFoundError没有找到classes:com/jspdev/ch5/SimpleCalculator!把这个class文件放到ch5/web-inf/classes里面! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 兄弟,不能这么搞的建了ch5后还要再建几个目录,结构如下:ch5\ servlets\SimpleCalculator.jsp \ WEB-INF\classes\SimpleCalculator.class \web.xml其中web.xml更改后要restart Tomcat----------<!--web.xml文件的内容 --><!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd"> <web-app> <!-- General description of your Web application --> <display-name> test </display-name> <description> test </description> <!-- Servlet definitions --> <servlet> <servlet-name>test</servlet-name> <description> test </description> <servlet-class> SimpleCalculator </servlet-class> </servlet> <!-- Servlet mappings --> <servlet-mapping> <servlet-name>test</servlet-name> <url-pattern>/test</url-pattern> </servlet-mapping> </web-app>在IE中输入localhost:8080/ch5/servlet/SimpleCalculator.jsp试试,应该可以的; 和我的错误多阿HTTP Status 404http://community.csdn.net/Expert/topic/3469/3469373.xml?temp=.2387659 把你ROOT目录中的WEB-INF这个目录拷贝到你的ch5目录下,就可以了 有 WEB-INF 吗?就是 ROOT 下的那个文件,你只要直接拷贝过来就成了 ! ytfei(飞):web.xml中要自已写吗?我没有学过xml。 那也就是说,任何一个目录下要编译jsp文件就一定要有WEB-INF 和web.xml才行是吗?那web.xml具体里面写的代码是什么意思!! 修改tomcat_home/conf/server.xml:在<host></host>之间写入:<context path="yourpath" docBase="yourDoc" debug="0"/>这样就行了。 对了,修改过后需要重新启动tomcat jerrykey(钥匙)那样加进去会不会把它原本默认的改了呢? Swing 窗口重绘刷新 Struts2传参 递归输出数字金字塔(求更简单代码) 编写JAVA 邮件收发 在java中replace 问题 jsp 登陆验证 一个初级的问题,请大家帮帮忙. ANT的一个小问题 大家帮看看 @@ Struts问题:为什么从Action中返回的JSP网页在定位图片时找不到路径?? 高分求jboss + mysql的EJB例子。 在java中直接中断程序用什么呢? JDBC SQL 2000 的连接选项
建了ch5后还要再建几个目录,结构如下:
ch5\ servlets\SimpleCalculator.jsp
\ WEB-INF\classes\SimpleCalculator.class
\web.xml
其中web.xml更改后要restart Tomcat
----------
<!--web.xml文件的内容 -->
<!DOCTYPE web-app PUBLIC
"-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN"
"http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
<web-app>
<!-- General description of your Web application -->
<display-name>
test
</display-name>
<description>
test
</description>
<!-- Servlet definitions -->
<servlet>
<servlet-name>test</servlet-name>
<description>
test
</description>
<servlet-class>
SimpleCalculator
</servlet-class>
</servlet>
<!-- Servlet mappings -->
<servlet-mapping>
<servlet-name>test</servlet-name>
<url-pattern>/test</url-pattern>
</servlet-mapping>
</web-app>在IE中输入
localhost:8080/ch5/servlet/SimpleCalculator.jsp
试试,应该可以的;
HTTP Status 404
http://community.csdn.net/Expert/topic/3469/3469373.xml?temp=.2387659
我没有学过xml。
在<host></host>之间写入:
<context path="yourpath" docBase="yourDoc" debug="0"/>
这样就行了。