jsp调servlet路径的问题!!!! http://localhost:8080/image/showimage试试。 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 http://localhost:8080/showimage改为http://localhost:8080/servlet/image/showimage 错了,试试这个:http://localhost:8080/servers/image/showimage // * 修改 web.xmo *//<?xml version="1.0" ?><!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 1.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd"><web-app> <servlet> <servlet-name> showimage </servlet-name> <servlet-class> image.showimage </servlet-class> </servlet> <servlet-mapping> <servlet-name> showimage </servlet-name> <url-pattern> /showimage/* </url-pattern> </servlet-mapping> <!-- END EGovRequestHandler --> </web-app> 我的web.xml为<?xml version="1.0" encoding="UTF-8"?><!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> <servlet> <servlet-name>debugjsp</servlet-name> <description>Added to compile JSPs with debug info</description> <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class> <init-param> <param-name>classdebuginfo</param-name> <param-value>true</param-value> </init-param> <load-on-startup>3</load-on-startup> </servlet> <servlet> <servlet-name>showimage</servlet-name> <servlet-class>image.showimage</servlet-class> </servlet> <servlet-mapping> <servlet-name>debugjsp</servlet-name> <url-pattern>*.jsp</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>showimage</servlet-name> <url-pattern>/showimage</url-pattern> </servlet-mapping></web-app>我试了http://localhost:8080/servers/image/showimage不行呀!!! 不明白楼主的意思.如果想用jsp调servlet有用img标签调用的吗?:) 你的web应用如果不是放在默认的应用下面是不能写<img src="http://localhost:8080/showimage">要加上你的应用名。如: <img src="http://localhost:8080/web应用名/showimage"> 连个double数相乘的问题! 问一个简单的设计问题 jsp编译报表出现的错误 急! 为什么microsoft:sqlserver://localhost:1433;中的端口是1433,从什么地方可以看出来 如何获取刚编辑完的单元格的内容 菜鸟求助:java程序实现改变当前windows的壁纸? jre和tomcat的问题 數組排序 怎么将类似\u5173\u4e8e的东西转化为汉字? 用JDK1.4编译成功,但运行程序时出了问题,各位帮忙看一看 怎么去掉MP3中的背景音乐呢 weblogic 后台服务问题,高手帮忙?
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 1.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd">
<web-app>
<servlet>
<servlet-name>
showimage
</servlet-name>
<servlet-class>
image.showimage
</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>
showimage
</servlet-name>
<url-pattern>
/showimage/*
</url-pattern>
</servlet-mapping>
<!-- END EGovRequestHandler -->
</web-app>
<!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>
<servlet>
<servlet-name>debugjsp</servlet-name>
<description>Added to compile JSPs with debug info</description>
<servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
<init-param>
<param-name>classdebuginfo</param-name>
<param-value>true</param-value>
</init-param>
<load-on-startup>3</load-on-startup>
</servlet>
<servlet>
<servlet-name>showimage</servlet-name>
<servlet-class>image.showimage</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>debugjsp</servlet-name>
<url-pattern>*.jsp</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>showimage</servlet-name>
<url-pattern>/showimage</url-pattern>
</servlet-mapping>
</web-app>
我试了http://localhost:8080/servers/image/showimage
不行呀!!!
如: <img src="http://localhost:8080/web应用名/showimage">