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 "java". 1,588 entries found.

You can also try this same search on Google.

Lovin' Hibernate

I'm loving Hibernate after using it for a few weeks. I'm sure I'd like it a lot more if I'd break down and read the documenation. But nope, I'm still only reading it on a JIT basis. I feel about Hibernate like I first felt about Struts. It's fun and easy to work with and makes my persistent-life soooo much easier. Now if I could only break down and learn something about ConvertUtils.

Posted in Java at Jan 10 2003, 09:29:37 PM MST Add a Comment

Struts Resume @ Sourceforge.net

I'm in the midst of checking in my struts-resume app to the struts-apps project at sourceforge.net. I hate to admit it, but I'm doing it the ugly way. I have a ~12MB lib directory that contains all the 3rd party jars used in this application. Ugh, I wish I was using Maven now. I figure you gotta start somewhere though - so I might as well get it all in there and clean it all up later.

Posted in Java at Jan 07 2003, 10:46:01 PM MST Add a Comment

CVS through an HTTP Proxy?

Anyone know how to access a CVS server (i.e. SourceForge) though an HTTP Proxy? I need to get the latest CVS version of XDoclet at work and I can only get out via a proxy. Thanks in advance.

Posted in Java at Jan 07 2003, 11:37:21 AM MST 9 Comments

Tomcat 4.1.18 + Apache 2.0.43 + SSL

I'm going to test out my articles on Tomcat+Apache and Apache+SSL this morning - and will update my findings here. I already have Tomcat 4.1.18 installed and working great. I will NOT be setting up clustered instances of tomcat (i.e. tomcat 1, tomcat2) but I will set up my environment to allow for a clustered environment. I am doing this on a Windows 2000 SP3 machine, which Cygwin installed. Cygwin has all the required modules already installed - SSH, OpenSSL, etc. Below are the errors I've found - hopefully someday I'll use this post to update the articles.

  • The link to download the latest Linux version is bad. Update your bookmarks for the latest 2.0.43 release.
  • Since I want SSL, I downloaded 2.0.43 with mod_ssl and OpenSSL 0.9.6 from http://hunter.campbus.com/.
  • I unzipped the download to c:\Tools\apache and chose to "user folder names."
  • I downloaded mod_jk-2.0.42.dll and put it in $APACHE_HOME\modules ($APACHE_HOME = c:\Tools\apache).
  • Added the following to $APACHE_HOME\conf\http.conf after the last LoadModule:
    #
    # Load mod_jk
    #
    LoadModule jk_module modules/mod_jk-2.0.42.dll

    #
    # Configure mod_jk
    #
    JkWorkersFile conf/workers.properties
    JkLogFile logs/mod_jk.log
    JkLogLevel info
  • Below DocumentRoot in httpd.conf, I added:

    JkMount /* tomcat1

    ... because I want everything to go to Tomcat.
  • Then I continued with Steps 2.3+, only configuring Tomcat1 though.
  • NOTE: Checkout Step 6 for setting up multiple instances of Tomcat that can be used to host separate applications. For instance, this is great for setting up myapp1.raibledesigns.com, myapp2.raibledesigns.com. This is what I've always used Apache+Tomcat for, rather than for load balancing.
  • Next I searched for @@ in http.conf and changed appropriately (all I change was the ServerAdmin. I also had to change line 57 from c:/apache to c:/tools/apache, and DocumentRoot from c:/apache/htdocs to c:/tools/apache/htdocs. 25 lines below DocumentRoot, change Directory to be the same as DocumentRoot.
  • Navigate to $APACHE_HOME\bin and type "Apache -k install".
  • Type "Apache -k start" and goto http://localhost. Hey it worked - first try!! There's an ApacheMonitor.exe file in $APACHE_HOME\bin that will allow to to start/stop/restart Apache from the SystemTray. Now onto configuring SSL.
  • From step 3, creating a certificate, I literally copied and pasted all the command into Cygwin and everything worked without a hitch.
  • I then uncommented the following line in httpd.conf: LoadModule ssl_module modules/mod_ssl.so
  • I had to change all references from "c:/apache" to "c:/tools/apache" in the already installed ssl.conf file in the same directory as httpd.conf. I did this in httpd.conf just for kicks too - 11 replacements on top of those I already made.
  • Then I commented out the <IfDefine SSL> tags at the beginning and the end of ssl.conf, since I want SSL to always be running.
  • I then got the following error:
    Syntax error on line 114 of C:/Tools/apache/conf/ssl.conf:
    SSLCertificateFile: file 'C:/Tools/apache/conf/ssl.crt/server.crt' does not exist or is empty


    So I changed SSLCertificateFile c:/tools/apache/conf/ssl.crt/server.crt in ssl.conf to be (same as beginning of above)/conf/ssl/server.crt, and SSLCertificateKeyFile c:/tools/apache/conf/ssl.key/server.key to remove .key so it's just .../conf/ssl/server.key. Then I stopped and restarted Apache.
  • Whalla!! - https://localhost/index.jsp worked like a charm.

Hope this helps make your next Tomcat/Apache installation easier.

Posted in Java at Jan 07 2003, 07:12:32 AM MST Add a Comment

Upgrading to Struts 1.1b3 - Tips

I upgraded one of my client's applications from Struts 1.1b2 to Struts 1.1b3 tonight. It was a small headache, but not too bad. As far as the differences b/w 1.1b2 and 1.1b3 - they're pretty significant. Some classes/methods are downright gone - not just deprecated, but gone. Oh well, that's why it's a beta - and it's free, so who's complaining? I'll try to remember a few issues I found. The first is how to create a DynaActionForm. The code below worked with 1.1b2:

DynaActionForm messageForm = 
    (DynaActionForm) DynaActionFormClass.getDynaActionFormClass(
                     Constants.MESSAGE_KEY).newInstance();

But the getDynaActionFormClass method is now gone, so you have to use this:

FormBeanConfig cfg =
    mapping.getModuleConfig()
           .findFormBeanConfig(Constants.MESSAGE_KEY);

DynaActionForm messageForm =
    (DynaActionForm) DynaActionFormClass.createDynaActionFormClass(cfg)
                                        .newInstance();

A few deprecation errors cropped up as well.

  • Action.MESSAGE_KEY -> Globals.MESSAGE_KEY
  • Action.ERROR_KEY -> Globals.ERROR_KEY
  • org.apache.struts.validator.StrutsValidatorUtil -> org.apache.struts.validator.Resources

Finally, I found an issue with using BeanUtils.populate(dest, orig). It worked fine with 1.1b2, but throws a NPE with 1.1b3. I replaced this with BeanUtils.copyProperties(dest, orig) and everything works as it should. My guess (from doing a toString() on the orig) is that "multipartRequestHandler=null" was messing things up.

It's interesting doing maintenance/enhancements on code that I wrote a year ago. I've learned sooooo much since then. I wish I could go back and re-factor a bunch, but my client would never go for it - it works right?! Maybe I'll refactor some for kicks - just to see if it's possible. I'd love to replace a few DAOMySQL's with DAOHibernate's ;-)

Posted in Java at Jan 06 2003, 11:16:48 PM MST 6 Comments

CVS, SSH and Passwords

Anyone know of a utility that can be used to "remember" my CVS password? I can only access the server using SSH (similar to SourceForge) and it's getting to be a real pain to type my password every time.

Posted in Java at Jan 06 2003, 07:58:33 AM MST 4 Comments

How do you store your user's information?

After talking with Erik Hatcher a bit, I'm a bit worried about how I'm storing the current user's information. Basically, I'm putting a UserForm (extends ValidatorForm) into the session, and keeping it there to retrieve any user information I might need - in particular the userId. This is not the same as the user's login name, or the value I get from request.getRemoteUser(). How do you do this? I need the user's id from database lookups and filtering drop-downs, etc.

Posted in Java at Jan 06 2003, 07:54:05 AM MST 2 Comments

I'm lovin' Eclipse and its plugins (CVS, Hibernate)

After working with Eclipse pretty heavily for the last week - I am beginning to become one of those guys that cannot live without an IDE. It's unfortunate in one sense, but it's great because it sure is saving me a lot of time. I love the "Organize Imports" feature, especially on the package level. Use it with caution if you've got generated classes - or add the generated classes to your classpath. I also really like the Jalopy Beautifier. I'm sure IDEA has these features too - if it doesn't, it should! Another cool plugin I found last week was one from the Eclipse team to hide CVS directories.

This morning, I found that the Hibernate team has released a new plugin for Eclipse - the Hibernator.

*** Hibernator - Hibernate plugin for Eclipse ***

Provides an Eclipse view to create and edit Hibernate mapping files (.hbm.xml).

Note this plugin will only work with Eclipse 2 (WSAD 5) and above

* Installation

- Unzip hibernator-0.9.zip into <eclipse-install>/plugins - Restart Eclipse

* Using the plugin

Go to menu Window->Show View->Other and select Hibernator

Open up some Java source and the plugin will either display the mapping file <class-name>.hbm.xml or a generated version

To save the contents of the mapping file right click in the window and select "Save"

Report any bugs / Submit patches to - http://sourceforge.net/projects/hibernator.

I doubt I'll use this as I'm using XDoclet to generate my Hibernate mapping files from POJOs. However, the CodeGenerator for Hibernate is being re-vamped to allow for generation of .java files from an .hbm.xml file. Now if I could hook this into generation of Struts' ValidatorForms, I might actually use it.

Posted in Java at Jan 06 2003, 07:50:12 AM MST Add a Comment

[ANNOUNCE] Hibernate 1.2.2 Released

Matthew E. Porter provided us with a heads up that Hibernate 1.2.2 was released. I don't even think they posted this to the mailing list, as I'm a subscriber to hibernate-devel and never received an e-mail. Released yesterday, on my Mom's birthday.

Version 1.2.2 fixes an incompatibility with certain application servers and JVM implementations. [Download]

In other news, Julie did some worrying tonight and decided that I should prepare for our house burning down. The only real thing she wanted me to do was to make sure that all the pictures of Abbie were backed up at an off-site location. So I'm doing some disaster recovery planning. Yikes - 565 MB (after tar and gzip, 1.2 GB before!) - I guess I won't be backing this one up online! I think I'll burn a CD and send it to my folks.

Posted in Java at Jan 05 2003, 10:37:38 PM MST Add a Comment

Adding color to VIM and Cygwin

These are notes-to-self more than anything, but maybe you can use them. You can add colorized text to Vim by adding the following to .vimrc in your $HOME directory:

" Switch syntax highlighting on, when the terminal has colors
" Also switch on highlighting the last used search pattern.
if &t_Co > 2 || has("gui_running")
  syntax on
  set hlsearch
endi

If you don't have this file, you can create it using :mkv. You can change your font-settings by editing them with Edit >> Select Font and then typing :set guifont, followed by :mkv!. I prefer Courier New, 9pt.

If you want colors for file listings (using ls) in Cygwin, add the following to your .bashrc file in your $HOME directory:

alias ls="ls -CF --color"

Posted in Java at Jan 05 2003, 03:12:08 PM MST 7 Comments