把你的访问jsp的代码和你的配置文件贴出来看看
解决方案 »
- 极度郁闷的一个读取文本的问题?求高手!
- Struts2调用业务方法报空指针
- 求救!! 求救 !!分页 ???
- 刚学struts2 启动tomcat后 老出下面的问题 帮我看看!
- tomcat 6.0 +Axis2 Jsp调用问题
- 作为一个j2ee的初学者,我想说“为什么j2ee的环境配置这么麻烦呢?”
- 刚接触J2EE,求相关基础资料(100分感谢)
- 发布EAR包的时候出现问题,第一次好使,重起weblogic后不好用(急!)
- 关于ejb编译的问题
- 找一个数据库取到生成XML,在解析后插入数据库中的例子.400分(5)
- 感谢各位高手的帮忙! 现在还有一个关于soap消息的问题:在服务端定义返回的各个参数的名称、类型。
- 挥泪赠分,谁能详细介绍一下Struts框架,我看了不天都不太明白?
配置文件struts-config.xml:<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE struts-config PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 1.0//EN"
"http://jakarta.apache.org/struts/dtds/struts-config_1_0.dtd">
<struts-config>
<!--配置表单bean-->
<form-beans>
<form-bean
name="empForm"
type="com.example.EmployeeForm"/>
</form-beans>
<!--配置ActionMapping-->
<action-mappings>
<action path="/validateEmployee"
type="com.example.ValidateEmployeeAction"
name="empForm"
scope="request"
intput="/inputContent.jsp">
<forward name="success" path="/outputContent.jsp"/>
</action>
</action-mappings>
</struts-config>
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
inputContent.jsp文件:<%@ taglib uri="/bean" prefix="bean"%>
<%@ taglib uri="/html" prefix="html"%>
<%@ taglib uri="/logic" prefix="logic"%>
<%@ taglib uri="/app" prefix="app"%>
<html>
<head>
<title></title>
</head>
<body>
<html:errors/>
<app:departmentList/>
<app:skillsList/>
<html:form action="validateEmployee.do">
<table>
<tr>
<td align="right">
<bean:message key="prompt.emloyee.name"/>
</td>
<td>
<html:text property="name"/>
</td>
</tr>
<tr>
<td align="right">
<bean:message key="prompt.emloyee.department"/>
</td>
<td>
<html:select property="department">
<html:options name="departmentList"/>
</html:select>
</td>
</tr>
<tr>
<td align="right" valign="top">
<bean:message key="prompt.employee.skills"/>
</td>
<td>
<logic:interate id="currentSkill" name="skillsList">
<html:multibox property="skills">
<%=currentSkill%>
</html:multibox>
<%=currentSkill%>
<br/>
</logic:iterate>
</td>
</tr>
<tr>
<td colspan="2" align="center">
<html:submit value="Validate"/>
</td>
</tr>
</table>
</html:form>
</body>
</html>
PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app> <!-- Action Servlet Configuration -->
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>org.apache.struts.action.ActionServlet</servlet-class>
</servlet> <!-- Action Servlet Mapping -->
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping> <!-- The Welcome File List -->
<welcome-file-list>
<welcome-file>login.jsp</welcome-file>
</welcome-file-list></web-app>
这是另一个例子中的web.xml
这个 <!-- The Welcome File List -->
<welcome-file-list>
<welcome-file>login.jsp</welcome-file>
</welcome-file-list>
还象没用吧,我去掉以后依然,能成功
是不是这样啊?
就是整个程序的入口在哪里?
请高手解疑!谢谢
另外顺便问一下,还有人用waf吗?
<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>
-------------------------