Colors that hurt
This java.blog seems to have some good content, but the author's use of colors hurts my eyes. It it worth reading when it causes pain?
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 java.blog seems to have some good content, but the author's use of colors hurts my eyes. It it worth reading when it causes pain?
From Matt Croydon:
The Phoenix Tips and Tricks site is a must-visit if you're running Phoenix. The page rendering speedup makes zippy Phoenix even zippier.
I'll visit when I have more time, looks cool!
The latest release of Naples (formely known as Phoenix) has now been released. I liked the name Phoenix better than Naples - what are the developers trying to imply? Life is better in Arizona or Florida? Downloading now...
This release features the ability to have multiple homepages and support for five-button mice, and fixes a number of bugs that plagued earlier releases. It is also the smallest and fastest Phoenix to date.
Oh yeah - it's faster all right!
Well after working until 4 in the morning last night and most of the day today - I'm happy to say that I've completed my desired changes on Struts Menu. I've been talking with the inventor, Scott Sayles, and hopefully I can get these changes committed in the next day or so. The biggest improvements I made were adding new Displayers - one for CoolMenus (CoolMenu4) and one for DHTML Lists (ListMenu). I also added support for a roles attribute (comma-delimited) that will hide menus when users are not in that role. Of course, you will have to use container-managed security for that to work, but it's easy - right? I'm thinking we should probably add a denyRoles attribute as well, as its a pain to add 5 roles just to exclude 1.
The problems I ran into with CoolMenus4 seem to be CSS related, and the Dropdown DHTML List is a little funky when you have too many nested items. Please feel free to dig in and fix these -> should be easy using good ol' view-source copying some files locally if you like. I can also post the source if you'd like, but I think you're more interested in just a demo.
Click here for a demo (expires on 12-15-02), or download the source.
The coolest thing about this bad-ass menuing system is that you can choose a new type of menu just by changing your JSP. Of course, a little magic and you can do it based on request variables or something of the sort. Check out the permissions page for an example.
The sweetest improvement I can think of is to now make the menu-config.xml file editable through a browser - and it'll save the results for you. Even sweeter - if you're really nuts - have this UI talk to struts-config and allow you to select forwards for locations! I could dig in and work on this thing for a week - but alas, I have a chapter to write! Too bad I'm only halfway done and it's due tomorrow :-( Oh well, at least the chapter will demonstrate some good code!
This post on Why are people so down on Struts probably deserves an immediate rebuttle, but I'm too tired and have better things to do. The best reason I can say that I like it - it's paying the bills. Show me a better framework and a contract that wants to use it, and I'll be all over it like a monkey f**in' a football. ;-)
So you ask, what "better things" do you have to do. Well, there are many things better than pounding on this keyboard (i.e. playing with Abbie, loving my wife), however, I'm a sad sob and I'll be here all night. I'm planning on digging into struts-menu and 1) upgrading it to CoolMenus4 and 2) configuring it to allow lists for DHTML menus. Then I have to make sure both methods allow for permission checking, since I want to use struts-menu to display url-hiding security in my chapter. Wish me luck - and feel free to help if you want to get your hands dirty!
Jeff Duska has a post tonight on how he handles app-specific configuration settings. His method sounds pretty neat, and hopefully we can combine our methods to come up with a better solution. Here's how I've been doing it.
Jeff's method seems make it easier to retrieve the values, but not to set them. I have a getConfiguration() method in my BaseAction class that I use to get my configuration data:
/**
* Get the Configuration object from the servlet context
*/
public Configuration getConfiguration(){
return (Configuration) servlet.getServletContext().getAttribute(
Constants.CONFIGURATION);
}
The obvious problem with this is that only subclasses of BaseAction can get the configuration information - therefore, I like Jeff's idea better. However, I'm curious to know how he populates his Registry class. Castor makes it pretty damn easy. Here's the method I use in StartupServlet, where obj is my JavaBean, and xmlFilePath is configured as "/WEB-INF/app-config.xml" in one of StartupServlet's init-parameters.
/**
* Load our application configuration XML file.
*
* @exception Exception if any problem occurs while loading
*/
private synchronized Object loadConfig
(
Object obj,
String xmlFilePath
)
throws Exception {
// attempt to extract the filename, using system file separator
int index = xmlFilePath.lastIndexOf(Constants.FILE_SEP);
// no system file separator found in configuration setting
if (index == -1) {
// check traditional file separator as used in web app URI's
index = xmlFilePath.lastIndexOf("/");
// still no separator, maybe they're just specifying the filename
if (index == -1) {
index = 0;
}
}
String xmlFileName =
xmlFilePath.substring(index + 1, xmlFilePath.length());
if (logger.isDebugEnabled()) {
logger.debug("Looking for '" + xmlFileName + "' in "
+ Constants.USER_HOME);
}
// Acquire an input stream to our configuration file
InputStream is = null;
try {
is = new FileInputStream(Constants.USER_HOME + xmlFileName);
} catch (FileNotFoundException fnf) {
// No file found in user.home
if (logger.isDebugEnabled()) {
logger.debug("File not found at " + Constants.USER_HOME
+ xmlFileName + " - looking at specified path in web.xml.");
}
// Look for config.xml in WEB-INF
is = getServletContext().getResourceAsStream(xmlFilePath);
if (is == null) {
throw new Exception("Configuration file '"
+ xmlFileName + "' not found in '"
+ Constants.USER_HOME + "', nor at '" + xmlFilePath + "'");
}
}
InputStreamReader reader = new InputStreamReader(is);
// Marshal the configuration object
obj = Unmarshaller.unmarshal(obj.getClass(), reader);
// close the InputStream, and the reader
is.close();
reader.close();
return obj;
}
I like this method because it can load multiple configuration files, and I already have it written - so the hard part is over ;-) It also makes it easy to configure your app outside of WEB-INF, and changes won't be overwritten when a user upgrades their WAR file or whatnot. I suppose I could use Jeff's method and make my JavaBean into a Singleton and not store it in ServletContext - that'll probably work better than my current scenario.
I've decided to rename struts-xdoclet to AppFuse! Why? Because 1) it's easier to say, 2) it's a more descriptive name, and 3) it's the fuse to get your app started! I'll be checking it into SourceForge's Struts project soon, and will post more information then.
I've been thinking about my sample app for the Struts Chapter and I'd like to develop something that's useful. I doubt I'll have the time to pull it off, but I'd like to develop a resume builder/viewer app. I think it'd be a great way to demonstrate CRUD with Struts with skills and such. It could even be an application that would support multiple users, where skills can be shared and selected. I've been thinking about doing something like this for a while. It's a pain to update my resume right now because there's 4 different versions - online JSP, downloadable HTML, Word and Text. I've often thought about just creating an XML version and using JSTL to to XSL transformations into HTML, Text, RTF and PDF. I wonder if this XML resume project at SourceForge could help? I'd love to create an app that allows you to easily update your resume and can publish it in all these different formats. Even better, if it could be resume-standards-compliant (i.e. DTD or XSD) and allow users to select/upload/use different styles. I think this would take much of the headache out of online resume publishing. However, I'd probably spend more time tweaking it than I would just updating the 4 different versions of my resume. It'd kinda like this website, I chose to use Roller as my re-design engine because it was quick and easy - and now I spend a couple hours each day tweaking and updating. I could've redesigned for a lot cheaper! Of course, new content == hits.
The only problems I can foresee with this app (so far) are Old Man Time and that it might be a maintenance nightmare. I would suspect a lot of folks might want import/export to/from existing formats. Thoughts? Comments?
Gizmodo tells us about another sweet deal today.
Viking 512MB CompactFlash memory cards are now just $131.44 after rebate at Amazon. Remember when these used to cost hundreds and hundreds of dollars?
What a bargain! Why would you shop anywhere else when Amazon has all these sweet deals lately!? The best part is I'm actually in the market for a new CF card. Our Canon PowerShot G2 (which I highly recommend) came with a 32MB card, which holds about 26 photos or so. With a 512MB card, you could probably take ~400 photos - now that's a role of film! We're hoping to get a Photo Printer soon (I've been looking at Canon's s900), then we'll never have to get our film developed again!
I posted some new pictures on our photo album site this evening. These are from the last couple of weeks when we've had a whole slew of family and friends drop in to see us. Our little girl is growing up rather quickly, and still cute as a button!
I'm writing about how to use the same login/error page with form-based authentication. Does anyone know which servlet containers this fails on? I guess it wouldn't hurt to know which ones it works on too. You can use this security.war (1.7MB) file to test. Since it's testing the failure page, you don't need to setup a user - but if you want, the role is tomcat. I know this works on Tomcat, so no need to test it.