Matt RaibleMatt Raible is a writer with a passion for software. Connect with him on LinkedIn.

The Angular Mini-Book The Angular Mini-Book is a guide to getting started with Angular. You'll learn how to develop a bare-bones application, test it, and deploy it. Then you'll move on to adding Bootstrap, Angular Material, continuous integration, and authentication.

Spring Boot is a popular framework for building REST APIs. You'll learn how to integrate Angular with Spring Boot and use security best practices like HTTPS and a content security policy.

For book updates, follow @angular_book on Twitter.

The JHipster Mini-Book The JHipster Mini-Book is a guide to getting started with hip technologies today: Angular, Bootstrap, and Spring Boot. All of these frameworks are wrapped up in an easy-to-use project called JHipster.

This book shows you how to build an app with JHipster, and guides you through the plethora of tools, techniques and options you can use. Furthermore, it explains the UI and API building blocks so you understand the underpinnings of your great application.

For book updates, follow @jhipster-book on Twitter.

10+ YEARS


Over 10 years ago, I wrote my first blog post. Since then, I've authored books, had kids, traveled the world, found Trish and blogged about it all.
You searched this site for "struts". 749 entries found.

You can also try this same search on Google.

Is XDoclet the best thing since Ant?

I think XDoclet is the best thing since Ant but that's probably because I use it daily (and nightly on on other projects). If you're not using XDoclet now, chances are you soon will be - and then you'll wonder - What took me so long? Calvin Yu gives his take on JSR 175.

I'm very excited about the new Metadata feature that's going to be in 1.5. I'm usually in agreement with the view that adding new language features is just making Java more complex, but I think metadata is going to put a whole new emphasis in automating repetitive tasks. This should also bring xDoclet to the forefront as a necessary tool for Java development.

(emphasis mine) Let's just hope that Sun tries to use some of the goodness that the XDoclet team has put together. XDoclet rocks - if you don't believe me, you must like editing your web.xml and struts-config.xml (among other deployment descriptors) by hand. I did that for years - and my opinion is that using XDoclet is easier.

Posted in Java at Jun 12 2003, 10:41:22 AM MDT 1 Comment

SourceForge's Release Process Sucks

Dave asked earlier today if we should move Roller to be hosted at java.net rather than sourceforge.net. I responded with "SourceForge works for me" and didn't see any reason for a move. But after dealing with trying to release 0.8 of appfuse all night, I'm ready for something better. The release process sucks. I have to FTP files to upload.sourceforge.net (anonymously) and then, when the files are completed, selected them as files to release through the web UI.

The problem is that I've been trying to upload for the last 24 hours, and it keeps failing at different points in the upload process. So, here's the worst part - you can't "delete" from the FTP site - you have to release the file, and then delete it. What a pain in the ass - I've done this about 10 times now. My XP machine seems to be the source of my ftp-connection-dropping problem, so I've moved over to my Linux box. So now I'm ready to upload all my files, and look what SF gives me:

We're Sorry.
The SourceForge.net Website is currently down for maintenance.
We will be back shortly

Fuckers.

Posted in Java at Jun 11 2003, 11:03:26 PM MDT 9 Comments

[Hibernate] Open Session in View Pattern

I get this question a lot when folks check out my struts-resume application - so I figured I'd document it here - and then I can just send future developers a URL. The question is this:

Why do you tie your View to your Model Implementation by putting a Hibernate Session in your Service Interfaces?

I have a couple of reasons. The first reason is that I initially had ses.currentSession() and ses.closeSession() at the beginning and end of each DAO method. In fact, I found this old e-mail where you can see an example. This seemed to work for me and I was happy with it. However, I got an e-mail from Gavin (Hibernate's Lead Developer) that I was doing it all wrong. He said that I should use one session per request, rather than one on each method. Why? For performance reasons and to allow rolling back the entire session, rather than just a method. At least that's why I remember him saying.

So I refactored and implemented the Open Session in View pattern in conjunction with the Thread Local Session. You can checkout my ActionFilter and ServiceLocator for the View and ThreadLocal, respectively.

The problem now is that I pass my the Session object from my View -> Business Layer [example: UserManager] -> DAO Layer. So I'm tightly coupled with Hibernate, which I don't mind, because I really, really like Hibernate and have no plans to implement an alternate DAO (even though the architecture allows it). Even if I did choose to implement a new plain ol' JDBC DAO Layer, I can always get a java.sql.Connection from the Session using ses.connection(). Another option I've thought of is to just pass the ServiceLocator between the different layers, and call ses.currentSession() or ses.connection() when it's needed. But that seems to be the same thing I was doing before when I was opening/closing at the method level.

Comments and suggestions, as always, are welcomed and encouraged.

Posted in Java at Jun 11 2003, 02:12:31 PM MDT 8 Comments

[ANNOUNCE] Struts 1.1 Release Candidate 2 released

The Struts team is proud to announce the release of Struts 1.1 Release Candidate 2. This release includes some new functionality, but mostly just fixes for a number of bugs which were reported against earlier versions. The Struts Team believes that this release is ready for prime time, hence its designation as a release candidate.

The binary distribution is available at:

http://www.apache.org/dist/jakarta/struts/binaries/

and the source distribution is available at:

http://www.apache.org/dist/jakarta/struts/source/

In addition, the library distribution, which contains updated binaries without the sample applications, is available at:

http://www.apache.org/dist/jakarta/struts/library/

Details of the changes in this release are available in the Release Notes, which can be found here:

http://jakarta.apache.org/struts/userGuide/release-notes-1.1-rc2.html

I'll be updating both Hibernate (to 2.0 Final) and Struts (to 1.1 RC2) today, so I'll let you know if I find any issues.

Update: I found two issues. One is that Hibernate identifies itself as "Hibernate 2.0 beta 6" in its logging (should not have beta 6). The second issue is that the commons-logging.jar file that ships with Struts 1.1 RC2 is missing some .class files. I replaced the commons-logging.jar file with one from a nightly build of Struts I was using and everything seems to be fine. Without the update, I get no logging. I also found that Hibernate no long includes jdom.jar in its distro (it used to be there), the lack of it doesn't seem to impact anything (all my tests run).

Posted in Java at Jun 09 2003, 01:36:51 PM MDT Add a Comment

Infecting Myself with BugBear

I've gotten two e-mails with the BugBear virus this morning - both from my alter ego. Actually they were from "[email protected]", which doesn't exist. Strangely, it's a response to an e-mail I sent to the struts-user mailing list. I've received them so far on Yahoo and my Comcast e-mail, both of which have webmail interfaces, and therefore, no problems have ensued. In case you get an e-mail from me (or rather [email protected]) with the subject Re: Is it possible to change the base tile on the fly, kindly delete it.

I'm slapping this sucker in my Java category in order to reach a greater audience. Hope you don't mind.

Posted in Java at Jun 07 2003, 07:48:42 AM MDT Add a Comment

JavaOne - Developer Coverage from Sue Spielman

Sue Spielman, local Java/Struts Guru, is heading out to JavaOne next week and promises developer coverage (minus the marketing hype) in a DJUG e-mail today. [More] Who's going to start compiling the list of JavaOne bloggers?

Posted in Java at Jun 06 2003, 03:55:25 PM MDT Add a Comment

[ANNOUNCE] Struts BSF (Scriptable Actions) 0.3

Boy, Don Brown is a busy man this week. He releases a new version of the Struts Cacoon plugin on Monday, and today he released a new version of Struts BSF.

This project allows Struts Actions to be written in the scripting language of one's choice rather than as Java classes. It uses the Beans Scripting Framework to allow scripts to be written in any language BSF supports like Perl, Python, Ruby, JavaScript, BeanShell, and I believe even VBScript.

Version 0.3 adds the ability to pass parameters from the Struts config file, a pluggable filter system to pre-define custom variables, more documentation, and more. [Learn More]

Looks cool, but I have no need (currently). If you're using the BSF and have experiences to share, please do so. I'm interested, it just hasn't made it past my crap filter yet.

Posted in Java at Jun 04 2003, 02:46:56 PM MDT 1 Comment

Validator Presentation and Struts Cocoon Plugin

Chuck Cavaness, author of O'Reilly's "Programming Jakarta Struts" book, gave a presentation to the Struts Atlanta User Group last week. [Download PDF, 41 pages]. Chuck also announced the availability of the Jakarta Struts Pocket Reference by O'Reilly.

This purpose of this small (144 pages) book is to provide a quick way of looking up often-used information and have it small enough to shove in your back pocket. Information like config files settings, built-in action usage and especially tags is covered. In fact, 100 of the 144 pages are dedicated to how to use the tags, including examples of each. [More Information, Table of Contents, Sample Chapter].

I don't see why you would need this book as the online docs and Google have always provided everything I've needed. Maybe it'd be nice if you lacked an internet connection. In other news, Don Brown (from Struts Training: Week 5), has released a new version of the Struts Cocoon Plugin.

The plugin that allows Struts actions to forward requests to Cocoon has been updated and released as 0.2 This time it is released as a full release rather than a developer prototype, complete with better documentation. Cocoon support has been updated to version 2.1M2 More information can be found at: http://www.twdata.org/struts.

Don has also put together a sample website for the Struts Applications Project at SourceForge.

The site is built using Forrest which is based on Cocoon. Forrest is used to build xml.apache.org, which being in similiar purpose to us, makes a great template for a project site. I took their sources from their CVS and modified them to suite our purposes. One of the big advantages is the site is 100% static HTML so it could be hosted at Sourceforge easily. BTW, anyone wanna throw together a logo? [Discussion Thread]

Posted in Java at Jun 04 2003, 07:52:21 AM MDT 1 Comment

Struts Menu now supports tabbed menus!

I uploaded a new demo of the tabbed menu system. This one uses url-matching to determine which menu to activate. If it finds more than one menu item (that matches the current URL), it falls back on a cookie that is set when you click on a link. Seems to work pretty well. Better than the last demo which didn't support clicking the "back" button.

And for you struts-menu users, this menu is soon to be available as a Displayer. I haven't checked it into CVS yet, but here's a working demo. Hope you enjoy! Let me know if you find any bugs.

Update: I checked everything into CVS and also added support for Struts' forwards in menu-config.xml. So now there are three choices when defining a URL for a menu/item:

  • location: uses the exact value you specify.
  • page: pre-pends the contextPath to the value you specify.
  • forward: looks up the path of the forward in struts-config.xml.

You can download the latest struts-menu.war if you want these features right away.

Posted in Java at Jun 03 2003, 03:44:21 PM MDT Add a Comment

Tabbed Menus - now with DHTML!

I did some work this evening to adapt Adam Kalsey's Tabbed Menu demo to fit my own design. He simply changes the <body>'s class based on which tag the user has clicked on. While this seems reasonable, I'd rather do the menu-selection on the client-side. This allows a developer to integrate this menu into their app with no server-side coding needed. So here's a demo with a client-side (DHTML) method of selecting menus. Clicking on an item just sets a cookie and then reloads the page.

This client-side approach should make it much easier to integrate this menu into struts-menu.

Posted in The Web at Jun 02 2003, 07:25:14 PM MDT 7 Comments