Hi list,

I'm trying to get a simple "hello world" Compojure application
running.   I attach both the clj file and maven pom.xml (using
NetBeans+Enclojure).  When I run (guestbook.core/-main), I get a blank
page in browser, no matter the URL.  What am I missing?

BTW, by "blank" I really mean blank.  If I view the page source in
Firefox, it's empty.

TIA,

-- 
Bahman Movaqar (http://BahmanM.com)
ERP Evaluation, Implementation & Deployment Consultant

PGP Key ID: 0x3750102D (keyserver2.pgp.com)

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd";>
    <properties>
        <clojure.version>1.2.0</clojure.version>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>
    <modelVersion>4.0.0</modelVersion>
    <version>0.0.1</version>
    <name>GuestBook</name>
    <description>GuestBook</description>
    <build>
        <sourceDirectory>src/main/clojure</sourceDirectory>
        <testSourceDirectory>src/test/clojure</testSourceDirectory>
        <resources>
            <resource>
                <directory>src/main/clojure</directory>
            </resource>
            <resource>
                <directory>src/main/resources</directory>
            </resource>
        </resources>
        <testResources>
            <testResource>
                <directory>src/test/clojure</directory>
            </testResource>
        </testResources>
        <plugins>
            <plugin>
                <groupId>com.theoryinpractise</groupId>
                <artifactId>clojure-maven-plugin</artifactId>
                <version>1.3.2</version>
                <configuration>
                    <sourceDirectories>
                        <sourceDirectory>src/main/clojure</sourceDirectory>
                    </sourceDirectories>
                    <clojureOptions>-Xmx1G</clojureOptions>
                </configuration>
                <executions>
                    <execution>
                        <id>compile-clojure</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>compile</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                    <encoding>${project.build.sourceEncoding}</encoding>
                    <showDeprecation>true</showDeprecation>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>2.2</version>
                <configuration>
                    <encoding>${project.build.sourceEncoding}</encoding>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <repositories>
        <repository>
            <id>central</id>
            <url>http://repo1.maven.org/maven2</url>
        </repository>
        <repository>
            <id>clojure-releases</id>
            <url>http://build.clojure.org/releases</url>
        </repository>
        <repository>
            <id>incanter</id>
            <url>http://repo.incanter.org</url>
        </repository>
        <repository>
            <id>clojure-snapshots</id>
            <url>http://build.clojure.org/snapshots</url>
        </repository>
        <repository>
            <id>clojars</id>
            <url>http://clojars.org/repo/</url>
        </repository>
    </repositories>
    <dependencies>
        <dependency>
            <groupId>org.clojure</groupId>
            <artifactId>clojure</artifactId>
            <version>${clojure.version}</version>
        </dependency>
        <dependency>
            <groupId>org.clojure</groupId>
            <artifactId>clojure-contrib</artifactId>
            <version>${clojure.version}</version>
        </dependency>
        <dependency>
            <groupId>swank-clojure</groupId>
            <artifactId>swank-clojure</artifactId>
            <version>1.2.1</version>
            <exclusions>
                <exclusion>
                    <groupId>org.clojure</groupId>
                    <artifactId>clojure</artifactId>
                </exclusion>
                <exclusion>
                    <groupId>org.clojure</groupId>
                    <artifactId>clojure-contrib</artifactId>
                </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>compojure</groupId>
            <artifactId>compojure</artifactId>
            <version>0.4.1</version>
        </dependency>
        <dependency>
            <groupId>ring</groupId>
            <artifactId>ring-jetty-adapter</artifactId>
            <version>0.2.6</version>
        </dependency>
    </dependencies>
    <groupId>guestbook</groupId>
    <artifactId>guestbook</artifactId>
</project>
(ns guestbook.core
 (:gen-class)
 (:use compojure.core)
 (:require [compojure.route :as route])
 (:require [ring.adapter.jetty :as jetty])
 (:require [ring.util.servlet :as servlet]))

(defroutes dispatcher
  (GET "/" [] "<h1>Hello, world</h1>")
  (route/not-found "<b>Requested resource not found</b>"))

(defn -main [& args]
  (jetty/run-jetty (servlet/servlet dispatcher) {:port 8080}))

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to