struts-config.xml<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" "http://struts.apache.org/dtds/struts-config_1_2.dtd">
<struts-config>
<data-sources>
<data-source type="org.apache.commons.dbcp.BasicDataSource"
key="dataSources">
<set-property property="driverClassName" value="org.gjt.mm.mysql.Driver" />
<set-property property="url"
value="jdbc:mysql://localhost:3306/db_bbs" />
<set-property value="20" property="maxCount" />
<set-property value="1" property="minCount" />
<set-property property="username" value="root" />
<set-property property="password" value="1234" />
</data-source>
</data-sources>
<form-beans >
<form-bean name="indexActionForm" type="com.hang.struts.form.IndexActionForm" /> </form-beans> <global-exceptions />
<global-forwards />
<action-mappings>
<action path="/index"
type="com.hang.struts.action.IndexAction"
input="/index2.jsp">
</action>
<action path="/index1"
type="com.hang.struts.action.IndexAction1"
input="/index2.jsp">
</action>
</action-mappings> <message-resources parameter="com.hang.struts.ApplicationResources_zh_CN" /></struts-config>index.jsp
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>论坛首页</title>
</head>
<body>
<jsp:forward page="index1.do"></jsp:forward>
</body>
</html>
<!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" "http://struts.apache.org/dtds/struts-config_1_2.dtd">
<struts-config>
<data-sources>
<data-source type="org.apache.commons.dbcp.BasicDataSource"
key="dataSources">
<set-property property="driverClassName" value="org.gjt.mm.mysql.Driver" />
<set-property property="url"
value="jdbc:mysql://localhost:3306/db_bbs" />
<set-property value="20" property="maxCount" />
<set-property value="1" property="minCount" />
<set-property property="username" value="root" />
<set-property property="password" value="1234" />
</data-source>
</data-sources>
<form-beans >
<form-bean name="indexActionForm" type="com.hang.struts.form.IndexActionForm" /> </form-beans> <global-exceptions />
<global-forwards />
<action-mappings>
<action path="/index"
type="com.hang.struts.action.IndexAction"
input="/index2.jsp">
</action>
<action path="/index1"
type="com.hang.struts.action.IndexAction1"
input="/index2.jsp">
</action>
</action-mappings> <message-resources parameter="com.hang.struts.ApplicationResources_zh_CN" /></struts-config>index.jsp
<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>论坛首页</title>
</head>
<body>
<jsp:forward page="index1.do"></jsp:forward>
</body>
</html>
解决方案 »
- 为何不能访问继承了json-default的action
- Struts2在Tomcat下启动不起来
- 关于tomcat5.5的问题连接池问题
- struts2的s标签迭代器迭代一个list的时候怎么取得当前下标?
- 请大家给一种方案!
- Hibernate的schame问题
- WebLogic Workshop开发的Web Services如何发布?
- hibernate和TomCatr的JNDI使用
- 一个HTML的问题:请高手指教,100分相送!
- 有做管理软件的吗?
- 图片上传下载问题
- Unable to read TLD "META-INF/jsf_core.tld" from JAR file "file:/D:/apache-tomcat
警告: Servlet action is currently unavailable
警告: Servlet action is currently unavailable
但数据源不能加载