Monthly Archives: November 2013

Flicker Image Search API Demo



<script src=""></script>
<title>Flicker Image Search API Demo</title>
Search for <b>girls, dogs, cakes</b> ...etc)
<br />
<input id="searchterm" />
<button id="search">search</button>
<div id="results"></div>
tags: $("#searchterm").val(),
format: "json"
function(data) {
$.each(data.items, function(i,item){
if ( i == 10 ) return false;
Leave a comment

Posted by on November 23, 2013 in JavaScript, jQuery


Tags: ,

How to access Session Bean from JSP in GlassFish

Using Session Bean in JSP differs from the usage in servlets. We can inject session bean in servlets or in another session bean. But in JSP we can not use EJB in the same way. Most common approach would be a JNDI lookup to  find the required bean.

First add a reference in deployment descriptor to the session bean.


is optional.

In JSP use JNDI lookup to find the resource.

String prefix = "java:comp/env/";
String ejbRefName = "AccountTypeFacadeRef";
String jndiUrl = prefix + ejbRefName;

javax.naming.Context ctx = new javax.naming.InitialContext();
AccountTypeFacade atf = ( AccountTypeFacade ) ctx.lookup( jndiUrl );
List<AccountType> accountTypeList = atf.findAll();


Leave a comment

Posted by on November 9, 2013 in J2EE


Tags: ,