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 "php". 96 entries found.

You can also try this same search on Google.

RE: Why use Maven

Warner has a post about why he likes Maven. He might not know it, but he's actually ripping on AppFuse, its directory structure, and build file. I like getting ripped on, so that doesn't bother me. What bother's me is that Warner has comments turned off so no one can get him back. ;-)

The main reason that AppFuse uses Ant over Maven is speed. Maven runs much slower than Ant. Period. Also, with an open source project like AppFuse - I try to appeal to the larger audience, who likely has Ant installed. Other OS projects I work on (displaytag and struts-menu) both use Maven and people have a lot harder time trying to build from source b/c of Maven issues. Lastly, I like having a complete download - rather than download-dependencies-after-you-download-the-project like Maven does. I realize if I did use Maven I could package the dependencies in the app - which is likely what I'd do anyway since the main repositories seem to be constantly out-of-date.

Recently, I had a similar experience to Warner. As part of my current contract, I was tasked to write a couple of Maven sample apps. Warner came to my rescue and helped me out a lot, but I felt like I was jumping through a lot of hoops to do simple stuff that was already done in the Ant version of my app. I guess I'm just not a Maven guy. A project that's done right, regardless of if it's done with Ant or Maven, should build by typing "ant" or "maven" - or at least provide you help on what you need to type. Some projects, like Spring and Struts, actually allow you to use either one out-of-the-box. That's a pretty cool idea and likely keeps everyone happy.

It sounds like Warner has re-worked AppFuse to work with Maven. Care to donate your couple hours of work? I wouldn't use it personally, but there has been interest in a Maven version. Some folks seem to like slow build tools.

Posted in Java at Aug 04 2004, 03:29:04 PM MDT 26 Comments

My WebWork Experience

Yesterday I began converting a small application from Spring MVC to WebWork. By the end of the day I was pretty much finished, but shot an e-mail off the the user's list to figure out a few more things. Today was spent incorporating that knowledge and making the app follow more WW "best-practices". Below is a list of things I discovered:

  • WebWork's documentation is actually quite good. I was able to figure out most things just by reading it. I'm still surprised that most web app frameworks don't describe a simple CRUD operation as their first example. In my experience, CRUD is 80% of a webapp's job.
  • WebWork integrates with Spring quite nicely. It's interesting to see that Spring has most of its MVC Framework support as part of the core, but WW has its own. I wonder why? Who cares, it works!
  • WebWork is a bit better than Spring MVC in that they have a mechanism for saving/displaying success messages. However, it doesn't live past a redirect, so you're still stuck putting messages in the session. Struts (as of 1.2.1) allows you to use a saveMessages(session, messages) call - and subsequent JSP tag to display (and automagically remove). Like it or not, Struts seems like the easiest solution for developers to use.
  • There's no clean mechanism for cancelling validation when a user clicks on a "cancel" or "delete" button. Struts supports cancelling using it's <html:cancel> button and it's pretty easy to detect "delete" and cancel validation in a form's validate() method. I ended up using an onclick handler for my cancel button and not worrying about validation on delete. This is the way I did it with Struts for years. Spring is cool in that it has a processFormSubmission() method that you can override before validation kicks in.
  • With Commons Validator, I'm used to specifying generic validation messages like "errors.required={0} is required.". This is possible with WW by using "errors.required=${getText(fieldName)} is required.". However, WW is a bit unique in that validation rules and ResourceBundles are defined on a per-action basis. I like having a central location for all my messages - like Spring and Struts have. I know it's possible with WW, but I'm trying to develop a "best-practices" sample app.
  • I really dig that fact that you can use one JSP tag to render an entire <tr> in a table. This <tr> ends up having a label and an input field - which is very cool IMO. I did find some issues with the XHTML output, but found it very easy to submit patches. Good stuff.
  • The config files (xwork.xml and validators.xml) must be in WEB-INF/classes. This is because they're XWork configuration files, and XWork is a non-web framework. It would be nice if I could put these in WEB-INF - where the rest of my config files (Spring, SiteMesh, etc.) reside.
  • Many of the JSP tags require you to use "'literal value'" - where you put single and double quotes back-to-back. IMO, this is just ugly and I'd much rather put some sort of indicator that it's a dynamic value - i.e. ${...} or #.
  • I couldn't get client-side validation to work. Seems cool though.

My experience with WebWork has been quite pleasant. I received excellent support from the mailing list - even though it took me a while to subscribe. The mailing list archives are woefully out-of-date, but this is a general java.net problem - not a WW issue. Maybe they should create a forum until the mailing lists get back on track?

Hopefully this last day and a 1/2 will make it much easier to implement WebWork in AppFuse. Thanks for the support gents - now I'm off to learn Tapestry!

Posted in Java at Jul 21 2004, 03:41:58 PM MDT 8 Comments

What phone should I get?

I lost my phone yesterday - somewhere between the airport and the hotel. I doubt anyone will find it and return it to me, so I'm in the market for a new phone. I'd prefer something with a camera - and maybe even the ability to develop Java for it. Any suggestions? Does AT&T carry it? There's an AT&T store right up the street.

Posted in General at Jun 28 2004, 10:06:22 AM MDT 7 Comments

JavaOne - do you have a plan?

I've never been to JavaOne before, but this year I'm attending thanks to SourceBeat. I was planning on attending this conference as I do most - show up, look at the sessions and attend the ones that sound interesting. If it's anything like the MySQL Conference I attended in April, I won't be attending many. There were a lot of PHP and clustering sessions that just didn't interest me, so I only attended a few sessions each day. Compare that to NFJS, where there were many interesting sessions that same time and I hated choosing one over the other.

JavaOne is approaching fast and we'll all be there in 10 days. There seems to be a lot of folks planning what they're going to see each day. Is this a good idea, or can I get away with wingin' it? What about the parties - I've heard about them, but I have no idea what they entail? Are they corporate sponsored - or just a bunch of guys going out drinking together?

Posted in Java at Jun 18 2004, 05:00:00 PM MDT 9 Comments

Weather.com: WebSphere to Tomcat and Oracle to MySQL

At my current client we're going to migrate our application from Tomcat to WebSphere 5 in May. I'm dreading the move and really don't see the point, but alas - the client is always right. However, since my client reads this website, I thought maybe they'd be interested to see that Weather.com recently migrated from WebSphere to Tomcat.

"It was hard to run WebSphere and an IDE [integrated development environment] because of all the resources WebSphere took," recalls Jeff Cunningham, who leads the Internet application development team at Weather.com. "You had to run an instance of DB2 on your machine because WebSphere stored its configurations in DB2, so you had to have all that overhead. It was just really slow. I just started using Tomcat for development because it was so much faster."

The article goes on to say that they evaluated other app servers as well, but chose Tomcat because of the team's preference. They also discovered that Tomcat served up pages significantly faster than WebSphere.

Weather.com is also working on swapping out its Oracle database for the open-source MySQL.
...
"Now when I talk to senior management about moving from Oracle to MySQL they don't ask me, 'Are you sure?'" he says. "They ask me, 'When?'"

It's a great time to be an Open Source Consultant. ;-)

Posted in Java at Apr 29 2004, 11:05:57 AM MDT 16 Comments

MySQL Conference - Day 2

JBoss and MySQL
I'm sitting in Mark Fleury's session on MySQL and JBoss Integration. I'll try and record the things I learn in this session. The first thing that Mark mentions is how they own many popular open source projects: Hibernate, Tomcat, etc. - because they employ the lead developers on those projects.

JBoss Numbers
A standard in the market: #1 in development - more than 4 million downloads in last two years alone. A standard for System Integrators: #2 in growth - CRN survey puts JBoss certified consultant at #2 fastest growing certification with large system integrators. A standard in the market: #3 in production - JDJ survey: 70% of users to go Deployment. BZResearch survey. 13% in 2002, 27% in 2003, largest growth of all servers (IBM at 40% and BEA at 34%).

"Federated" Projects
JBoss AS, Hibernate, Tomcat, JBossIDE (Eclipse integration, XDoclet driven development, debugging), JBossCache (distributed data), JGroups (reliable multicast and cluster communication), Nukes (portal and CMS), JBossAOP and Javassist (bytecode manipulation library).

Cache and ORM: Scalability for MySQL
Keep your data in a MySQL instance. Put an ORM (Hibernate) layer on top of it. Replicate the data with cache infrastructure. Cache is King.

Mark is now talking about Hibernate and what it's useful for. I'm guessing that a lot of folks in this session are either interested in JBoss or Hibernate. He's talking about RDBs and what they do well. Next I'm guessing he'll talk about Hibernate and all its features. No need for me to regurgitate that information here - since I suspect a lot you are familiar with Hibernate. If not - what the hell are you waiting for? ;-) If you can't use Hibernate b/c you're standardized on SQL, you should at least use iBATIS. BTW - did you know that BEA's Page Flow demo app is a re-written version of Clinton's JPetstore? If you're standardized on JDBC, you might want to use Spring's JDBC support - which solves many of the problems with JDBC (try/catches, closing connections, etc.).

What is JBossCache?
A transactional replicated cache for JBoss with and without AOP. A cache for frequently accessed elements: Stateful Session Beans, HttpSession. Caches are used in a number of places in JBoss - this one provides a central cache service (MBean interface).

AOP Cache
Java is very dumb - Mark hopes the next OO language we use (in 10 years) is more event-driven (i.e. triggers in Java). This is possible today with AOP. In the example below, Joe's state is automatically transactional and replicated. State replicated, synchronized at transaction commit/rollback.

tree.start(); // kick start tree cache
tree.putObject("/aop/joe", joe); // add aop sanctioned object

tx.begin();
joe.setAge(41);
joe.getAddress().setZip(95124);
tx.commit();

Mark says, "HQL - soon to be EJB 3.0 QL". Interesting quote, eh?

PHP PostNuke - wasn't scalable when they first installed it because it hit the database all the time for security information. The Zend PHP didn't have the notion of global variables - so there wasn't a way to build a cache. According to the PHP guys, MySQL was the cache. JBoss re-wrote it all J2EE and now their server is at 5% utilization with an average of 500 concurrent users. Forums are a port of PHP BB - which is a very nice forum software package IMO. Personally, I'd prefer to use PHP BB over JBoss Nukes since most ISPs offer PHP out-of-the-box. I'm guessing that JBoss Nukes only runs on JBoss. Also, PHP BB is much cleaner and prettier out of the box. I'm a sucker for good looking webapps. ;-)

BTW, Jeremy Zawodny (Yahoo guy) has a number of links that might of interest for this conference. For your convenience, here's the best link: the 2004 MySQL Users Conference blog aggregator.

Posted in Java at Apr 15 2004, 08:30:58 AM MDT 7 Comments

Web Frameworks - which one should I learn?

I've seen a lot of talk about Web Frameworks these last couple of weeks - particularly JavaServer Faces, WebWork and Spring. There's also been great articles posted comparing Spring and WebWork as well as an Introduction to Spring from TSS. Spring, WebWork and JSF all look like excellent frameworks to me, but I also continue to believe that Struts is a great framework. And I would go so far as to say that it's the best web application framework. Yep, I said it - Struts is the best web application framework to learn if you are a web developer wondering what to learn. Why? Because it will get you a job.

I've continued to receive a fair amount of calls and e-mails over the last couple of weeks - and they're all calling because of my Struts experience. Good luck in finding a company that wants you to build their web application using WebWork or Spring. Maybe someday I'll be lucky enough to hire employees for Raible Designs and build web applications in my own office with my own employees. Then we'll get to choose whatever technology we want to build customers' apps. Until then, I'll stick with Struts and continue to be an employed developer.

I strongly believe the best way to learn anything is to get paid to do it. I've learned Struts over the past couple of years, not because I wanted to, but because someone else wanted me to - and they paid me to do it. Of course, there are some companies that will probably pay you to learn WebWork or Spring, but most would rather not.

Another thing to consider is that WW and Spring will probably someday develop "migrating from Struts" documentation. Sounds like a good idea to me - until then, and until someone pays me to learn the others, Struts is #1 for me.

Now it's your turn to tell me why my logic is flawed... if you can. ;-)

Posted in Java at Oct 17 2003, 01:22:23 PM MDT 21 Comments

OS X: Apps I dig

I'm suspicious that there's more cool apps for OS X out there, so I'll tell you my favorites, and maybe I'll hear about some new ones in the process.

There's more that I didn't feel like listing because I figured most folks know about them - NetNewsWire, Tiger Launch and Clutter to name a few.

Posted in Mac OS X at Oct 17 2003, 09:24:39 AM MDT 6 Comments

JSF and Apache Axis at DJUG

I attended tonight's DJUG Meeting. The meeting was informative and well attended, but it was way too long. I just got home and it's a bit after 11:00. To put it in perspective, I arrived at 6:00. That's 4 1/2 hours of Java love. Elections contributed to the delay, as well as David Geary's 2 1/2 hour JSF presentation.

The basic concepts meeting covered Apache Axis, presented by Scott Davis. He showed us how easy it was to use Axis to create a web service and how to call it from the command line. The biggest highlight of his presentation (for me) was Keynote - his presentation software. It had wicked transitions and the slides looked awesome (good purchase Scott). Other cool software noted during Scott's preso was CodeTek's Virtual Desktop.

Next up was David Geary for a presentation on JSF. This guy has quite a resume: worked for Sun from 1994-97, member of the JSF and JSTL Expert Groups, author of 6 books, designed and implemented the Struts Template library (2nd committer to Struts after Craig). Books coming soon from David: Core JavaServer Faces, Core Rave, and Extreme Struts. Extreme Struts sounds very much like the Struts chapter I wrote for Pro JSP - XDoclet, StrutsTestCase, JUnit, Tiles and Validator. If you're looking for documentation on AppFuse or Struts-Resume, you'll find it in this book. If you don't remember, I wrote these apps for my chapters.

Most folks reading this blog probably know what JSF is. If you don't, it's a Java-based framework for building web applications. It is designed to replace Struts, but that probably won't happen until well after it's 1.0 release (March, Beta in December). JSF was also written to compete with .NET's WebForms, kinda like how JSP was developed to compete with ASP.

Sun's Project Rave is what supposedly will make JSF easy. Can Rave really be that much better than Eclipse or IDEA? Good luck Sun, those are two killer IDEs that are going to be very difficult to beat. And besides, has Sun ever produced any good applications? iPlanet sucks, so does Forte - comparing both to the other options out there.

I could go on and on about what I learned at this presentation, so let me just give you a brief synopsis. JSF generates JavaScript for you for event handling. The JSP tags are long and ugly, but they're named this way (i.e. <h:selectone_menu>) to distinguish a component (selectone) from a renderer (menu). David said he complained about this immensely when he joined the Expert Group, but now sees the point. No XML attributes are used in faces-config.xml - it's all entities. Reminds me of web.xml, lots of typing for not much information (what a pain - today's tool suck at deployment descriptors). JSF has no client-side validation - looks like Commons Validator will be around for quite some time. Especially since JSF requires you to specify your validation after each component in the JSP (vs. declaratively using the Validator). JSF EA4 does not work with Tiles - they're working vigorously to fix this. You can specify your navigation-rules separate from you actions in faces-config.xml (very cool feature).

If you know JSPs and Servlets, it's much easier to learn Struts (and presumably other webapp frameworks). If you know Swing, it'll be much easier to learn JSF. To me, this seems wrong. Some of the examples given tonight had HTML in .java files (for custom renderers). Are we reverting back to Servlets? Is Sun making a mistake with JSF? How is it better than WebWork or Struts? It seems to me to be an over-designed product developed by a bunch of Swing addicts.

My first impression of JSF is that it's going to be harder to teach to newbies (vs. Struts). Everyone says it's a standard so the tools vendors will come through and make it easy. The tools vendors haven't done shit for JSP and JSTL IMO, so how is JSF different? It's a good idea, it just needs to be simplified - a lot. KISS.

Posted in Java at Oct 08 2003, 11:24:35 PM MDT 1 Comment

PHP vs. Java - which is better?

I have a former client that has a customer. This customer asked them - "so when are you migrating from Java to PHP?" So evidently this person has the impression that the next wave of web applications will be written in PHP. My former client has asked me to provide an answer for their customer. If I translate it, I think they mean to ask "what is different between Java and PHP and why should we use Java over PHP." Here are my opinions - please add yours as you see fit. I must admit I don't know a whole lot about PHP, except that it's widely popular among the Linux/Apache/MySQL crowd and that it's similar to ASP in it's lack of a MVC architecture (yes, I know about the PHP MVC project).

  • I think Java is more of an industry standard, whereas PHP seems to be popular among hackers and hobbyists.
  • Java provides better separation of layers - key for testability. PHP has all the code embedded in the page, so you have to run it through a browser to test if database connections work (for instance).
  • Java is more scalable.
  • More folks know Java and it's easier to qualify someone's Java skills. How do you test someone knows PHP? Is there a certification?
  • More for-profit organizations use it.

If you're a Java or a PHP-lover, I'd love to hear your opionions (facts are always better). I'm going to point my client to this post, so keep it clean.

Posted in Java at Aug 22 2003, 03:52:33 PM MDT 98 Comments