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.

Roller Tips: Titles as Permalinks and Category Display

A few more tips for your Roller blog. You can edit your "_day" template to make your titles permalinks. I just added this feature to this site - try it now by clicking on this title for any post. To enable this feature, simply wrap your $entry.title element with a permalink URL. For example, change <b>$entry.title</b> to the following:

<a href="$baseURL/page/$userName?anchor=$entry.anchor" 
   style="font-style: bold; color: black">$entry.title</a>

Adjust the style as appropriate for your theme. The second tip is to add the ability for users to see the category you've posted to. Simply add the following under the $entry.title entry to display the category name in the top right corner of the post:

<span class="dateStamp" style="float: right">
    Category: $entry.category.name</span>

Again, the CSS for the span may depend on your theme. Lastly, if you click on a permalink for your blog and you're not routed to the specific entry you expect, for the love of God add the following before your $entry.title.

<a name="$entry.anchor" id="$entry.anchor"></a>

Posted in Roller at Dec 31 2003, 02:57:34 PM MST 7 Comments
Comments:

Infact, thanks to a tip from Sergio I used the $entry.category.name to display an icon for the relevent category.

Posted by Debashish on January 01, 2004 at 06:21 AM MST #

This may be kind of silly - but do you know how to retrieve the anchor part of the url in a jsp or servlet? I tried HttpServletRequest.getRequestURL(), but the "anchor" part is missing.

Posted by Will Gayther on January 01, 2004 at 09:55 PM MST #

Will, I believe that request.getQueryString() is what you're looking for.

Posted by Matt Raible on January 01, 2004 at 10:10 PM MST #

<p/>No, that really doesn't work. I want the anchor part - the part after the "#" sign. <p/>I made a simple jsp with one line: <%= request.getQueryString() %>
With a request url of "http://localhost:8080/testgeturl.jsp?bob=5&tom=4#someanchor"
The output is: bob=5&tom=4 <p/>Any other ideas? I assumed that perhaps the anchor wasn't sent with the html request...but obviously that isn't the case!

Posted by Will Gayther on January 01, 2004 at 11:02 PM MST #

Hmm, well, velocity runs under java, so it has to be in there somewhere, huh?

Posted by Will Gayther on January 04, 2004 at 11:43 PM MST #

To be honest, I don't have an answer for you. I just know that the anchor (everything after #) is recognized by browsers, but I don't know that there's any way to retrieve it using Java. You'd think it's possible, but I've never had a need to grab it.

Posted by Matt Raible on January 05, 2004 at 06:39 AM MST #

[Trackback] OK, so I've been hacking my template to pieces again, you will see some changes soon, but importantly for now, thanks to Matt Raible I have made the titles of each story their own permalink, as well as the little '#' down in the comments bar, which s...

Posted by Skip the Budgie on October 11, 2005 at 09:36 AM MDT #

Post a Comment:
  • HTML Syntax: Allowed