里面我除了配置servlet外还有那些标签库,即struts-bean那些东西。
<web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
用myeclipse插入struts能力时这个文件头就是这样的,但在下面加入那些<taglib>元素时就在这些地方报错了,我看了一下好象大意是说这个版本的配置文件里不包括<taglib>这些标签似的,是怎么回事?
----------------解决方案--------------------------------------------------------
我也是正在为这个而头痛啊,我也想知道!
----------------解决方案--------------------------------------------------------
没有人知道这个问题吗?
----------------解决方案--------------------------------------------------------
servlet2.4 是j2ee1.4版本的
在2.4中已经不存在<taglib>元素了
请仔细看你们的提示错误
----------------解决方案--------------------------------------------------------
struts 本来就是标签+MVC,不能用标签用什么...........
----------------解决方案--------------------------------------------------------
你在jsp页面中导入对应的标签库了吗
----------------解决方案--------------------------------------------------------
就是<%taglib uri=...;prefix=..%>吗,用了啊
----------------解决方案--------------------------------------------------------
导入标签,在web.xml中删除<web-app>中内容就ok了!
如下我成功的配置:
<?xml version="1.0" encoding="UTF-8"?>
<web-app>
<servlet>
<description>This is the description of my J2EE component</description>
<display-name>This is the display name of my J2EE component</display-name>
<servlet-name>logservlet</servlet-name>
<servlet-class>logservlet.logservlet</servlet-class>
</servlet>
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>/WEB-INF/struts-config.xml</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>3</param-value>
</init-param>
<init-param>
<param-name>detail</param-name>
<param-value>3</param-value>
</init-param>
<load-on-startup>0</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>logservlet</servlet-name>
<url-pattern>/servlet/logservlet</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<taglib>
<taglib-uri>/tags/struts-bean</taglib-uri>
<taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/tags/struts-html</taglib-uri>
<taglib-location>/WEB-INF/struts-html.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/tags/struts-logic</taglib-uri>
<taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/tags/struts-nested</taglib-uri>
<taglib-location>/WEB-INF/struts-nested.tld</taglib-location>
</taglib>
</web-app>
----------------解决方案--------------------------------------------------------