Showing posts with label http. Show all posts
Showing posts with label http. Show all posts

Monday, June 21, 2010

JQuery automatic linking

I have some values on my webpage, they are URLs and I have wrapped them in the form:


<span class="url">google.com</span>

<span class="url">http://lwn.net</span>

What I would like is to reneder anything that is of class 'url' as a link. And I would also like to stick a http:// infront of links that are currently missing them.

For this I use JQuery (I should get around to doing something sensible in the database as well but not just now).

So the JQuery looks like:
  $(".url:not(:contains('http://'))").prepend("http://");
  $(".url").each(function() {
    $(this) .replaceWith("" + $(this).text() + "");
   });

That's it.

Wednesday, November 4, 2009

basic http auth with Shiro in Grails

A quick note:

I found a blog nice simple recipe for basic http auth using Shiro in Grails. However, since this was published, JSecurity has been renamed Apache Shiro and so some minor changes need to be made at the end of the blog.

I posted them as a comment to that page but will repeat them here for good measure:

the last additions to Config.groovy when using Shiro should be:
security.shiro.filter.config = """
[filters]
authcBasic = org.apache.shiro.web.filter.authc.BasicHttpAuthenticationFilter
authcBasic.applicationName = Demo app name
 
[urls]
/rest/** = authcBasic
"""