About the Authors

Josh Juneau has been a software developer since the mid-1990s. He graduated from Northern Illinois University with a degree in Computer Science. His career began as an Oracle database administrator which later led into PL SQL development and database programming. Josh began to use Java along with PL SQL for developing web applications, and later shifted to Java as a primary base for application development. Josh has worked with Java in the form of web, GUI, and command-line programming for...

Bonus The Admin

This is an intermission during our tour through the main architectural points of a Django project (namely, models, views, and templates), but it is a very nice intermission. The code for the administrative interface we talked about a couple of paragraphs back will consist on less than 20 lines of code First, let's enable the admin app. To do this, edit pollsite settings.py and add 'django.contrib.admin' to the INSTALLED_APPS. Then edit pollsite urls.py, which looks like Listing 1410. Listing...

Example Jython Servlet Application for App Engine

The next piece of the puzzle is the code for our application. In this example, we'll make use of a simple servlet that displays some text as well as the same example that was used in Chapter 13 with JSP and Jython. The following code sets up three Jython servlets. The first servlet simply displays some output, the next two perform some mathematical logic, and then there is a JSP to display the results for the mathematical servlets. from javax.servlet.http import HttpServlet from...

Using Nose on Hudson

You may be wondering why we crafted a custom-built script instead of using Nose, because we stated that using Nose was much better than manually creating suites. The problem is that the Jython runtime provided by the Jython Hudson plug-in comes without any extra library, so we can't assume the existence of Nose. One option would be to include Nose with the source tree on the repository, but it is not convenient. One way to overcome the problem is to script the installation of Nose on the build...

Working With a Project

The Google App Engine provides project templates to get you started developing using the correct directory structure. Eclipse has a plug-in that makes it easy to generate Google App Engine projects and deploy them to the App Engine. if interested in making use of the plug-in, please visit to read more information and download the plug-in. Similarly, Netbeans has an App Engine plug-in that is available on the Kenai site appropriately named nbappengine In this text we will cover the use of...

Deploying a Single JAR

In order to deploy an application to the Java Warehouse, it must be packaged as a single JAR file. We've already discussed packaging Jython applications into a JAR file using the Jython standalone method in Chapter 13. In this section, you will learn how to make use of the One-JAR http one-jar.sourceforge.net product to distribute client-based Jython applications. In order to get started, you will need to grab a copy of One-JAR. There are a few options available on the download site, but for...

Read an Excel File

This Jython code will open and read an existing Excel file. Read an existing Excel file Book1.xls and show it on the screen from org.apache.poi.hssf.usermodel import from java.io import FilelnputStream Open an existing file and use HSSFWorkbook object to store it file H Book1.xls fis FilelnputStream file wb HSSFWorkbook fis Obtain reference to the first sheet in the workbook sheet wb.getSheetAt o rows sheet.getPhysicalNumberOfRows print wb, sheet, rows This trick ensures that we obtain the data...