环境tomcat6.0
怎么构建一个helloworld web应用
D:\apache-tomcat-6.0.18\webapps\struts2_helloworld
D:\apache-tomcat-6.0.18\webapps\struts2_helloworld\index.jsp 跳转
D:\apache-tomcat-6.0.18\webapps\struts2_helloworld\helloworld.jsp 显示helloworld
D:\apache-tomcat-6.0.18\webapps\struts2_helloworld\META-INF
D:\apache-tomcat-6.0.18\webapps\struts2_helloworld\WEB-INF\web.xml
D:\apache-tomcat-6.0.18\webapps\struts2_helloworld\WEB-INF\classes\helloworld.class
D:\apache-tomcat-6.0.18\webapps\struts2_helloworld\WEB-INF\classes\helloworld.xml
D:\apache-tomcat-6.0.18\webapps\struts2_helloworld\WEB-INF\classes\struts.xml
D:\apache-tomcat-6.0.18\webapps\struts2_helloworld\WEB-INF\lib\有5个struts核心jar包
这是我的所有的目录及文件,可是运行不了 !
注意:[color=red]不用IDE[/color],怎么构建一个HelloWorld应用?最好给出[color=red]详细步骤[/color],谢谢各位哥哥姐姐。
或者邮箱联系下。谢谢了!邮箱cssiege@126.com
[b]问题补充:[/b]
web.xml
[code="xml"]
<?xml version="1.0" encoding="UTF-8"?>
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">
struts2
org.apache.struts2.dispatcher.FilterDispatcher
struts2
/*
index.html
index.htm
index.jsp
[/code]
struts.xml
[code="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">
[/code]
helloworld.xml
[code="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">
/helloworld.jsp
[/code]
[b]问题补充:[/b]
helloworld.xml本地写的没错,还是运行不了
[code="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">
/helloworld.jsp
[/code]
[b]问题补充:[/b]
[color=red]再次补充[/color]
java类:HelloWorld.java 编译后class是 HelloWorld.class,可能上面大小写没有仔细写上,我本地,不存在大小写的问题,统一都是这个
[color=red]tomcat启动信息[/color]如下
2009-12-2 12:59:07 org.apache.catalina.core.AprLifecycleListener init
信息: The APR based Apache Tomcat Native library which allows optimal performanc
e in production environments was not found on the java.library.path: C:\Program
Files\Java\jdk1.6.0_12\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WIND
OWS;C:\Program Files\Java\jdk1.6.0_12\bin;C:\oracle\ora92\bin;C:\Program Files\O
racle\jre\1.3.1\bin;C:\Program Files\Oracle\jre\1.1.8\bin;C:\WINDOWS\system32;C:
\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\Common Files\Thunder Network\
KanKan\Codecs;D:\Program Files\MySQL\MySQL Server 5.0\bin
2009-12-2 12:59:07 org.apache.coyote.http11.Http11Protocol init
信息: Initializing Coyote HTTP/1.1 on http-9999
2009-12-2 12:59:07 org.apache.catalina.startup.Catalina load
信息: Initialization processed in 466 ms
2009-12-2 12:59:07 org.apache.catalina.core.StandardService start
信息: Starting service Catalina
2009-12-2 12:59:07 org.apache.catalina.core.StandardEngine start
信息: Starting Servlet Engine: Apache Tomcat/6.0.18
2009-12-2 12:59:08 com.opensymphony.xwork2.config.providers.XmlConfigurationProv
ider register
信息: Parsing configuration file [struts-default.xml]
2009-12-2 12:59:08 com.opensymphony.xwork2.config.providers.XmlConfigurationProv
ider register
信息: Parsing configuration file [struts-plugin.xml]
2009-12-2 12:59:08 com.opensymphony.xwork2.config.providers.XmlConfigurationProv
ider register
信息: Parsing configuration file [struts.xml]
2009-12-2 12:59:08 org.apache.struts2.config.Settings getLocale
警告: Settings: Could not parse struts.locale setting, substituting default VM l
ocale
2009-12-2 12:59:08 com.opensymphony.xwork2.util.ObjectTypeDeterminerFactory
nit>
信息: Setting DefaultObjectTypeDeterminer as default ...
2009-12-2 12:59:08 com.opensymphony.xwork2.config.providers.XmlConfigurationProv
ider register
信息: Parsing configuration file [struts-default.xml]
2009-12-2 12:59:08 com.opensymphony.xwork2.config.providers.XmlConfigurationProv
ider register
信息: Parsing configuration file [struts-plugin.xml]
2009-12-2 12:59:08 com.opensymphony.xwork2.config.providers.XmlConfigurationProv
ider register
信息: Parsing configuration file [struts.xml]
2009-12-2 12:59:08 org.apache.struts2.config.Settings getLocale
警告: Settings: Could not parse struts.locale setting, substituting default VM l
ocale
2009-12-2 12:59:09 org.apache.catalina.core.StandardContext start
严重: Error filterStart
2009-12-2 12:59:09 org.apache.catalina.core.StandardContext start
严重: Context [/struts2_helloworldtest] startup failed due to previous errors
2009-12-2 12:59:09 org.apache.coyote.http11.Http11Protocol start
信息: Starting Coyote HTTP/1.1 on http-9999
2009-12-2 12:59:09 org.apache.jk.common.ChannelSocket init
信息: JK: ajp13 listening on /0.0.0.0:8009
2009-12-2 12:59:09 org.apache.jk.server.JkMain start
信息: Jk running ID=0 time=0/31 config=null
2009-12-2 12:59:09 org.apache.catalina.startup.Catalina start
信息: Server startup in 2451 ms
[color=brown]index.jsp也访问不了[/color]
[b]问题补充:[/b]
[color=red]首先,index.jsp访问不了[/color]
http://localhost:9999/struts2_helloworldtest/
http://localhost:9999/struts2_helloworld/index.jsp
都不行。真不知道怎么回事,愁死了。
index.jsp上的信息:
HTTP Status 404 -
type Status report
message
description The requested resource () is not available.
Apache Tomcat/6.0.18
[b]问题补充:[/b]
上面访问是这两个
http://localhost:9999/struts2_helloworld
http://localhost:9999/struts2_helloworld/index.jsp
[b]问题补充:[/b]
[color=red]jar包:[/color]这是struts-2.0.14-all.zip里面的5个我考到lib下的
struts2-core-2.0.14.jar
xwork-2.0.7.jar
ognl-2.6.11.jar
freemarker-2.3.8.jar
commons-logging-1.0.4.jar
[b]问题补充:[/b]
[color=red]哎,我这是没用IDE自己写的目录结构,可是运行不了,还有让我看tomcat日志,这个我也看了,可是对于我这样的初学者,也看不懂什么日志啊。现在我就是想运行就运行不了啊!(启动tomcat上面也贴出出错信息了,index.jsp打不开)最好有人能给我个详细步骤。[/color]