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 "form". 326 entries found.

You can also try this same search on Google.

Handling Time Consuming Requests

Domininic says, "I am try to find a good way to have an intermediate page load up while my Struts Action performs a large database query and then XSLT transformation." Ask and ye shall receive. I received the following e-mail from Alec Missine a while back. The attachment has a method of implementing a TCR. Let me know how it works as I haven't tried it myself.

----- Original Message -----
From: Alec Missine
To: struts-dev@jakarta.apache.org
Sent: Monday, January 07, 2002 3:59 PM
Subject: processing time consuming requests (was: wait page primer)


There's been some interest to the message I posted last month on the subject. The war file was too big though, so I compressed the stuff as much as I could. I also added some javadoc and UML diagrams.

The attached Struts-based application prototypes the wait page support for a time-consuming request (TCR). When a TCR (e.g., a database search) starts, the appropriate wait page is being sent to the browser after the request's ETC (Estimated Time to Complete) expires.

In the meantime, the corresponding action (the database search) is being started in the background thread on the server. If the default ETC is used (ad infinitum) or the action completes before the request's ETC expires, there is no wait page at all - the browser gets the result page right away, while the background thread is still busy closing the resources.

The wait page has javascript that polls the server to update the wait page with the TCR's progress. When the TCR completes, the wait page is being replaced with the appropriate result page.

This implementation has been tested on Apache Tomcat 4.0 with an Oracle 8.1.6 database as a data source. Presently, the application provides read-only access to all database tables for all database schemas through extensive use of the java.sql.DatabaseMetaData object. The next release will support insert/update/delete functionality.

Alec

Attachments: tcr.zip (114 KB)

Hope this helps!

Posted in Java at Nov 13 2002, 07:17:28 AM MST 6 Comments

Add a Google Search to your Site

I got the idea from Dave and now I've implemented it on this site. To add one to your site, copy and paste the following code and adjust the site URL accordingly. NOTE: This is the XHTML Strict version, if you want a Transitional version, view source on Dave's site.

<form id="searchForm" method="get" action="http://www.google.com/search"
 style="margin: 0; padding: 0" onsubmit="search()">  
   <input type="text" name="q" size="20" maxlength="255" 
       value="search this site" style="font-size: 11px"
       onfocus="this.value=''"  /> 
   <input type="submit" name="sa" value="go" 
       style="font-size: 11px; padding: 2px; line-height: 1" />
</form>

<script type="text/javascript">
<!--
function search() {
    form = document.getElementById('searchForm');
    form.q.value = form.q.value + " site:www.raibledesigns.com";
    form.submit();
}
//-->
</script>

Posted in Roller at Nov 10 2002, 07:45:42 AM MST Add a Comment

Everyone wants a Mac

Apple Powerbook Greg tried to download an x86 version (I did this about a year ago and got Darwin installed before I realized you couldn't run OS X on x86), James wants one with a cinema display and even Gerhard longs for one.

Well I was lucky enough to buy one last Christmas. I got a 667 Mhz Powerbook with a gig o' RAM. I wanted a laptop for traveling to client sites and this seemed like the best laptop at the time. So 10 months later, you ask, "Was it worth it?" Yes and no.

  • Yes: It's great to have OS X and I don't long for a Mac anymore.
  • No: I hardly ever use it except for testing and surfing, not much development.
  • Yes: My boss bought it for me as a Christmas bonus last year, so the expense was easier to justify.
  • No: It doesn't give me much over Windows XP with Cygwin and Red Hat - they (seem to) both have Unix cores and my Win XP install seems to be just as stable as OS X.
  • Yes: My client uses Macs for all their video-production and website-viewing. I can test their product on the Mac (with Mac browsers) before I release it. This is the #1 benefit to having the machine and it's paid for itself because of this.
  • No: The screen resolution is fixed to 1152 x 768 and I'd like it to go higher. I can change it to be higher when plugging it in to an external monitor. The new Titanium G4's go up to 1280 x 854. Most Windows laptops I've seen allow you to 1600 x 1200.
  • Yes: iSync rocks and it's great to sync with my T68i phone and have no wires.
  • No: I expected a fast laptop because megahertz don't matter on Macs. Yeah right, my Windows XP machine (1.5 Ghz) was a year older than the Mac and with half the RAM was still twice as fast. I've heard that this has more to do with OS X than the hardware.
  • No: I've used Windows most of my life and I'm much less productive when working on the Mac. I'm just slower, plain and simple, and that frustrates me to no end. I admit, this is my problem and not the Mac's, but it is a reason that I don't like it so much. Keyboard shortcuts have started to make my frustrations subside.
  • No: I expected Virtual PC to run on the Mac so I could get the "best of both worlds" running Windows and OS X on the same machine. However, it runs so damn slow that it's unusable. My 300 Mhz, 256 MB RAM old Compaq runs faster - and it takes 5 minutes to boot up!
  • Yes: People drool and it gives me buyer satisfaction.

I think if I used it more, I'd probably like it more and get faster at using it. However, with 5% of the market share, it doesn't get much love from the application vendors. And while Java runs great on the Mac, it's revisions are too far behind the other platforms. If you were on a project that wanted to upgrade to JDK 1.4, and use some new APIs in that version, you wouldn't be able to develop on your Mac for a year.

I too dream about the Cinema Display and my boss has been thinking about getting me one for my Christmas bonus, but is it work the money? $3500 for a fancy display you can brag to your friends and fellow bloggers about? Tough to justify, easy to buy. I have dual 19" monitors setup right now and they probably provide me the same function without the form.

Posted in Mac OS X at Nov 01 2002, 03:39:27 AM MST 1 Comment

Aqua Text.

I figured out how to make Aqua-style text this evening via this tutorial. Pretty cool stuff, but the Photoshop style that you download with the tutorial is designed for huge text and that's why my title on the aqua theme looks a little faded. It really looks excellent at 72pt font!

You might wonder why I've been working on this site and Roller so much lately? I've recently finished a 1.0 release of the software I've been working on the for the past 9 months. My client is now making a big push to sell it and I'm moving into maintenance mode for the next couple months (10-15 hours per week). A good idea on their part - to see what people like and don't like before adding new features. So I'm looking to pick up another 15-20 hours per week if anyone knows of anything.

In other site-enhancement news, I found that my contact form was not working to send me e-mail. So I fixed the JSP to work properly and added a sweet (I think) enhancement to the Contact page. Now when you submit the form, it submits it to an iframe that is 25px high and you never leave the page - you just get a success message. Try it, you might like it. BTW, for the JSP that sends e-mail, I use the mailer tag library - which makes it really easy.

Posted in General at Oct 10 2002, 02:27:11 PM MDT Add a Comment

Roller 0.9.6-rc2?

I did a bunch of work this morning to eliminate any and all javascript errors on the editor UI and also some XHTML-compliance stuff:

  • Now you should get focus set on the first form element in each form - a nice usability enhancement.
  • I adjusted the stylesheet for the editor UI to color links that had been visited from purple to a faded blue - looks a little better.
  • I changed the editor menu (the part with the blue background) to not change colors for links that had already been visited. I did this because these are the links you will visit all the time, and why change their color? It looks better this way, at least I think so. Wink
  • Updated the div id's used to render the expandable folders feature - so validation now succeeds.
  • Updated the index.jsp (list of user site's) page to be sortable. Good ol' display tag library has this built in!

Posted in Roller at Oct 09 2002, 05:09:30 AM MDT Add a Comment

Roller 0.9.6-rc1, Issue #1.

The web.xml file does not contain the tag library definitions. I verified this in both in this download and in CVS. It looks like the tablibs.xml file is missing actually :( BTW, there was a bug in the file that used to be there - it was referring to struts.tld and struts-form.tld which are both from Struts v0.5. I removed struts.tld on this site and replaced struts-form with struts-html.

Posted in Roller at Oct 08 2002, 05:52:46 AM MDT Add a Comment

Calling the blog-support Hotline.

I have a bunch of PDF's that I need to search for text values. Does anyone know of a package or set of utilities that will do this? Preferably open-source and cross-platform. However, I will accept any and all suggestions.

Posted in General at Oct 07 2002, 08:20:38 AM MDT Add a Comment

Upgrading Rampage.

I went on an upgrading rampage yesterday and ended the day with the worst feeling. My Struts 1.1b2 application appeared to work fine on most things, however, I kept getting the following error when I tried to submit a form with indexed input values:

java.lang.reflect.InvocationTargetException
 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 	at java.lang.reflect.Method.invoke(Method.java:324)
 	at org.apache.commons.beanutils.PropertyUtils.getIndexedProperty(PropertyUtils.java:475)
 	at org.apache.commons.beanutils.PropertyUtils.getIndexedProperty(PropertyUtils.java:410)
 	at org.apache.commons.beanutils.PropertyUtils.getNestedProperty(PropertyUtils.java:749)
 	at org.apache.commons.beanutils.PropertyUtils.getProperty(PropertyUtils.java:780)
...
Caused by: java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
 	at java.util.ArrayList.RangeCheck(ArrayList.java:508)
 	at java.util.ArrayList.get(ArrayList.java:320)
 	at com.onpoint.webapp.form.QuestionForm.getAnswer(QuestionForm.java:321)

The items I attempted to upgrade were:

After hours of banging my head against the wall for hours and even trying versions of my code from a week ago, I decided to try the "classic" compiler in Ant. Which I soon learned should now be named "modern." Whalla - it fixed the above problem! My advice - DON'T USE JIKES 1.16 to compile your Struts-based web app! I also found that switching to modern from jikes reduced my build process from 1 min 20 seconds to 50 seconds - I'm sold. my face after fixing this bug

I ended up not upgrading to Tomcat 4.1.12 (rather to 4.0.5) because I found that my error-pages were not being recognized. I hope that a client using the application never sees an error page, but if they do - I'd rather them see my pretty page vs. a stacktrace.

Posted in Java at Sep 25 2002, 06:12:06 AM MDT Add a Comment

Roller Polling.

I thought of a new feature I'd like to see in Roller. It'd be cool to post a poll for my readers. I'd love to ask you guys/gals your opinion of a few footer I'm creating. With the roller-poller ;), I could do something like the following:

Which beverage do you prefer?
Beer
Wine
Juice

Posted in Roller at Sep 11 2002, 08:39:49 AM MDT Add a Comment

Invalid Reference to Login Page.

If you're using form-based authentication in your Tomcat Application - you might've seen this error before:

Apache Tomcat/4.0.4 - HTTP Status 400 - Invalid direct reference to form login page

type: Status report

message: Invalid direct reference to form login page

description: The request sent by the client was syntactically incorrect (Invalid direct reference to form login page).

Well, the good news is - I figured out how to get around this today. Basically, it's caused when someone tried to go directly to your <form-login-page> to login, rather than a protected resource.

I use my index.jsp (welcome-file-list) page to do a redirect to a projected resource:

index.jsp
--------
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>

<logic:redirect page="/do/mainMenu"/%gt;

So I merely added the error-page declaration below to my web.xml, and whalla - no more error message!

<error-page>
<!-- 400 code is from trying to go directly to login.jsp -->
    <error-code>400</error-code>
    <location>/index.jsp</location>
</error-page>

Posted in Java at Aug 28 2002, 06:07:51 AM MDT 5 Comments