Matt RaibleMatt Raible is a Web Developer and Java Champion. 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 "appfuse". 771 entries found.

You can also try this same search on Google.

Fun with jWebUnit and Canoo WebTest

For the past few days, I've been messing around with jWebUnit and Canoo WebTest at my "day job". I say messing around because I've mainly been trying to overcome perceived bugs with both projects. I'm used to using Ant and both of these libraries "just work".

The problem I had with jWebUnit is that the setOption(selectName, optionLabel) didn't work for me. This turned out to be some sort of conflict with SiteMesh, and when I commented out the SiteMesh <filter-mapping>, everything worked as expected. This is quite strange since I use SiteMesh+jWebUnit with Equinox. I tried to reproduce the problem with Equinox by adding a <select> with <option> elements, but it all worked fine there. I'd blame it on Maven, but I was running my tests from IDEA. As a workaround, I subclassed SiteMesh's PageFilter and stopped processing when the user-agent.startsWith("httpunit"). This is very similar to the JCIFS and jWebUnit workaround we're using.

Before I figured out the jWebUnit/SiteMesh issue, I decided to try my favorite UI testing tool: WebTest. Since we're using Maven, I figured the Maven Canoo Webtest Plugin would be the way to go. This took me about a day to get working (so much for the ol' 10 minute test). Most of the problems where related to the fact that setting the properties didn't seem to have any effect. I ended up writing my web-tests.xml much like I would with Ant - with taskdefs and importing project.properties for the properties to take effect. Last night, after I couldn't get webtest to click a button, I decided to try the same XML file with Ant. I dropped it into AppFuse, changed a few settings and voila! - it all worked! "WTF?" I thought to myself. Turns out the Maven Plugin is from October 2004 and is based on build 543. I ended up rebuilding the plugin to build 733 and then everything worked fine. Here's the patch.

Now that I got them both working, I'm leaning towards using jWebUnit because I can use Java to get the last inserted id (for fullying CRUDing an object). With Canoo, I'd have to use our query interface, add a feature to sort by id (or somehow get the last record added), then click on it to edit the new record. To make matters worse, the API we're talking to right now let's us add records, but we can't fetch them back - no matter what we query by. We've tried both the web services interface and the EJB one with the same results.

Ahhh, the life of an enterprise developer - trying to make 3 systems talk to each other and all of them have broken (or non-existent APIs). For one system, we're actually going through their web interface with httpclient to do CRUD on records!

Posted in Java at Mar 01 2005, 05:09:59 PM MST 5 Comments

Hibernate vs. iBATIS

There's an interesting thread taking place on the iBATIS User Mailing List. The basic jist of the responses are: Hibernate works well when you control the data model, iBATIS works well when you need to integrate with an existing database. I've said this for a couple years now, and I still believe it. Furthermore, I've found that when working with iBATIS, I tend to know what's going on a lot more. After all, it's just SQL. From all the questions on the AppFuse mailing list, it seems like a lot of Hibernate users are constantly trying to get Hibernate to "work its magic" and handle all their relationships for them.

I wonder if newbies would be better of using iBATIS? Using iBATIS, there isn't a whole lot of magic, and you get full control over the SQL - which would likely be easier to understand. Maybe I should create a "newbie" version of AppFuse - where the frameworks uses are the easiest to learn or most documented. It'd probably be Struts+Spring+iBATIS, or maybe just Spring+iBATIS so I could sell more copies of Spring Live. ;-)

Posted in Java at Feb 28 2005, 07:10:25 AM MST 38 Comments

Rails is 8 times slower than Spring+Hibernate

Might as well start off this week by getting people's blood boiling. ;-) According to a comment on Dion's blog:

Having done extensive performance (scalability means different things to different people) testing on both Rails and a comparable Spring/Hibernate/JSP2 webapp (no one seems have have done any sort of benchmarking on Rails, or they simply don't care, I don't really know, but since benchmarking is what I do... :-)) I can say that Apache2/FastCGI/Rails is about... 8x slower than the comparable Tomcat/Spring/Hibernate/JSP2 solution. And that is with caching turned on in Rails (using Rails 0.9.5...)

Quite frankly, 62 req/s on a Dual Opteron with 4GB of RAM rendering a simple view with no DB access is too... damn slow.

Personally, I still think Rails looks like a great (and easy) way to develop webapps. I just wonder if there's some truth to the "can't scale" argument. I guess the best way to find out is for me to develop an application like AppFuse with Rails, and then hammer it (and AppFuse) with JMeter to see what kind of results I get.

On a sidenote, I wonder when Rails will hit the illustrious version 1.0? They released 0.1 last week - which is a bad version number for marketing. If it's as mature as folks claim, why not make the next release 1.0? That version number alone will likely allow developers to use it more in big companies.

Posted in Java at Feb 28 2005, 06:25:27 AM MST 15 Comments

[ANN] Equinox 1.3 Released

This release is mainly a bug fix release, but it also adds support for Maven. All of the frameworks used in Equinox, as well as its build/test system is explained in Spring Live. Detailed release notes are below:

- Added missing "validator" property to "userFormController" bean in Spring MVC version.
- Added "redirect" element to success mapping to user list to prevent duplicate post problem.
- Moved "ctx" variable declaration from decorators/default.jsp to taglibs.jsp so it's available to all JSPs.
- Changed any references to UserDAO in UserWebTest.java instances to use UserManager instead (to prevent problems when transactions aren't used).
- Fixed install scripts in extras so they'd work on Windows from the command prompt. Added "fixcrlf" target for users that encounter issues.
- Added installer for Maven in "extras/maven". This can be used to replace the Ant build system.
- Dependent packages upgraded:

  • Display Tag 1.0
  • Hibernate 2.1.8
  • iBATIS 2.0.9b.550
  • JPOX 1.1.0-beta-1
  • Spring 1.1.4
  • Tapestry 3.0.2

Download. For more information about installing the various options, see the README.txt file.

Demos:

Rather than uploading the different combinations that are possible with Equinox, I figured I'd just wait for requests. So if you'd like things like Tapestry+Spring+JDO, or JSF+Spring+JDBC, let me know and I'll upload a pre-built version of 1.3.

Posted in Java at Feb 27 2005, 05:55:21 PM MST 17 Comments

Table-less forms for your webapp

The Man in Blue has some nice form layouts using fieldsets, labels and CSS. I think I'll integrate one of these styles for the forms in AppFuse. I've always stuck with tables for layout because it seemed easy, but I really like the look and flexibility that CSS provides.

Posted in Java at Feb 26 2005, 03:53:01 PM MST 6 Comments

Updating Pro JSP for JSP 2.1

Apress recently contacted me about updating Pro JSP for JSP 2.1. While the fame of having 3 books published is tempting, I think I'm going to have to pass. The Security chapter I wrote could probably use some updates, but I just wrote a Security Chapter for Spring Live - and I don't really feel like writing another. The other chapter, titled "Using Struts, XDoclet, and Other Tools", would be fun (since it's about AppFuse and Struts Resume), but I'd probably try to squeeze way too much into 50 pages.

Maybe I could just %s/Chapter 11 in Pro JSP/Chapter 12 in Spring Live and %s/Chapter 12 in Pro JSP/Chapter 2 in Spring Live and show folks how to use Struts+Spring+Hibernate. ;-)

Posted in Java at Feb 25 2005, 08:57:42 AM MST 1 Comment

Remember Me works on JRoller!

JRoller has upgraded to Roller 1.0.1 and Remember Me is finally working! Since I'm the one who added this feature - please let me know if you find any issues with it. The last time we deployed it to JRoller, it ended up being a huge security hole and you could log into other people's accounts. Doh! Sorry about that. Hopefully it won't happen this time. ;-)

If you want to know how this feature is implemented, see AppFuse's Remember Me documentation.

Posted in Roller at Feb 21 2005, 04:55:18 PM MST 3 Comments

Why doesn't AppFuse use Maven?

My newest reply for why AppFuse doesn't use Maven is going to be this link. Ant rocks. I still need to update AppFuse's build.xml to use all the Ant 1.6 stuff - that's scheduled for next week's late nights.

Posted in Java at Feb 17 2005, 10:38:30 PM MST 9 Comments

Is Shale ready for primetime?

Is Shale ready for prime-time and use in production applications? David Geary seems to think so:

My consulting job is pretty exciting. I'm using Shale heavily now, especially for wizards. Our application has both static wizards, for creating a new account, for example, and dynamic wizards that are generated from a description of an online-document.

Not only that, but he's going to be talking about it on the No Fluff Just Stuff tour this year.

To start the year, I'm doing three new presentations: "Shale: the next Struts", "Felix: a bag of tricks for JSF", and "Design Patterns: Tales from the server-side". Later on, I'll add two more presentations: in the near term, Killer Web UIs with Tiles and SiteMesh and a little later, a session on Laszlo.

I'm a huge believer in Shale. I have no doubt it's destined for great things, so I'm super-excited about the Shale session.

Now that I've talked about this, I'll probably be accused of caring more about Struts than the other web frameworks I use. In reality, I prefer most of the other frameworks in AppFuse and Equinox to Struts. However, at my current gig we're afraid to move from Struts because we're the only development group that hasn't fallen victim to the Big Blue umbrella. They've tried to make us use WebSphere, but we fought that off and continue to use JBoss. The fear is that if we don't use Struts, and use some lesser-known framework, they'll use that against us. That's why I like Shale - because it might be a way for me to use a more WebWork/JSF-type framework.

Posted in Java at Feb 15 2005, 07:52:33 AM MST 8 Comments

[DJUG] JUG Central and BPEL

Last night, I attended Denver's JUG meeting. Below are my notes from the event.

I'm at DJUG listening to Christian and Kris (from Adigio) talk about their experience with using Spring, WebWork, Hibernate, Lucene and SiteMesh to develop JUG Central (I wonder if they knew this name and concept already exists?). JSPs are for the view and MySQL powers the data. This presentation is designed to explain a bit about each framework, and also tips/tricks and pitfalls they experienced when developing the site. They started working on the application in August of last year and deployed it into production in December.

Christian said they weren't going to go into the how for each framework, but Kris has had quite a few slides on SiteMesh so far. I don't blame him - it's a great tool and only a handful of folks (of about 50-60) have heard of it.

SiteMesh Pitfalls: Poor integration with Velocity and some other frameworks. BTW, if you're using Tapestry - Erik Hatcher recently created a JIRA patch with a Tapestry Decorator.

Now Kris is talking about WebWork and since he's a framework junkie, apparently this is going to be the largest part of the presentation. I think one of the nicest parts of WebWork is its auto-type conversion. The only other frameworks I've seen that have this is are JSF and Tapestry. For those that like WebWork and don't like JSF - you might find it disturbing that the WebWork actions (and their tests) in AppFuse are very similar to the JSF managed beans. I would take it as a compliment if I were a WebWork developer.

One nice thing about XWork's action configuration is you can specify a "method" parameter for a particular action. Struts recently added this with its MappingDispatchAction. I'm using this on my current project and it works quite well. Kris really likes WebWork's front-page controller pattern - where you use the <ww:action> tag to execute the action when the page is loaded. Personally, I don't have a problem with going through actions to get to my view templates. Kris finished up his WebWork piece with a plug for AppFuse (thanks!) and WebWork in Action. Congrats to all the authors - wonder if it'll be published before WebWork Live?

Now Christian is talking about Hibernate and its mapping files - and how you can generate your database schema from them - or generate your mapping files from a database. They used XDoclet to generate the mapping files in this particular project.

Hibernate Pitfalls: Think about lazy-loading early. Problems arise when you try to share Hibernate-managed objects across (Hibernate) sessions transparently. Christian mentions that Spring's OpenSessionInViewFilter is a nice way to solve the problem.

Hibernate Tips: Spring simplifies using Hibernate and makes declarative transactions easy. Read Hibernate in Action before starting development. Plan to spend some time learning how to express your data model with Hibernate relationships (one-to-one, one-to-many, many-to-many, etc.).

Christian is now talking about Spring and how it works. After thinking and writing about Spring so much in the last year, I'll just skip over regurgitating this part. ;-) His main recommendation: use real injection instead of appContext.getBean("beanName").

Other tools used: Lucene for searching and POI for indexing Word, Excel and PowerPoint files. Velocity used for templating e-mail messages.

Service-oriented Architecture (SOA) with Business Process Execution Language (BPEL)
Presented by Kevin Geminiuc and Owen Newnan from Policy Studies

This point of this presentation is to communicate what it's like to implement BPEL in a J2EE Container. BPEL is a layer on top of web services. BPEL is a programming language that you can use to program business processes. Allows you to divorce your business process from being human-centric to being document-centric. At Policy Studies, they're using iLog JRules rules engine and Oracle's BPEL implementation.

Benefits:

  • Process Visiblity
  • Process Agility
  • Powerful Language
  • Open
  • Backed by "the Big Boys" (BEA, Microsoft, IBM)

History: Formerly knows as BPEL4WS, WSBPEL. Open standards based. Orchestrates web services with SOA.

Where we are today: Emerging technology (prepare to bang your head against the wall). .NET and Java products exist, as well as J2EE container integration.

BPEL is: BPEL is not:
  • A programming language for business processes
  • A language for specifying e-business transactions
  • XML-based layer atop WSDL
  • A declarative and procedural language
  • Designed for human workflow
  • A JSR spec (207 and 208 are related though)
  • Mature Technology
  • Your typical web services application
    • asynchrony as well as synchrony
    • callbacks
    • composite synchronous services

BPEL & WS Standards: BPEL, XPath, WSDL, WS-Addressing, SOAP, XML-Schema, WSIF (Axis), TBD (WS-ReliableMessaging and JSRs 207/208). Note that since BPEL depends on web services (which is not a truly reliable service). Because of this, there are some proprietary extensions available.

At this point, I became bored with the presentation and quit taking notes. While the speakers had good intentions with their knowledge sharing, their delivery needed some work. The code walkthrough and demos were presented with a monotonous and unexcited tone, and a handful of folks left during this part. In summary, BPEL looks like a good way to orchestrate your various business processes. It allows you to call web services, EJBs and whatnot simply by defining their locations and methods in XML.

In his demo, Kevin used Oracle's BPEL Designer, which is an Eclipse plugin that has a nice drag-n-drop editor for managing your BPEL XML files. He also used Oracle's BPEL Process Manager, which seemed to be a lot like Jetspeed - you just drop in the .ear and then deploy your processes to it. The only bad part about the Process Manager is it's administration/deployment interface only runs in IE.

If you're using BPEL in your projects, I'd be interested to hear the tools you're using. As far as open-source BPEL process engines, they mentioned Twister and ActiveBPEL.

Posted in Java at Feb 10 2005, 07:05:39 AM MST 5 Comments