Deer Creek Canyon Trail
This evening I enjoyed an awesome ride up Deer Creek Canyon Trail in the foothills. Click on the image below for proof.
Up next: White Ranch on Wednesday.
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 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.
This evening I enjoyed an awesome ride up Deer Creek Canyon Trail in the foothills. Click on the image below for proof.
Up next: White Ranch on Wednesday.
I recently updated my status on LinkedIn to read:
Matt is determined not to have 500+ connections. Will start removing connections soon.
A couple of days later, I received the following message from a connection:
I noticed the other day you mentioned that you are determined to not have over 500 LinkedIn connections. I'm wondering what the reason is? Not just because LinkedIn shows 500+ after that, is it? As you work for LinkedIn, I assume there's some other reason. I'm interested to know what it is...
I joined LinkedIn May 27, 2003, 22 days after it initially launched. For the first few years, I accepted invitations when I received them. Some folks I knew, some I didn't. When I started consulting for LinkedIn last summer, I had somewhere between 200 and 300 connections. Most of them were people who had contacted me, not folks I had contacted.
One day, I used the import webmail contacts feature to pull in my contacts from Gmail. My number of connections quickly jumped by 100 and it's increased quite a bit since then (mostly due to co-workers from LinkedIn). Of the almost 500 connections I have, I believe there's a good 100-200 of them that are folks I don't know, have never had contact with, and will likely never benefit from being "connected" with.
I guess the main reason I'm planning on trimming my connections is to make my network higher quality. I admit I'm somewhat motivated by the 500+ icon, but it's also a genuine feeling that there's quite a few folks I won't benefit from being connected to. I'm not a LION after all. I believe my LinkedIn network should resemble my real-world network.
What's your opinion? Should I have folks in my network that know me, but I don't know them?
Dusty recently posted an interesting idea to the AppFuse developers mailing list:
After thinking/coding/reading for a while I think the more interesting
task is: Retool AppFuse to be one or more Struts2 plugins based on
various higher level app patterns. (AppFuse Facebook, AppFuse
Employee DB, AppFuse Blog, AppFuse Basic LDAP, AppFuse Basic Crowd).
This all comes from the fact, that I have been wanting to refactor the
AppFuse web layer for Struts. One of the interesting aspects of
AppFuse is that it works pretty much the same across all its web
frameworks. It does so with some lowest common denominator
abstractions that can be ported and look and work the same across
frameworks. I have picked my tool(s): Struts 2 and Ruby On Rails when
I want to pretend I am young again. I know Spring MVC, JSF, etc. but
I have no desire to build significant apps on those platforms. It's
not because they suck and Struts2 rules, it is because I know Struts 2
the best, I am most efficient there and it provides everything I need
to build great webapps (Let's not devolve to a framework debate). So,
I would rather have a more Struts 2-specific web stack, that really
leverages conventions born and raised there. The nice thing about the
Struts 2 web stack is that it is complemented nicely by AppFuse's data/service layer, since unlike Grails or Rails, Struts 2 has no data or service layer.
[Read More »]
Seems like a good idea to me. What do you think?
Someday I'd like to come up with a "compatibility test" that allows others to improve upon the ideas in AppFuse and develop their stacks independently. A suite of Selenium tests that require extensionless URLs might be a good start.
Last week, Chris Barham showed us an example of how to implement external sorting and paging with AppFuse + DisplayTag. This week, he's at it again with a tutorial titled Searching in AppFuse 2.0.2 with Compass 2.0 and Lucene 2.3.2.
From a message he sent to the mailing list:
I've extended the previous DisplayTag external sorting and paging project to implement full search capability across the domain objects by using Compass 2.0 - http://www.compass-project.org.
Although there are a number of tutorials around for Compass and AppFuse, I thought I'd update as Compass has just gone to version 2.0 and has new features, (annotations etc).
Search results in the example are displayed in plain HTML with Compass' own paging feature, and also using DisplayTag with its paging external feature, (both on the same search results page in the example).
Code is in a branch off the original project called branches/search - check it out with:
svn checkout http://pagingappfuse.googlecode.com/svn/branches/search/ appfusecompass
Instructions on how to implement Compass are here:
http://code.google.com/p/pagingappfuse/wiki/CompassSearching
Cheers,
Chris
Again, great work Chris! We really appreciate your contributions.
Today was one of those days I hope I do more often as a single parent. Ever since ski season ended, I've had a hard time entertaining the kids on weekends. I don't have them every weekend - Julie and I each get them a week at a time. However, for the past couple times I've had them, our weekends have been rather lame. We've still done stuff, but it's usually only a couple hours at a time. The last time I had them we went to Bass Pro Shops, got them some fishing gear and headed out to a local lake. However, once their lines got tangled and they started frolicking in the mud (while I tried to untangle them), I felt like my mission failed.
I don't know what was so special about today, but I think it was simply getting out of the city and into the hills. This morning we had breakfast with Julie, headed to REI for a new tent and then drove up to Rocky Mountain National Park to look at some animals and take a hike. We stopped in Estes Park for some ice cream and playground action and then headed into the park to gaze at some Elk and hike along a small creek. Evidence is contained in the pictures below and in a set on Flickr.
We bought the tent this morning because we were planning on camping with the Colorado Bus Club before Volkswagens On The Green (VWOTG) tomorrow. However, Abbie's cold started to get pretty bad this afternoon, so we decided to camp in the backyard instead.
Tomorrow should be a lot of fun. The forecast is 86°F and the VWOTG show is always inspiring.
Alternative Adult has only posted a couple times in 2008, but his entries have peaked my interest.
Spring MVC or JSF+?
My business unit is trying to standardize if we can on a single Java-based Web framework going forward to simplify the Web development process, especially as individual developers move from one division to another, or centralized support groups need to maintain multiple applications from multiple divisions.
At the enterprise level within my company, the architecture group says that they will provide support for either Spring MVC or JSF+ (where the + represents the accompanying technologies you would use to provide a more maintainable application and a more rich user experience, e.g. Facelets, Richfaces, etc.).
Now my business unit is trying to decide which of these two frameworks, Spring MVC or JSF+, is the most appropriate to standardize upon for our development community. [Read More]
...and...
State of Spring Web
For those that are interested, the following is a summary of the notes I captured from a conversation with SpringSource on the state of Spring Web. [Read More]
Good stuff Michael - keep it coming.
Last week, I had a go of making a Spring MVC application use extensionless URLs. I did some googling, found some tips on the Spring Forums and believe I arrived at a solid solution. Using the UrlRewriteFilter (version 3), I was able to create a rule that looks for any URLs without an extension. If it finds one, it appends the extension and forwards to the controllers. This rule is as follows (where *.html is my servlet-mapping for DispatcherServlet in web.xml):
<rule> <from>^([^?]*)/([^?/\.]+)(\?.*)?$</from> <to last="true">$1/$2.html$3</to> </rule>
As long as I hand-write all my URLs without an extension (<a href="home"> vs. <a href="home.html">), this seems to work. To combat developers that use "home.html", one solution is to require all links to be wrapped with <c:url value="url"/> (or some other macro that call response.encodeURL()). If you can convince everyone to do this, you can write an outbound-rule that strips the .html extension from URLs.
<outbound-rule> <from>^(.*)\.html(\?.*)?$</from> <to last="false">$1$2</to> </outbound-rule>
In an ideal world, it'd be possible to modify the <a> tag at the very core of the view framework you're using to automatically encode the URL of any "href" attributes. I don't think this is possible with JSP, FreeMarker, Facelets or any other Java Web Framework templates (i.e. Tapestry or Wicket). If it is, please let me know.
Below is my final urlrewrite.xml with these rules, as well as my "welcome-file" rule at the top.
<?xml version="1.0" encoding="utf-8"?> <!DOCENGINE urlrewrite PUBLIC "-//tuckey.org//DTD UrlRewrite 3.0//EN" "http://tuckey.org/res/dtds/urlrewrite3.0.dtd"> <urlrewrite> <rule> <from>/$</from> <to type="forward">home</to> </rule> <rule> <from>^([^?]*)/([^?/\.]+)(\?.*)?$</from> <to last="true">$1/$2.html$3</to> </rule> <outbound-rule> <from>^(.*)\.html(\?.*)?$</from> <to last="false">$1$2</to> </outbound-rule> </urlrewrite>
If you have other solutions for extensionless URLs with Java web frameworks, I'd love to hear about them. With any luck, 2008 will be the year we drop extensions (and path-mappings) from our URLs. The stat packages might not like it, but I do.
The AppFuse Team is pleased to announce the release of AppFuse 2.0.2. This release includes upgrades to Spring Security 2.0, jMock 2.4, the ability to customize code generation templates and many bug fixes.
For information on upgrading from 2.0.1, see the Release Notes or changelog. AppFuse 2.0.2 is available as a Maven archetype. For information on creating a new project using AppFuse, please see the QuickStart Guide or the demos and videos.
To learn more about AppFuse, please read Ryan Withers' Igniting your applications with AppFuse.
The 2.0 series of AppFuse has a minimum requirement of the following specification versions:
If you've used AppFuse 1.x, but not 2.x, you'll want to read the FAQ. Join the user mailing list if you have any questions.
Thanks to everyone for their help contributing code, writing documentation, posting to the mailing lists, and logging issues.
Please post any issues you have with this release to the mailing list.
For the past couple of weeks, I've been developing a web application that deploys into an OSGi container (Equinox) and uses Spring DM's Spring MVC support. The first thing I discovered was that Spring MVC's annotations weren't supported in the M1 release. This was apparently caused by a bug in Spring 2.5.3 and not Spring DM. Since Spring DM 1.1.0 M2 was released with Spring 2.5.4 today, I believe this is fixed now.
The story below is about my experience getting a Spring MVC application up and running in Equinox 3.2.2, Jetty 6.1.9 and Spring DM 1.1.0 M2 SNAPSHOT (from last week). If you want to read more about why Spring MVC + OSGi is cool, see Costin Leau's Web Applications and OSGi article.
To get a simple "Hello World" Spring MVC application working in OSGi is pretty easy. The hard part is setting up a container with all the Spring and Jetty bundles installed and started. I imagine SSAP might solve this. Luckily for me, this was done by another member of my team.
After you've done this, it's simply a matter of creating a MANIFEST.MF for your WAR that contains the proper information for OSGi to recognize. Below is the one that I used when I first tried to get my application working.
Manifest-Version: 1 Bundle-ManifestVersion: 2 Spring-DM-Version: 1.1.0-m2-SNAPSHOT Spring-Version: 2.5.2 Bundle-Name: Simple OSGi War Bundle-SymbolicName: myapp Bundle-Classpath: .,WEB-INF/classes,WEB-INF/lib/freemarker-2.3.12.jar, WEB-INF/lib/sitemesh-2.3.jar,WEB-INF/lib/urlrewritefilter-3.0.4.jar, WEB-INF/lib/spring-beans-2.5.2.jar,WEB-INF/lib/spring-context-2.5.2.jar, WEB-INF/lib/spring-context-support-2.5.2.jar,WEB-INF/lib/spring-core-2.5.2.jar, WEB-INF/lib/spring-web-2.5.2.jar,WEB-INF/lib/spring-webmvc-2.5.2.jar Import-Package: javax.servlet,javax.servlet.http,javax.servlet.resources,javax.swing.tree, javax.naming,org.w3c.dom,org.apache.commons.logging,javax.xml.parsers;resolution:=optional, org.xml.sax;resolution:=optional,org.xml.sax.helpers;resolution:=optional
Ideally, you could generate this MANIFEST.MF using the maven-bundle-plugin. However, it doesn't support WARs in its 1.4.0 release.
You can see this is an application that uses Spring MVC, FreeMarker, SiteMesh and the URLRewriteFilter. You should be able to download it, unzip it, run "mvn package" and install it into Equinox using "install file://<path to war>".
That's all fine and dandy, but doesn't give you any benefits of OSGi. This setup works great until you try to import OSGi services using a context file with an <osgi:reference> element. After adding such a reference, it's likely you'll get the following error:
SEVERE: Context initialization failed org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Unable to locate Spring NamespaceHandler for XML schema namespace [http://www.springframework.org/schema/osgi]
To fix this, add the following to your web.xml (if you're using ContextLoaderListener, as an <init-parameter> on DispatcherServlet if you're not):
<context-param> <param-name>contextClass</param-name> <param-value>org.springframework.osgi.web.context.support.OsgiBundleXmlWebApplicationContext</param-value> </context-param>
After doing this, you might get the following error on startup:
SEVERE: Context initialization failed org.springframework.context.ApplicationContextException: Custom context class [org.springframework.osgi.web.context.support.OsgiBundleXmlWebApplicationContext] is not of type [org.springframework.web.context.ConfigurableWebApplicationContext]
To fix this, I change from referencing the Spring JARs in WEB-INF/lib to importing the packages for Spring (which were already installed in my Equinox container).
Bundle-Classpath: .,WEB-INF/classes,WEB-INF/lib/freemarker-2.3.12.jar, WEB-INF/lib/sitemesh-2.3.jar,WEB-INF/lib/urlrewritefilter-3.0.4.jar Import-Package: javax.servlet,javax.servlet.http,javax.servlet.resources,javax.swing.tree, javax.naming,org.w3c.dom,org.apache.commons.logging,javax.xml.parsers;resolution:=optional, org.xml.sax;resolution:=optional,org.xml.sax.helpers;resolution:=optional, org.springframework.osgi.web.context.support, org.springframework.context.support, org.springframework.web.context, org.springframework.web.context.support, org.springframework.web.servlet, org.springframework.web.servlet.mvc, org.springframework.web.servlet.mvc.support, org.springframework.web.servlet.view, org.springframework.ui, org.springframework.web.servlet.view.freemarker
After rebuilding my WAR and reloading the bundle in Equinox, I was confronted with the following error message:
SEVERE: Context initialization failed org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'freemarkerConfig' defined in ServletContext resource [/WEB-INF/myapp-servlet.xml]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: freemarker/cache/TemplateLoader at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:851)
As far as I can tell, this is because the version of Spring MVC installed in Equinox cannot resolve the FreeMarker JAR in my WEB-INF/lib directory.
To prove I wasn't going insane, I commented out my "freemarkerConfig" and "viewResolver" beans in myapp-servlet.xml and changed to a regular ol' InternalResourceViewResolver:
<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"> <property name="prefix" value="/"/> <property name="suffix" value=".jsp"/> </bean>
This worked and I was able to successfully see "Hello World" from a JSP in my browser. FreeMarker/SiteMesh worked too, but FreeMarker didn't work as a View for Spring MVC.
To attempt to solve this, I create a bundle for FreeMarker using "java -jar bnd-0.0.249.jar wrap freemarker-2.3.12.jar" and installed it in Equinox. I then change my MANIFEST.MF to use FreeMarker imports instead of referencing the JAR in WEB-INF/lib.
Bundle-Classpath: .,WEB-INF/classes,WEB-INF/lib/sitemesh-2.3.jar,WEB-INF/lib/urlrewritefilter-3.0.4.jar Import-Package: javax.servlet,javax.servlet.http,javax.servlet.resources,javax.swing.tree, javax.naming,org.w3c.dom,org.apache.commons.logging,javax.xml.parsers;resolution:=optional, org.xml.sax;resolution:=optional,org.xml.sax.helpers;resolution:=optional, org.springframework.osgi.web.context.support, org.springframework.context.support, org.springframework.web.context, org.springframework.web.context.support, org.springframework.web.servlet, org.springframework.web.servlet.mvc, org.springframework.web.servlet.mvc.support, org.springframework.web.servlet.view, org.springframework.ui, org.springframework.web.servlet.view.freemarker, freemarker.cache,freemarker.core,freemarker.template,freemarker.ext.servlet
Unfortunately, this still doesn't work and I still haven't been able to get FreeMarker to work with Spring MVC in OSGi. The crazy thing is I actually solved this at one point a week ago. Shortly after, I rebuilt Equinox from scratch and I'm been banging my head against the wall over this issue ever since. Last week, I entered an issue in Spring's JIRA, but thought I'd fixed it a few hours later.
I've uploaded the final project that's not working to the following URL:
http://static.raibledesigns.com/downloads/myapp-osgi.zip
If you'd like to see this project work with Spring MVC + JSP, simply modify myapp-servlet.xml to remove the FreeMarker references and use the InternalResourceViewResolver instead.
I hope Spring DM + Spring MVC supports more than just JSP as a view technology. I hope I can't get FreeMarker working because of some oversight on my part. If you have a Spring DM + Spring MVC application working with Velocity or FreeMarker, I'd love to hear about it.
In a week from today, I'll begin the annual trek to one of the best conferences on the planet: JavaOne. By "best conferences", I don't mean it has the best technical content - that award goes to NFJS, The Colorado Software Summit and The Spring Experience.
JavaOne has the best networking opportunities. Of all the conference-goers I know, most of them will be at JavaOne.
I'm flying into San Francisco on Monday, driving to Mountain View to work for a few hours, playing in the company's weekly softball game, then heading back to downtown San Francisco for the networking. Tuesday through Thursday, I plan on doing the same thing: commuting to Mountain View during the day, returning to JavaOne for the parties. I have a free blogger pass, so I could attend sessions, but networking seems more important. If there's any good BOFs at night, I may attend those.
So where and where are the good parties at JavaOne 2008? Here's what I know about so far - I'll add to this list as comments start flowing in:
I don't have details on the JBoss party, but I did receive an e-mail about it. Since my flight leaves before the party starts, I must've deleted it.
When and where is the Java Bloggers Meetup? What about the Solarmetric/Tangosol party? Is it now the SpringSource/BEA/Oracle party?
See y'all next week - I hope the networking opportunities are better than ever.
Related: JavaOne 2004, JavaOne 2005 and JavaOne 2006.