Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #1 from garcia-jj/master

Merging blank project from vraptor core.
  • Loading branch information...
commit ad7a97daecd2ef2976dcf301d7798aac25d01659 2 parents b6cd78e + 3077e0a
@lucascs lucascs authored
View
44 vraptor-blank-project-scala/build.xml
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- ======================================================================
+ VRaptor 3 Blank Project Build
+ ====================================================================== -->
+<project name="VRaptor 3 Blank Project Build" default="update-jars" basedir=".">
+
+ <description>VRaptor 3 Blank Project module build</description>
+
+ <property file="../build.properties" />
+ <property file="${vraptor.core}/build.properties" />
+
+ <property name="vraptor.scala.jar" value="../vraptor-plugin-scala/target/vraptor-scala.jar"/>
+ <property name="webinf.lib.dir" value="src/main/webapp/WEB-INF/lib/"/>
+ <property name="lib.dir" value="lib"/>
+ <property name="scala.lib.dir" value="../vraptor-core/lib/scala/"/>
+ <property name="guice.lib.dir" value="../vraptor-core/lib/containers/guice/"/>
+ <target name="update-jars">
+ <mkdir dir="${webinf.lib.dir}"/>
+ <delete>
+ <fileset dir="${webinf.lib.dir}" includes="*.jar"/>
+ </delete>
+ <mkdir dir="${webinf.lib.dir}"/>
+ <delete>
+ <fileset dir="${webinf.lib.dir}" includes="*.jar"/>
+ </delete>
+ <copy todir="${webinf.lib.dir}">
+ <fileset dir="${mandatory.jars}">
+ <include name="*.jar"/>
+ <exclude name="objenesis*.jar"/>
+ </fileset>
+ <fileset dir="${optional.jars}/iogi" includes="*.jar"/>
+ <fileset dir="${container.jars}" includes="*.jar"/>
+ <fileset dir="${scala.lib.dir}" includes="*.jar"/>
+ <fileset dir="${guice.lib.dir}" includes="guice-snapshot.jar"/>
+ </copy>
+ <copy todir="${webinf.lib.dir}" file="${vraptor.jar}" />
+ <copy todir="${webinf.lib.dir}" file="${vraptor.scala.jar}"/>
+ <copy todir="${lib.dir}" file="${vraptor.scala.jar}"/>
+ </target>
+
+ <target name="clean" description="--> delete build artifacts">
+ <delete file="${zip_file}" failonerror="false"/>
+ </target>
+</project>
View
59 vraptor-blank-project-scala/build.xml.example
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- ======================================================================
+ Project Name
+ Description
+ ====================================================================== -->
+
+<project name="project-name" default="compile">
+
+ <!-- =================================
+ build configuration
+ ================================= -->
+ <property name="src.dir" value="src/" />
+ <property name="lib.dir" value="WebContent/WEB-INF/lib/" />
+ <property name="compile.dir" value="WebContent/WEB-INF/classes/" />
+ <property name="scala.home" value="WebContent/WEB-INF/" />
+ <property name="scala-compiler.jar" value="${scala.home}/lib/scala-compiler.jar" />
+ <property name="scala-library.jar" value="${scala.home}/lib/scala-library.jar" />
+
+ <path id="scala.classpath">
+ <pathelement location="${scala-compiler.jar}" />
+ <pathelement location="${scala-library.jar}" />
+ </path>
+
+ <path id="project.classpath">
+ <path refid="scala.classpath" />
+ <pathelement location="${compile.dir}" />
+ <fileset dir="${lib.dir}">
+ <include name="**/*.jar" />
+ </fileset>
+ <fileset dir="${compile.dir}">
+ <include name="**/*.class" />
+ </fileset>
+ </path>
+
+ <taskdef resource="scala/tools/ant/antlib.xml">
+ <classpath refid="scala.classpath" />
+ </taskdef>
+
+
+ <!-- =================================
+ target: compile
+ ================================= -->
+ <target name="compile" description="compile source classes">
+ <mkdir dir="${compile.dir}" />
+ <scalac srcdir="${src.dir}" destdir="${compile.dir}" classpathref="project.classpath">
+ <include name="**/*.scala" />
+ </scalac>
+ </target>
+
+
+ <!-- =================================
+ target: clean
+ ================================= -->
+ <target name="clean" description="compile test classes">
+ <delete dir="${compile.dir}" />
+ </target>
+
+</project>
View
35 vraptor-blank-project-scala/classpath-example
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="con" path="org.scala-ide.sdt.launching.SCALA_CONTAINER"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="lib" path="WebContent/WEB-INF/lib/aopalliance.jar"/>
+ <classpathentry kind="lib" path="WebContent/WEB-INF/lib/aspectjrt.jar"/>
+ <classpathentry kind="lib" path="WebContent/WEB-INF/lib/cglib-nodep-2.1_3.jar"/>
+ <classpathentry kind="lib" path="WebContent/WEB-INF/lib/commons-logging.jar"/>
+ <classpathentry kind="lib" path="WebContent/WEB-INF/lib/google-collect-1.0.jar"/>
+ <classpathentry kind="lib" path="WebContent/WEB-INF/lib/javassist-3.9.0.GA.jar"/>
+ <classpathentry kind="lib" path="WebContent/WEB-INF/lib/jstl-api-1.2.jar"/>
+ <classpathentry kind="lib" path="WebContent/WEB-INF/lib/jstl-impl-1.2.jar"/>
+ <classpathentry kind="lib" path="WebContent/WEB-INF/lib/log4j-1.2.15.jar"/>
+ <classpathentry kind="lib" path="WebContent/WEB-INF/lib/mirror-1.5.1.jar"/>
+ <classpathentry kind="lib" path="WebContent/WEB-INF/lib/ognl-2.7.3.jar"/>
+ <classpathentry kind="lib" path="WebContent/WEB-INF/lib/org.springframework.aop-3.0.0.RELEASE.jar"/>
+ <classpathentry kind="lib" path="WebContent/WEB-INF/lib/org.springframework.asm-3.0.0.RELEASE.jar"/>
+ <classpathentry kind="lib" path="WebContent/WEB-INF/lib/org.springframework.aspects-3.0.0.RELEASE.jar"/>
+ <classpathentry kind="lib" path="WebContent/WEB-INF/lib/org.springframework.beans-3.0.0.RELEASE.jar"/>
+ <classpathentry kind="lib" path="WebContent/WEB-INF/lib/org.springframework.context-3.0.0.RELEASE.jar"/>
+ <classpathentry kind="lib" path="WebContent/WEB-INF/lib/org.springframework.core-3.0.0.RELEASE.jar"/>
+ <classpathentry kind="lib" path="WebContent/WEB-INF/lib/org.springframework.expression-3.0.0.RELEASE.jar"/>
+ <classpathentry kind="lib" path="WebContent/WEB-INF/lib/org.springframework.web-3.0.0.RELEASE.jar"/>
+ <classpathentry kind="lib" path="WebContent/WEB-INF/lib/paranamer-2.2.jar"/>
+ <classpathentry kind="lib" path="WebContent/WEB-INF/lib/scala-compiler.jar"/>
+ <classpathentry kind="lib" path="WebContent/WEB-INF/lib/scala-library.jar"/>
+ <classpathentry kind="lib" path="WebContent/WEB-INF/lib/scalate-core-1.2.jar"/>
+ <classpathentry kind="lib" path="WebContent/WEB-INF/lib/slf4j-api-1.6.1.jar"/>
+ <classpathentry kind="lib" path="WebContent/WEB-INF/lib/slf4j-log4j12-1.6.1.jar"/>
+ <classpathentry kind="lib" path="WebContent/WEB-INF/lib/vraptor-3.2.0-SNAPSHOT.jar"/>
+ <classpathentry kind="lib" path="WebContent/WEB-INF/lib/vraptor-scala.jar"/>
+ <classpathentry kind="lib" path="WebContent/WEB-INF/lib/xstream-1.3.1.jar"/>
+ <classpathentry kind="output" path="WebContent/WEB-INF/classes"/>
+</classpath>
View
18 vraptor-blank-project-scala/project-example
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>vraptor-blank-project-scala</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.scala-ide.sdt.core.scalabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.scala-ide.sdt.core.scalanature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
View
8 vraptor-blank-project-scala/project/build.properties
@@ -0,0 +1,8 @@
+#Project properties
+#Fri Apr 01 14:06:07 BRT 2011
+project.organization=caelum
+project.name=vraptor blank project scala
+sbt.version=0.7.4
+project.version=1.0
+build.scala.versions=2.8.1
+project.initialize=false
View
17 vraptor-blank-project-scala/project/build/VRaptorProject.scala
@@ -0,0 +1,17 @@
+import sbt._
+
+class VRaptorProject(info:ProjectInfo) extends DefaultWebProject(info) {
+ val mavensnapshots= "snaps" at "https://oss.sonatype.org/content/repositories/snapshots"
+
+ val vraptor = "br.com.caelum" % "vraptor" % "3.3.2-SNAPSHOT" % "compile"
+ val scalate = "org.fusesource.scalate" % "scalate-core" % "1.4.1" % "compile"
+ val servlet = "org.mortbay.jetty" % "servlet-api-2.5" % "6.1.14" % "compile"
+ val jetty6 = "org.mortbay.jetty" % "jetty" % "6.1.22" % "test"
+ val jsp = "org.mortbay.jetty" % "jsp-2.1" % "6.1.14" % "test"
+
+ override def mainCompilePath = webappPath / "WEB-INF" / "classes"
+ override def scanDirectories = mainCompilePath :: testCompilePath :: Nil
+
+ override def jettyWebappPath = webappPath
+
+}
View
32 vraptor-blank-project-scala/src/main/resources/log4j.xml
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/">
+
+ <appender name="stdout" class="org.apache.log4j.ConsoleAppender">
+ <layout class="org.apache.log4j.PatternLayout">
+ <param name="ConversionPattern"
+ value="%d{HH:mm:ss,SSS} %5p [%-20c{1}] %m%n"/>
+ </layout>
+ </appender>
+
+ <category name="org.vraptor">
+ <priority value="INFO" />
+ <appender-ref ref="stdout" />
+ </category>
+
+ <category name="com.thoughtworks">
+ <priority value="INFO" />
+ <appender-ref ref="stdout" />
+ </category>
+
+ <category name="br.com.caelum.vraptor">
+ <priority value="DEBUG" />
+ <appender-ref ref="stdout" />
+ </category>
+
+ <category name="org.springframework">
+ <priority value="INFO" />
+ <appender-ref ref="stdout" />
+ </category>
+
+</log4j:configuration>
View
21 vraptor-blank-project-scala/src/main/scala/br/com/caelum/vraptor/scala/IndexController.scala
@@ -0,0 +1,21 @@
+package br.com.caelum.vraptor.scala
+import br.com.caelum.vraptor.{Path, Get, Post, Resource};
+
+/*
+ * A simple example controller.
+ */
+@Resource
+class IndexController {
+
+ @Get @Path(Array("/"))
+ def index = MyModel("It works!")
+
+ @Post @Path(Array("/"))
+ def index(myModel:MyModel) = myModel
+
+ @Get @Path(Array("/jsp"))
+ def jsp = MyModel("It works with JSP too!")
+
+ @Get @Path(Array("/list"))
+ def list = List("It", "works", "with", "lists")
+}
View
10 vraptor-blank-project-scala/src/main/scala/br/com/caelum/vraptor/scala/MyModel.scala
@@ -0,0 +1,10 @@
+package br.com.caelum.vraptor.scala
+
+import scala.reflect.BeanProperty
+
+/*
+ * A simple example model.
+ * The @BeanProperty annotation is only required if this class
+ * is used at JSP view files.
+ */
+case class MyModel(@BeanProperty data:String)
View
8 vraptor-blank-project-scala/src/main/webapp/WEB-INF/jsp/index/jsp.jsp
@@ -0,0 +1,8 @@
+<html>
+<head>
+<title>VRaptor + Scala (JSP View)</title>
+</head>
+<body>
+${myModel.data}
+</body>
+</html>
View
1  vraptor-blank-project-scala/src/main/webapp/WEB-INF/lib
View
17 vraptor-blank-project-scala/src/main/webapp/WEB-INF/ssp/index/index.ssp
@@ -0,0 +1,17 @@
+<html>
+<head>
+<title>VRaptor + Scala (SSP View)</title>
+</head>
+<body>
+<%@ val myModel : br.com.caelum.vraptor.scala.MyModel %>
+${myModel.data}
+
+<br />
+
+<form action="." method="post">
+ <label for="field">Type anything here:</label>
+ <input type="text" id="field" name="myModel.data" value="test" />
+ <input type="submit" />
+</form>
+</body>
+</html>
View
17 vraptor-blank-project-scala/src/main/webapp/WEB-INF/ssp/index/list.ssp
@@ -0,0 +1,17 @@
+<html>
+<head>
+<title>VRaptor + Scala (List Example)</teste>
+</head>
+<body>
+<%@ val stringList : List[String] %>
+
+<ul>
+#for (each <- stringList)
+ <li>${each}</li>
+#end
+</ul>
+
+
+</ul>
+</body>
+</html>
View
52 vraptor-blank-project-scala/src/main/webapp/WEB-INF/web.xml
@@ -0,0 +1,52 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
+ id="WebApp_ID" version="2.5">
+ <display-name>vraptor-blank-project</display-name>
+
+ <!--
+ VRaptor will scan classpath for all @Component and
+ @Resource inside WEB-INF/classes
+
+ If you want to load them also from WEB-INF/lib/ jars,
+ you need to specify from which packages they will
+ be loaded, comma separated:
+ -->
+
+ <context-param>
+ <param-name>br.com.caelum.vraptor.packages</param-name>
+ <param-value>br.com.caelum.vraptor.scala,br.com.caelum.vraptor.http.iogi</param-value>
+ </context-param>
+
+ <!--
+ if you are using a servlet 3.0 container
+ as glassfish 3 or jetty 8, you dont need this
+ filter configuration
+ -->
+
+
+ <filter>
+ <filter-name>vraptor</filter-name>
+ <filter-class>br.com.caelum.vraptor.VRaptor</filter-class>
+ </filter>
+
+ <filter-mapping>
+ <filter-name>vraptor</filter-name>
+ <url-pattern>/*</url-pattern>
+ <dispatcher>FORWARD</dispatcher>
+ <dispatcher>REQUEST</dispatcher>
+ </filter-mapping>
+
+ <!-- START: SSP config -->
+ <servlet>
+ <servlet-name>TemplateEngineServlet</servlet-name>
+ <servlet-class>org.fusesource.scalate.servlet.TemplateEngineServlet</servlet-class>
+ <load-on-startup>1</load-on-startup>
+ </servlet>
+
+ <servlet-mapping>
+ <servlet-name>TemplateEngineServlet</servlet-name>
+ <url-pattern>*.ssp</url-pattern>
+ </servlet-mapping>
+</web-app>
Please sign in to comment.
Something went wrong with that request. Please try again.