设为首页  
联系我们  
加入收藏  
网页制作 冲浪宝典 图形图像 操作系统 软件教学 编程开发 认证考试 安全技术 站长专区 文学驿站 娱乐天地 游戏天地 办公软件
文章搜索
您的位置: 首页 >> 文章首页 >> 编程开发 >> Java >> How to setup a basic Struts project using Eclipse IDE
精品推荐
Java点击TOP10
·java笔试题
·《Thinking in Java》读书笔记
·JSP的mysql_jdbc驱动程序
·异常java.sql.SQLException: Io exception:The Network Adapter could not establish connection
·Java Coder 常用软件下载地址
·org.apache.commons.dbcp.SQLNestedException解决办法
·Java图形界面开发:SWT全接触
·如何使用Java POI生成Excel表文件 !
·功能强大的在线网页编辑器
·一些非常不错的Struts 例子下载
编程开发点击TOP10
·ASP.NET 程序中常用的三十三种代码
·利用ASP.NET构建网上考试系统
·C#版的网站新闻发布系统
·(转)23种设计模式汇集
·设计ASP.NET新闻管理系统
·深山红叶袖珍PE工具箱V16正式版
·我的.NET书架 (入门篇)
·java笔试题
·C++经典电子书下载
·.NET:是什么?将走向哪里?
精选专题

How to setup a basic Struts project using Eclipse IDE

作者: 来源:网络文章 时间:2005-12-16 22:35:10

How to setup a basic Struts project using Eclipse IDE(1)

How to setup a basic Struts project using Eclipse IDE

Legal Disclamer

* DISCLAIMER - This simple How-To shows you one of many ways to setup a working project using
the Struts framework. This is mainly geared toward struts users who are new to Eclipse, and
don't want to spend a lot of time figuring out the differences between their old IDE (if any)
and this one.

I will also apologize ahead of time for the formatting of this page.


In this How-To, I will demonstrate (using Eclipse 2.0.1) how to setup, compile, run,
and debug the struts-example web application that is bundled with the distribution.
Next, I will modify the code to pull some data from a MySql database using the popular
relational mapping tool OJB. (This is actually quite simple)

Let's get started

Before we begin, you will need to create a directory somewhere to store your project.
I typically use C:\personal\development\Projects\(some project)
Once that's done, extract the struts-example.war to that directory
(using your favorite zip utility)

Delete the META-INF folder because this will be created during the build/jar/war process.
Add a build.XML file to the project root. I use something like this:
 <project name="Struts Example" default="main" basedir="."><!--This is a basic build script, only the minimums here --><!-- Tell ant to use my environment variables --> <property environment="env"/><property file="./build.properties"/><property name="build.compiler"value="modern"/><property name="build.dir" value="./WEB-INF/classes" /><property name="src.dir"value="./WEB-INF/src"/> <property name="servlet.jar"value="/Apache_Home/jakarta-servletapi-4/lib/servlet.jar"/><property name="war.file"value="struts-example"/><property name="war.file.name"value="${war.file}.war"/><property name="tomcat.home" value="${env.CATALINA_HOME}"/><property name="deploy.dir"value="${tomcat.home}/webapps"/><path id="project.class.path"><fileset dir="./WEB-INF/lib/"><include name="**/*.jar"/></fileset><pathelement path="${src.dir}"/><pathelement path="${servlet.jar}"/> </path><target name="clean"> <delete dir="${build.dir}" includeEmptyDirs="true" /></target> <target name="prep"> <mkdir dir="${build.dir}"/></target><target name="compile"><JavaCSrcdir="${src.dir}"destdir="${build.dir}"debug="on" deprecation="on"> <include name="**/*.Java"/> <classpath refid="project.class.path"/></Javac></target><target name="cleanWebApp"><delete file="${deploy.dir}/${war.file.name}" /> <deletedir="${deploy.dir}/${war.file}" includeEmptyDirs="true" /></target><target name="war"> <war warfile="${war.file.name}" webXML="./WEB-INF/web.XML"><fileset dir="./" includes="**/*.*" excludes="*.war, **/*.NBAttrs, web.XML, **/WEB-INF/**/*.*, **/project-files/**/*.*"/><webinfdir="./WEB-INF" includes="**/*" excludes="web.XML, **/*.jar, **/*.class"/><libdir="./WEB-INF/lib"/><classes dir="${build.dir}" includes="**/*.properties" /> </war></target><target name="deploy"> <copy todir="${deploy.dir}"><fileset dir="./" includes="${war.file.name}"/> </copy></target><target name="main" depends="clean, prep, cleanWebApp, compile, war"/> </project> 
  1. Create a new project.
共6页 9 7 [1] [2] [3] [4] [5] [68 :>

How to setup a basic Struts project using Eclipse IDE 相关文章:
How to setup a basic Struts project using Eclipse IDE 相关软件:
特别声明:本站除部分特别声明禁止转载的专稿外的其他文章可以自由转载,但请务必注明出处和原始作者。文章版权归文章原始作者所有。对于被本站转载文章的个人和网站,我们表示深深的谢意。如果本站转载的文章有版权问题请联系编辑人员,我们尽快予以更正。
转载请注明来源:http://www.xgdown.com