我初学struts2,在自己新建一个工程中有如下页面:
==========================================
login.jsp<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Showcase - Conversion - Populate Object into Struts' action List</title>
</head>
<body>
<s:form>
<s:textfield label="userName:" name="userName" />
<s:textfield label="password:" name="password" />
<s:submit name="ccc" value="bbb"/>
</s:form>
</body>
</html>
----------------------------------
web.xml<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4" 
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">

<display-name>mySample</display-name>

<filter>
<filter-name>struts2</filter-name>
<filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
</filter>
    
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>

<welcome-file-list>
<welcome-file>index.html</welcome-file>
<welcome-file>index.htm</welcome-file>
<welcome-file>index.jsp</welcome-file>
<welcome-file>default.html</welcome-file>
<welcome-file>default.htm</welcome-file>
<welcome-file>default.jsp</welcome-file>
</welcome-file-list>
</web-app>----------------------------------
struts.xml<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
    
<package name="default" extends="struts-default">
<action name="login" class="com.xiangzi.LoginAction">
<result name="input">/login.jsp</result>
<result>/welcome.jsp</result>
</action>

<action name="append" class="com.xiangzi.AppendIteratorTagAction">
<result>appendIterator_sample.jsp</result>
</action>
    </package>
</struts>大概代码和配置如上,
我使用tomcat5.5+jdk1.5+ec3.2
当我启动服务器的时候并运行http://localhost/mySample/login.jsp
页面上竟然什么内容都没有.请高手指点

解决方案 »

  1.   

    是不是标签引入错误,我也是个菜鸟
    <%@ taglib uri="/WEB-INF/struts-html.tld" prefix="s" %>
    另外是不是web.xml中也要注入
    <taglib>
    <taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
    <taglib-location>/WEB-INF/struts-html.tld</taglib-location>
    </taglib>
      

  2.   

    我的web.xml用的是2.4的标准,不用显示引用那个tld文件.同时纠正一下,我用的是struts2,不是struts1.*
      

  3.   

    问题解决了,是少了一个freeer.jar.
        郁闷!