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 "struts". 749 entries found.

You can also try this same search on Google.

Monday Morning Mayhem

My Inbox was attacked over the weekend with all kinds of good links and fun stuff to post. So here it is:

  • LogWeb was released. A fully functional web interface for the runtime configuration of log4j within servlet containers and j2ee application servers. I won't use it, as I've never been inclined to change my logging configuration at run-time. And if I do need to change it, reloading my app isn't a big deal with Tomcat. Although, it might be nice to view your apps' configuration with this tool.
  • Mozilla and XUL for Cross-Platform User Interfaces, a Tutorial. Quick, easy and works with Mozilla Firebird. I did the examples.
  • StrutsDoc 0.3 was released. StrutsDoc is an Ant task that generates JavaDoc-like documentation from a Struts configuration file. StrutsDoc currently only supports the 1.1 version of Struts. [StrutsDoc Example] This might be helpful for documentation (a.k.a. impressing management) and bringing new developers up to speed.
  • Rowell has approved the use of his theme in Roller. I'll make sure and add a "designed by Rowell Sotto" to the bottom of the theme. Theme names are welcome. Currently, it's named "sotto."
  • Tomcat 5.0.5 Alpha was released. I'll comment here later today.

The best part of the day (so far)? My bike ride to work went from 1 1/2 hours (one-way) to 45 minutes - I just gained an hour and a half in every weekday!

Posted in Java at Jul 28 2003, 08:46:33 AM MDT 1 Comment

My Next Gig?

I don't know what my next gig will be yet, but my current one is about over. They gave us a roll off date of August 15th and it looks to be pretty firm. They're trying to get a budget approved until Q1 of next year, but it's a slow process and politics-oriented place. So if you know of anything in Denver, or via telecommuting, let me know. You can also check out my resume [MS Word - updated version]. Damn, I wish I had struts-resume done so I could use that. If I'm out of a gig on August 15th, that might be some good motivation to finish it.

Posted in Java at Jul 24 2003, 10:48:07 AM MDT Add a Comment

A RaibleLand Holiday: My Birthday

I was born on this day 29 years ago, at 4:30 in the morning. I was born at the cabin, with only my dad (who is a Navy man, not a doctor) to assist. I came out with my umbilical cord wrapped around my neck and my whole head was blue. This had to be quite a surprise for my parents, doing the home birth and all. My dad, always good at thinking fast, grabbed his hunting knife from his belt and sliced that puppy off in a split second. And that's why I'm here today.

Ever since I worked at eDeploy.com, where they gave us our birthday's off, I've continued to take the day off. So today, there will be none of this blog checking, e-mail reading nonsense (save for an early morning peak) - but rather a whole bunch of goofing off, playing with my favorite ladies, and possibly some indulgence into a few of my favorite savory Colorado microbrews.

Posted in General at Jul 16 2003, 07:32:51 AM MDT 4 Comments

Struts: How to use Indexed Properties

James Turner has written a short-n-sweet article on using indexed properties with DynaForms. Of course, you could use any ol' ActionForm, but you get the idea. If you're struggling with indexed properties in Struts, or you're just curious to know what they are, read this article (estimated time 5-10 minutes, 6 printed pages - mostly code).

Now if we could only convince James to use XHTML (lower case HTML, close your tags, etc.) in his examples. wink A big pet-peeve of mine is uppercase HTML - XHTML is lowercase and HTML works just the same with lowercase tag names/attributes. Here's to future compatibility!

Posted in Java at Jul 14 2003, 11:07:10 AM MDT 2 Comments

Changing Struts' bean:message to JSTL's fmt:message

I converted AppFuse to use JSTL's <fmt:message> tag instead of Struts' <bean:message> tags this morning. It was pretty easy. Here's the steps I took:

1. First, I added the following to metadata/web/seb-settings.xml:

<!-- Define the basename for a resource bundle for I18N -->
<context-param>
    <param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name>
    <param-value>ApplicationResources</param-value>
</context-param>

2. Then I added the format tag to web/common/taglibs.jsp:

<%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt" %>

3. Finally, I did find/replace with <bean:message/<fmt:message.

4. I also had to change my title and header keys in web/WEB-INF/tiles-config.xml to remove the . from the bean names. In other words, I converted title.key and heading.key to titleKey and headingKey and also made the appropriate changes in web/layouts/baseLayout.jsp.

Easy as Pie!

Posted in Java at Jul 10 2003, 07:59:29 AM MDT 35 Comments

[Denver JUG] The J2EE 1.4 Web Foundation: Servlets and JSPs

I'm sitting in the Qwest Auditorium right now, in the heart of downtown Denver. It's 7:20 p.m. and Sue Spielman is getting ready to launch her presentation on J2EE 1.4. There is a gentleman who is trying to start a JBoss Special Interest Group - if you live in Denver and are interested - send an e-mail to the DJUG mailing list. I've been here since 5:45 (after driving an hour from DTC) so this better be good. ;-) The Eclipse in Action speaker (David Gallardo) is coming to speak in October. In September, the author of AspectJ is coming in conjunction with Grady Booch. Never heard of him, but judging from the applause - I'm living under a rock.

On with the presentation. Sue thinks that J2EE 1.4 will be released towards the end of this year. Damn, I was hoping for the end of the summer.

What's new in Servlets 2.4?

1. Platform Requirements:

  • HTTP/1.1 - New static constants. HttpServletResponse.SC_FOUND to represent status code 302 instead of HttpSerlvetResponse.SC_MOVED_TEMPORARILY.
  • J2SE 1.3

2. DTD to XML Schemas:

  • Provides easier way to define element structure, element ordering structure is arbitrary under <web-app>
  • New elements in 2.4 XSD: <env-entry>, <resource-ref>, <resource-env-ref>, <jsp-config>

3. Complete event listener lifecycle:

  • New Request Events. Be aware that distributed containers handle listeners a bit different (1 instance per JVM).
    • ServletContext - manage, startup/shutdown, attribute changes
    • HttpSession - creation, invalidation, attribute changes, migration if sessions distributed
    • Request - request coming in or out of scope in a web component, attribute changes
  • javax.servlet.ServletRequestEvent, ServletRequestAttributeEvent
  • new interfaces ServletRequestListener, ServletRequestAttributeListener
  • SessionActivationListener is what you'd use for serializing sessions across a cluster

4. Filter enhancements:

  • Ability to configure filters to be invoked under request dispatcher. What does "under the Request Dispatcher mean?" It means that you can apply filters under RequestDispatcher forward() and include() calls. Defined in web.xml:
  • <dispatcher>REQUEST</dispatcher> and/or FORWARD, INCLUDE, ERROR (REQUEST was the only option in Servlets 2.3)
  • Example: if you have INCLUDE - a request doesn't invoke the filter, a forward doesn't invoke the filter, but an include would.

5. Enhancements for i18n:

  • Two new methods: setCharacterEncoding(String encoding) - do before getWriter() and getContentType().
  • <locale-encoding-mapping-list> - new element in the XSD to provide the deployer with the ability to assign locale-to-charset mappings outside servlet code.
<locale-encoding-mapping>
  <locale>en</locale>
  <encoding>en_US</encoding>
</locale-encoding-mapping>
  • Response encoding for English locales will default to US English (as opposed to the "other" English from Great Britain) ;-)

6. API Improvements added to the ServletRequest to help handle proxy servers: getLocalAddr(), getLocalName(), getLocalPort(), getRemotePort().

7. Other improvements:

  • Distributed sessions must throw an IllegalArgumentException if an object placed in the session can't be serialized
  • Relationship b/w session invalidate/timeout clarified (can now set zero or negative values in <session-timeout>)
  • Deprecation of Single ThreadModel (never used it - did you?)

8. Misc. Clarifications:

  • Welcome files can be servlets
  • Any library files exposed by the container apart from the WEB-INF structure must be loaded by the same classloader w/in any single JVM.
    • Examples include the JARs Tomcat loads from $CATALINA_HOME/shared/lib
    • This should help in avoiding potential ClassCastExceptions

As I expected, there still is now way to get the user's requested URL with container managed authentication. Damn.


JSP 2.0

1. Simplifies tag extension protocol

  • SimpleTag interface: doTag(), Tag attribute methods, NO scriplet code allowed
  • SimpleTagSupport class, implements SimpleTag, adds convenience methods: public JspFragment getJspBody(), public JspTag getParentTag()

2. Relationships: .tag file mechanism allows page authors to use JSP syntax to write custom actions

  • Use directive standard syntax: <%@ tag %> instead of <%@ page %>
  • JSP compiler generates custom action code (look in Tomcat's work directory)
  • Flexible packaging:
    • drop .tag file into WEB-INF/tags
    • implicit tag library generation
    • can still write a TLD if you want, or TLD in a JAR file

3. EL Functions: simple function invocations, defined in tag libraries, but it's a fair amount of work - like writing a TLD file and .java source file.

4. Expression Language:

  • . and [] operations access JavaBean properties and Collection elements
  • ${books.title}, ${books[title]}, ${books["JSTL Practical Guide"]}
  • Automatic type conversion
  • Ability to specify defaults (i.e. in case of null)
  • EL can access Cookies, request params, headers, scope variables and others

5. XML-based JSPs:

  • .jspx and .tagx for pure XML versions
  • no more <jsp:root> just use namespace: xmlns:jsp=http://www.sun.com/JSP/Page
  • For full list of XML features - see section 6.

JSTL (Java Standard Tag Library)

  • Over 42 standard custom actions available for common tasks needed by page authors
  • JSTL will become rev 1.1 in the J2EE 1.4 release

1. Core features:

  • Control flow: for each, conditionals
  • URL management: encoding, ftp, http
  • Formatting and i18n: date, time, numbers, locales
  • XML: transformations and XPath
  • Database support: queries, data sources, transactions
  • 4 custom action libraries: core, xml, i18n formatting, sql.

Man, Sue really knows her stuff. This was a very enjoyable presentation for me and I'm glad I came. Too bad JSPs can't be used as templates like Velocity - that would be sweet! Of course, I like Velocity and it is easy to use - but I've never implemented it from scratch. I do hope to in Moblogger and Struts Menu, but who knows when that will happen.

Update (7/17/2003): Presentation slides from this are now available for download:

  • July 9 - Basic Concepts: Scott Davis Apache Xerces - XML Parse (PowerPoint and samples)
  • July 9 - Main Speaker: Sue Spielman J2EE 1.4 Web Foundation (PowerPoint)

Posted in Java at Jul 09 2003, 11:15:44 PM MDT Add a Comment

Good Presos from TSS Symposium

I found a few good presentations in my Inbox today. I read them. Usually I don't. I enjoyed them, especially Mike's. I think WW2 looks promising, and I expect that I will try it soon. I predict that I will like it and I will be enthusiastic about it. Many hours will be lost exploring it's codebase and questioning it's authors. Julie will long for me to come to bed, but I will stay up and educate myself. This doesn't sound like any fun at the moment. So I will control my curiousity for another day. Hopefully I can control it for another month or year.

Posted in Java at Jul 08 2003, 04:20:44 PM MDT 3 Comments

[ANNOUNCE] Struts 1.1 Final Released!

The Struts team is proud, and extremely pleased, to announce the Final release of Struts 1.1. This release includes significant new functionality, as well as numerous fixes for bugs which were reported against the previous release, and supersedes the earlier 1.0.2 version as the latest official release of Struts from the Apache Software Foundation.

Download Binary | Download Source | JARs Only | Release Notes

test-all:                                                                                                               
                                                                                                                        
BUILD SUCCESSFUL                                                                                                        
Total time: 8 minutes 10 seconds                                                                                        
[minime:~/projects/appfuse] matt%   

Results look good!

Posted in Java at Jun 30 2003, 06:17:31 AM MDT Add a Comment

OWASP ~ The Open Web Application Security Project

I'm working on editing my Security Chapter (yet again) and I went to verify that a URL to http://www.owasp.org was still valid. There I found that they've developed an portal (based on Struts) with security as a REQUIREMENT, not an option.

OWASP

Several modules from the OWASP Common Library (OCL) are utilized as well ( OCL can be found in our CVS repository under the module name OCL ). Content is stored in XML format and translated with XSL.

Aside from the obvious need of a site for our own needs, the portal team has approached the design from the perspective that the OWASP portal should be more than a single use web application, but rather a reference implementation of a secure portal, that will rival the likes of any commercially available portal. We are striving to make the portal as extensible as possible, but yet deliver commonly needed feature sets. [http://beta.owasp.org]

Here's the best part: The portal that runs OWASP is open source and available for use in your own sites. Check out the release plan to see the planned and upcoming features for the next releases. It says it has RSS feeds, but I can't seem to find them.

Posted in Java at Jun 26 2003, 09:15:31 PM MDT Add a Comment

Wicked DHTML Roller themes spotted in the wild

I spotted some cool DHTML-enhanced themes on FreeRoller today: My own confusion and A Corporate Eejit. Nice work gents - maybe we should add these suckers to the stock list of themes. These themes are a great example of how customizable Roller is and how it's just HTML, so pretty much anything is possible (that is possible on a web page). I'd be willing to bet you could even use Flash and use the RSS Feed for your XML input.

I'm thinking about adding a small DHTML enhancement to Roller. Basically, I'd like to show users a small picture of the theme (using these pictures) when signing up. Let me know if you think this is worth the effort and if so, I'll create a JIRA issue (uh oh, looks like we lost our bug database!).

Posted in Roller at Jun 25 2003, 10:58:02 AM MDT 7 Comments