Matt RaibleMatt Raible is a Web Developer and Java Champion. 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.

E-Mail Notification of Comments

I requested a new feature today for Roller - the ability to receive e-mail notification when comments have been posted. I mentioned this wouldn't be too hard using the mailer tag library. So I got slightly motivated and did it myself. I think to add it to Roller, we should make it a little more configurable, but here's what I added above the form in weblog/comment-form.jspf:

... define mailer and c taglibs of course ...

<c:if test="$\{param.method == 'update'\}">
    <mt:mail server="smtp.domain.com">
        <mt:setrecipient type="to">[email protected]</mt:setrecipient>
        <mt:from><c:out value="${param.email}"/></mt:from>
        <mt:subject>Comment: <bean:write name="blogEntry" 
property="title" scope="request" /></mt:subject>
        <mt:message><c:out value="${param.content}"/>

<c:out value="${param.name}"/>
<c:out value="${param.url}"/>
        </mt:message>
        <mt:send>
            Doh! An error has occurred sending comments notification!<br />
            <mt:error id="err">
                <jsp:getProperty name="err" property="error"/>
            </mt:error>
        </mt:send>
    </mt:mail>
</c:if>

I had to put those \'s in their in order to get past Velocity. The one pain with the mailer tag library is everything comes through with the spacing as set in the JSP. That's why the name and url variables are squished all the way over to the left.

Posted in Java at Dec 13 2002, 07:21:56 AM MST 2 Comments
Comments:

Wouldn't it be better to do this in the CommentAction? Also, one of the configuration parameters should be to turn it off. While I'd love to have comments mailed to me, I don't have a mail server available to my installation (though I really should fix that). So did this get emailed to you?

Posted by Lance on December 13, 2002 at 08:46 AM MST #

Oh definitely, this was just a quick fix to enable the feature. It's definitely got issues - the from address needs to have a default and there was some character issues in the e-mail I received. And I just realized another problem, when I post this comment, it'll send comment to me. We should have a way to turn off comments when from and to are the same, or something like that.

Posted by Matt Raible on December 13, 2002 at 09:07 AM MST #

Post a Comment:
Comments are closed for this entry.