mirror of
https://github.com/ethauvin/rife2-hello.git
synced 2025-04-25 23:37:12 -07:00
Develop (#12)
* Updated to latest Gradle plugin. * Updated for better alignment across hello templates * Updated to RIFE 1.5.2 * Updated to RIFE 1.5.4
This commit is contained in:
parent
ed1cfc66db
commit
1209879005
6 changed files with 14 additions and 14 deletions
|
@ -68,7 +68,7 @@ java -javaagent:[path-to]/rife2-[version]-agent.jar -jar $JETTY_HOME/start.jar
|
|||
|
||||
|
||||
```bash
|
||||
./gradlew clean uberJar
|
||||
./gradlew clean uberjar
|
||||
```
|
||||
|
||||
Then run it with:
|
||||
|
|
|
@ -4,7 +4,7 @@ import com.uwyn.rife2.gradle.TemplateType.*
|
|||
|
||||
plugins {
|
||||
application
|
||||
id("com.uwyn.rife2") version "1.0.7"
|
||||
id("com.uwyn.rife2") version "1.0.8"
|
||||
`maven-publish`
|
||||
id("org.graalvm.buildtools.native") version "0.9.20"
|
||||
}
|
||||
|
@ -13,8 +13,8 @@ version = 1.0
|
|||
group = "com.example"
|
||||
|
||||
rife2 {
|
||||
version.set("1.4.0")
|
||||
uberMainClass.set("hello.AppUber")
|
||||
version.set("1.5.4")
|
||||
uberMainClass.set("hello.AppSiteUber")
|
||||
useAgent.set(true)
|
||||
precompiledTemplateTypes.add(HTML)
|
||||
}
|
||||
|
@ -36,12 +36,12 @@ repositories {
|
|||
}
|
||||
|
||||
dependencies {
|
||||
testImplementation("org.jsoup:jsoup:1.15.3")
|
||||
testImplementation("org.junit.jupiter:junit-jupiter:5.9.1")
|
||||
testImplementation("org.jsoup:jsoup:1.15.4")
|
||||
testImplementation("org.junit.jupiter:junit-jupiter:5.9.2")
|
||||
}
|
||||
|
||||
application {
|
||||
mainClass.set("hello.App")
|
||||
mainClass.set("hello.AppSite")
|
||||
}
|
||||
|
||||
tasks {
|
||||
|
|
|
@ -2,7 +2,7 @@ package hello;
|
|||
|
||||
import rife.engine.*;
|
||||
|
||||
public class App extends Site {
|
||||
public class AppSite extends Site {
|
||||
public void setup() {
|
||||
var hello = get("/hello", c -> c.print(c.template("hello")));
|
||||
get("/", c -> c.redirect(hello));
|
||||
|
@ -11,6 +11,6 @@ public class App extends Site {
|
|||
public static void main(String[] args) {
|
||||
new Server()
|
||||
.staticResourceBase("src/main/webapp")
|
||||
.start(new App());
|
||||
.start(new AppSite());
|
||||
}
|
||||
}
|
|
@ -2,10 +2,10 @@ package hello;
|
|||
|
||||
import rife.engine.Server;
|
||||
|
||||
public class AppUber extends App {
|
||||
public class AppSiteUber extends AppSite {
|
||||
public static void main(String[] args) {
|
||||
new Server()
|
||||
.staticUberJarResourceBase("webapp")
|
||||
.start(new AppUber());
|
||||
.start(new AppSiteUber());
|
||||
}
|
||||
}
|
|
@ -11,13 +11,13 @@ import static org.junit.jupiter.api.Assertions.*;
|
|||
public class AppTest {
|
||||
@Test
|
||||
void verifyRoot() {
|
||||
var m = new MockConversation(new App());
|
||||
var m = new MockConversation(new AppSite());
|
||||
assertEquals(m.doRequest("/").getStatus(), 302);
|
||||
}
|
||||
|
||||
@Test
|
||||
void verifyHello() {
|
||||
var m = new MockConversation(new App());
|
||||
var m = new MockConversation(new AppSite());
|
||||
assertEquals("Hello", m.doRequest("/hello")
|
||||
.getTemplate().getValue("title"));
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
<filter-class>rife.servlet.RifeFilter</filter-class>
|
||||
<init-param>
|
||||
<param-name>rifeSiteClass</param-name>
|
||||
<param-value>hello.App</param-value>
|
||||
<param-value>hello.AppSite</param-value>
|
||||
</init-param>
|
||||
</filter>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue