sturts1.2+spring+hibernate3
所属分类:Java编程
开发工具:Java
文件大小:9628KB
下载次数:55
上传日期:2006-06-26 09:01:42
上 传 者:
frostytop
说明: Struts数据库开发中的一个案例,对想学习Struts与Hibernate3的可以看一下
(Struts database development of a case. right want to learn Struts and Hibernate 3.0 can look at the)
文件列表:
chapter 12\sql\Helpinfopub.sql (4139, 2005-10-02)
chapter 12\sql (0, 2006-05-16)
chapter 12\project\403.jsp (620, 2005-11-02)
chapter 12\project\404.jsp (677, 2005-11-02)
chapter 12\project\LICENSE.txt (11558, 2005-11-02)
chapter 12\project\clickstreams.jsp (1827, 2005-11-02)
chapter 12\project\error.jsp (2129, 2005-11-02)
chapter 12\project\index.jsp (360, 2005-11-02)
chapter 12\project\login.jsp (351, 2005-11-03)
chapter 12\project\loginError.jsp (127, 2005-11-02)
chapter 12\project\loginMenu.jsp (386, 2005-11-03)
chapter 12\project\logout.jsp (111, 2005-11-02)
chapter 12\project\viewstream.jsp (2105, 2005-11-02)
chapter 12\project\styles\calendar.css (742, 2005-11-02)
chapter 12\project\styles\default.css (6609, 2005-11-02)
chapter 12\project\styles\displaytag.css (2757, 2005-11-02)
chapter 12\project\styles\helptip.css (1007, 2005-11-02)
chapter 12\project\styles\menuExpandable.css (1264, 2005-11-02)
chapter 12\project\styles\messages.css (1050, 2005-11-02)
chapter 12\project\styles\print.css (702, 2005-11-02)
chapter 12\project\styles (0, 2006-05-16)
chapter 12\project\scripts\calendar.js (33967, 2005-11-02)
chapter 12\project\scripts\fade.js (2666, 2005-11-02)
chapter 12\project\scripts\global.js (13101, 2005-11-02)
chapter 12\project\scripts\helptip.js (9484, 2005-11-02)
chapter 12\project\scripts\login.js (1549, 2005-11-02)
chapter 12\project\scripts\menuExpandable.js (6158, 2005-11-02)
chapter 12\project\scripts\selectbox.js (4940, 2005-11-02)
chapter 12\project\scripts\sortTable.js (5595, 2005-11-02)
chapter 12\project\scripts\validator.jsp (207, 2005-11-02)
chapter 12\project\scripts (0, 2006-05-16)
chapter 12\project\images\403.jpg (14983, 2005-11-02)
chapter 12\project\images\404.jpg (12852, 2005-11-02)
chapter 12\project\images\aquadot.jpg (419, 2005-11-02)
chapter 12\project\images\arrow_down.png (190, 2005-11-02)
chapter 12\project\images\arrow_off.png (180, 2005-11-02)
chapter 12\project\images\arrow_up.png (189, 2005-11-02)
chapter 12\project\images\asc.gif (177, 2005-11-02)
chapter 12\project\images\desc.gif (178, 2005-11-02)
... ...
Quick-Start FAQ
===============
To learn how to develop your J2EE webapps with AppFuse, see
http://raibledesigns.com/wiki/Wiki.jsp?page=Articles (or docs/index.html if you
downloaded the AppFuse source distribution). You can also download all the
latest documentation to the "docs" directory by running "ant wiki".
To build this application - you must be using Ant 1.6.2+. You will also need
to copy junit.jar into your $ANT_HOME/lib directory.
Then setup Tomcat 4.1.x+ and install an SMTP server on localhost. If you don't
want to install an SMTP server, change web/WEB-INF/classes/mail.properties to
point to an existing one.
To run this application, you will need to perform the following tasks:
1. The default database setup expects a mysql database installed with
an admin user named "root" and no password. If your system is different,
modify properties.xml or build.properties to override the default values.
2. Run "ant setup-db". This creates a mysql database named "appfuse" and
grants the user "test" (password: test) full rights to this database.
3 Test that the db access code works with:
ant test-dao -Dtestcase=UserDAO
ant test-service -Dtestcase=UserManager
4. Setup Tomcat by running "ant setup-tomcat deploy". This puts a MySQL JDBC
driver (and jta.jar) in $CATALINA_HOME/common/lib, and also deploys an
appfuse.xml file to $CATALINA_HOME/webapps ($CATALINA_HOME/conf/Catalina/
localhost on Tomcat 5). It also deploys the application to
$CATALINA_HOME/webapps.
5. Start Tomcat and test the web login using "ant test-canoo -Dtestcase=Login".
If you experience issues with Tomcat, check your build/test/cargo.log file.
** TO SETUP E-MAIL NOTIFICATION OF ERRORS **
Log4j has a pretty slick feature where you can have e-mail messages sent
to you when an ERROR is logged. To set this up, perform the following
steps:
1. Change the property "error.mailTo" in build.properties to be your
e-mail address.
2. Edit WEB-INF/classes/log4j.properties to add "mail" to the rootCategory.
Example: log4j.rootCategory=INFO, stdout, mail
Features/Changes in 1.8.1
============================
- A complete list of issues fixed is at http://tinyurl.com/8v2z9.
- i18n fixes for DateUtil and Canoo WebTest.
- Moved tomcat.properties key/value pairs into properties.xml.
- [Struts] Changed "viewUsers" forward to be a redirect to prevent the
duplicate post problem when deleting a user.
- [MyFaces] Changed all "id" attributes with a period (i.e. address.address)
to use only the later half since MyFaces 1.0.9 does support periods in ids.
- Added page for sponsors at http://appfuse.dev.java.net/sponsors.html
- Added UserSecurityAdvice and interceptor to ensure that only admins
can modify user records. Regular users can still modify their own record.
- Fixed BaseControllerTestCase.objectToRequestParameters() so POJOs that
use inheritance are supported.
- Dependent packages upgraded:
* Cargo 0.5
* Hibernate 3.0.5
* iBATIS 2.1.0
* MyFaces 1.0.9
* Rename Packages 1.1
* Spring 1.2.1
Features/Changes in 1.8
============================
- Replaced Container-Managed Authentication with Acegi Security Framework for
Spring. Minimal changes were necessary - meaning that you could easily
switch back if you wanted to. HowTo documented at:
http://raibledesigns.com/wiki/Wiki.jsp?page=AppFuseSecurity
- Massive amount of bug fixes applied to AppGen to allow it to be run multiple
times. Also fixed "id" problems so the POJOs id property is actually looked
up instead of just assuming it's a Long and named "id".
- Fixed project files for Eclipse and IDEA so you can easily run unit tests
from within your IDE. Just run the "compile" task with Ant, refresh your
project and test away!
- [AppGen] Added Query by Example code to the getXXXs(XXX) method of detailed
Hibernate DAOs. Added code to Struts and Spring versions to allow searching
on the list screen by manually passing in name/value pairs of a POJO's
properties on the URL. Doesn't seem to work for filtering by primary key,
which seems reasonable since you'll likely hide the primary key column when
modifying your list screen.
- [Tapestry] Fixed bugs in UserForm.java and UserList.java classes - now role
choices are shown when editing a user or adding a new user.
- Fixed bug where uses could hack the URL in Struts and WebWork versions to
delete users when they don't have the "admin" role.
https://appfuse.dev.java.net/issues/show_bug.cgi?id=121
- Added empty "velocimacro.library" property to "velocityEngine" bean in
applicationContext-service.xml to suppress Velocity errors.
- Changed Transaction Attributes on UserManager so save* rolls back when
the checked UserExistsException is thrown.
- [Struts] Fixed bug in error.jsp that caused it to throw exceptions under
certain conditions: https://appfuse.dev.java.net/issues/show_bug.cgi?id=122.
- [Struts] Modified struts_form.xdt to properly handle Sets when used for
indexed properties.
- Added serialVersionUID variables to all serializable classes.
- Changed IDEA project files so project is loaded as a web module. This
allows Tomcat debugging and taglib resolution in JSPs.
- Increased the default font size of success/error messages since all my
clients have asked me to it when developing a project with AppFuse.
- Added fade.js for using the Fade Anything Technique as documented at
http://www.axentric.com/posts/default/7. Applied fading to messages.
- Improved build.xml file:
* create-tables.sql now deleted when running "clean" target.
* "fixcrlf" target updated to repair more file types on *nix systems.
* Placeholders replaced in applicationContext-hibernate.xml within the
DAO JAR file created by "package-dao" target.
* Simplified token replacement when deploying static web files.
* Improved name replacement when running "new" target.
* Replaced "compile-module" and "test-module" with macrodefs.
* Changed entity include for properties.xml to be an import.
* Moved app-settings.xml properties into properties.xml.
* Changed from 80 characters per line to 120.
- Tests using Dumbster updated to always use "localhost" in case the normal
mail.host is different.
- [Struts] UserAction updated to validate the form within the save() method
to better support i18n.
- Removed unnecessary "database.name" property from PostgreSQL configuration
in build.properties.
- Improved sensitivity for package name replacement in
ConvertUtil.getOpposingObject().
- Fixed hard-coded date format in DateUtil using Spring's LocaleContextHolder.
- [Struts] Changed all "bean:write" tags to "c:out" to prevent errors when
using an unsupported locale.
- [Struts] Added TimestampConverter to converting Timestamps.
- [Spring MVC] BaseFormController updated to make the userManager available to
subclasses.
- Updated LoginServlet to properly handle empty port configurations.
- [Spring MVC] cancelView property added to BaseFormController.
- Added property to userList DisplayTag to improve browser support for PDF
export.
- Dependent packages upgraded:
* Display Tag 1.0
* Dumbster 1.5
* Hibernate 3.0.2
* Log4j 1.2.9
* MySQL JDBC Driver 3.1.7
* PMD 3.0
* PostgreSQL JDBC Driver 8.0-310
* SiteMesh 2.2.1
* Spring 1.2 RC2
* StrutsTestCase 2.1.3
* XDoclet 1.2.3
- Dependent packages added:
* Acegi Security 0.8.2
- Dependent packaged removed:
* JUnitDoclet 1.0.2
Features/Changes in 1.7
============================
- Added support for JSF (MyFaces) and Tapestry as web framework options.
http://raibledesigns.com/page/rd?anchor=integrating_jsf_and_tapestry_into_appfuse
- Added support for exporting PDFs from a displaytag-rendered table.
- Changed URIs for imported XML files in build.xml to use relative paths.
https://appfuse.dev.java.net/issues/show_bug.cgi?id=102
- Fixed package-name bug when generating a new WebWork projects.
https://appfuse.dev.java.net/issues/show_bug.cgi?id=101
- Added "fixcrlf" target for Unix machines to run when they're having issues
installing packages in the "extras" folder.
- Fixed bug in struts_form.xdt where nested objects types where named based
on the variable name rather than the type.
https://appfuse.dev.java.net/issues/show_bug.cgi?id=105
- Dependent packages upgraded:
* Cargo 0.4
* DisplayTag 1.0 RC2
* Hibernate 2.1.7
* iBATIS 2.0.8
* Spring 1.1.3-dev
** Would have done 1.1.2, except the following bug exists:
http://forum.springframework.org/viewtopic.php?t=2118
* WebTest build 574
* WebWork 2.1.6
Features/Changes in 1.6.1
============================
- Changed Service Tests to use JMock for mocking DAO dependencies.
https://appfuse.dev.java.net/issues/show_bug.cgi?id=86
- Re-arranged filters-mappings in metadata/web/filter-mappings.xml to
fix exporting Excel with Display Tag.
https://appfuse.dev.java.net/issues/show_bug.cgi?id=74
- Fixed LabelTag to read JSTL's fallback locale from web.xml.
https://appfuse.dev.java.net/issues/show_bug.cgi?id=75
- Changed copy-resources task to only run "native2ascii" task on
Chinese properties files.
https://appfuse.dev.java.net/issues/show_bug.cgi?id=76
- Fixed XDoclet form-generation template (struts_form.xdt) for generating
nested forms.
https://appfuse.dev.java.net/issues/show_bug.cgi?id=77
- Moved exportFilter and compressionFilter filter-mappings to come after
encodingFilter to solve NoSuchMethodException when using zh_CN locale.
https://appfuse.dev.java.net/issues/show_bug.cgi?id=79
- [Spring MVC] Fixed JavaScript bug on signup page.
https://appfuse.dev.java.net/issues/show_bug.cgi?id=80
- Enhancements to test/web-tests.xml to be more i18n friendly.
https://appfuse.dev.java.net/issues/show_bug.cgi?id=81
- Fixed bug in Commons Validator support for Spring. An alternative
solution is to put the validator beans in applicationContext-service.xml.
https://appfuse.dev.java.net/issues/show_bug.cgi?id=82
- [Spring MVC] Fixed server-side validation for Edit Profile when logged
in as "tomcat" user.
https://appfuse.dev.java.net/issues/show_bug.cgi?id=83
- Fixed applicationContext-*.xml path to load each file individually so
deploying AppFuse as a WAR works. Will revert back after next release
of Spring. https://appfuse.dev.java.net/issues/show_bug.cgi?id=85
- Changed UserManager.saveUser to throw checked UserExistsException when
DataIntegrityViolationException occurs.
- Patched XDoclet so that running "ant setup test-all" will work again.
http://opensource.atlassian.com/projects/xdoclet/browse/XDT-879
- Added CruiseControl files and documentation to extras/cruisecontrol.
- Created tests for the "extras" like Equinox has.
- Created "appgen" tool that creates everything for CRUDing an object.
- Fixed Spring MVC implementation so getText() method uses the current
request's locale.
https://appfuse.dev.java.net/issues/show_bug.cgi?id=89
- Dependent packages upgraded:
* Ant Contrib 1.1b1
* Canoo WebTest build 543
* Cargo 0.3 (now supports Tomcat 5.5.x)
* DisplayTag 1.0 RC2 Nightly (to fix unicode export)
* XDoclet 1.2.2
- Dependent packages added:
* jMock 1.0.1 - a library for testing Java code using mock objects.
Features/Changes in 1.6
============================
- Integrated WebWork as a web framework choice. To install WebWork (replacing
Struts) in a fresh AppFuse project, simply run "ant install-webwork".
- Refactored to use SiteMesh instead of Tiles. Proposal and feedback at:
http://raibledesigns.com/page/rd?anchor=should_i_ditch_tiles_in
Good Article: http://www.onjava.com/pub/a/onjava/2004/09/22/sitemesh.html
Experience documented at: http://raibledesigns.com/page/rd/20040821
- Re-worked User and Roles relationship to take advantage of Hibernate more.
Thanks to Daniel Kibler for the patch:
https://appfuse.dev.java.net/issues/show_bug.cgi?id=69
- Removed UserFormEx and replaced with ability to "merge" methods into an
ActionForm using XDoclet. See metadata/web for xdoclet-UserForm.java
which now contains methods merged into the generated UserForm.java.
- Modified struts_form.xdt to support nested objects. Moved address information
from org.appfuse.model.User to org.appfuse.model.Address to and created
NestedFormTest to verify it works. This template will pick up any nested
object validations rules.
- Changed "org.appfuse.persistence" package name to "org.appfuse.dao". Moved
"*ManagerImpl" classes to "service.impl" package.
- Changed stylesheet colors for Spring MVC option to be green instead of red.
Bug 47 - https://appfuse.dev.java.net/issues/show_bug.cgi?id=47.
- Refactored logging so Base classes contain a "log" variable that children
don't need to override. More at:
http://raibledesigns.com/page/rd?anchor=log_debug_vs_logger_debug
- Refactored toString(), equals() and hashCode() methods in BaseObject to be
abstract so child classes have to implement custom methods. Bug at:
https://appfuse.dev.java.net/issues/show_bug.cgi?id=65.
Commonclipse (http://commonclipse.sf.net) can generate the methods for you.
Learn more at: http://www.leegrey.com/hmm/2004/09/29/109***91256000.html
- Added Cargo to simplify starting and stopping Tomcat before running Canoo
WebTests. Unfortunately, the 0.2 release doesn't work with Tomcat 5.5.x.
- Refactored all web frameworks to allow for testing out-of-container. This
means that "test-web" will now work w/o Cactus or the container running.
Learn more at: http://raibledesigns.com/page/rd?anchor=ann_cargo_0_2_released
- Removed MainMenuTest, which was a demonstration of how to write tests using
HttpUnit. This test caused more problems than it solved.
- Changed target names in build.xml: define-tasks -> init, init -> prepare.
Reworked build.xml so XDoclet tasks don't execute when they don't need to.
- Added translations for French and Spanish.
- Added PasswordHintTest for those controllers and actions that implement this
feature.
- Added SimpleMappingExceptionResolver for Spring version to catch
DataAccessExceptions and forward the user to dataAccessFailure.jsp. Added
this same functionality to the WebWork version.
- Added message to the Reload Action so users will see a message when reloading
options. Message is currently hard-coded to English in Actions/Controllers.
- Removed proprietary State and Country Tags. Implemented custom CountryTag
(thanks Jens Fischer) and made state into a text box since not all countries
have "states".
- Reworked mail support to use Spring's MailSender and changed account
information e-mail (for Spring and WebWork options) to use a Velocity template.
This was partially motivated by all the questions I get on Sending
Velocity-based E-Mail with Spring.
http://jroller.com/page/raible/20040406#sending_velocity_based_e_mail
- Consolidated all mail settings to mail.properties (in web/WEB-INF/classes).
- Added support for detecting and configuring Tomcat 5.5.x.
http://tinyurl.com/5ebdh
- Renamed "Secure" tag library to "SecureTag" for consistency.
- Added field-level errors (using html:errors) to Struts JSPs and viewgen for
Struts.
- Changed column names in User object from camelCase to normal database_names.
- Added fallback locale of 'en' in metadata/web/web-settings.xml in case no
bundle is found for the browser's preferred locale.
- Added native2ascii task in copy-resources to encoded to ascii with unicode
escapes.
- Added Dumbster (http://quintanasoft.com/dumbster/) to catch and verify
e-mail messages sent during test execution.
- Changed parameter key for indicating methods in Struts Actions from "action"
to "method" in order to alleviate conflicts with the "action" attribute
in an HTML form.
- Changed name of generated WAR file to *not* include the version number.
Having the version number as part of the name seemed to cause more problems
than it solved.
- Added forkmode="true" to junit task in "test-module" target - greatly
increasing the speed of test execution - particularly on my PowerBook.
http://raibledesigns.com/page/rd?anchor=aren_t_out_of_container
- Dependent packages upgraded:
* DbUnit 2.1
* Display Tag 1.0 RC1
* Hibernate 2.1.6
* iBATIS 2.0.7
* JSTL 1.0.6
* MySQL JDBC Driver 3.0.14
* Spring 1.1.1
* Struts 1.2.4
* Struts Menu 2.3
* Struts Test Case 2.1.2
* WebTest build474
* XDoclet 1.2.2 RC1
** WARNING: Running "ant setup test-all" will result in the error:
"destDir attribute must be present." Running "ant setup"
and then "ant test-all" is an easy workaround.
http://opensource.atlassian.com/projects/xdoclet/browse/XDT-879
- Dependent packages added:
* Cargo 0.2 - A set of Ant tasks for starting and stopping Java containers.
* Dumbster 1.2 - A fake SMTP server used to catch and verify messages in
unit tests.
* SiteMesh 2.2 - A page-decoration package that will work across different
web frameworks.
* URL Rewrite Filter 1.2 - Added and included in WAR, but disabled by
default. See web/WEB-INF/urlrewrite.xml for more information.
- Dependent packages removed:
* State Tag and Country Tag - required a $75 license for production use.
* Cactus - no longer needed as all tests can be run out-of-container and
Cargo can be used to start Tomcat for in-container (JSP) tests.
Features/Changes in 1.5
============================
- Added Spring MVC as a web framework option. You can install it by navigating
to "extras/spring" and typing "ant install". Includes Commons Validator
and XDoclet support for generating validation.xml. I also ported the
LabelTag so it works with Spring as well. Make sure and read the README.txt
in extras/spring for issues I encountered while developing.
- Changed extension for default Controller to be *.html. We're serving up
HTML, so it makes sense (to me) to use this instead of .do? I'm also
motivated because I want to be more MVC framework-agnostic.
- Removed Struts dependency from "services" layer. Actions can use a convert()
method to transfer POJOs to Forms and vise versa.
- Fixed i18n (thanks Jaap!) - now reads from the user's browser's settings.
Available languages are English, Dutch (Jaap van der Molen), Brazilian
(Gilberto Caetano de Andrade) and Chinese (Paul Wang).
- Fixed bug where logout didn't work when Remember Me was disabled (issue #3).
- Fixed bug in struts_form.xdt where invalid code generated for ObjectFactory
inner class (issue #2). Also added "indexedProperties" attribute to
@struts.form tag. This is so indexed property support is only generated when
the user wants it to be. Indexed property support is NOT generated by
default. Here is an example:
@struts.form include-all="true" extends="BaseForm" indexedProperties="true"
- More information at:
http://raibledesigns.com/wiki/Wiki.jsp?page=XDocletIndexedProperties
- Modified XDoclet to create a standalone "actionf ... ...
近期下载者:
相关文件:
收藏者: