Skip to content

Commit 0dec83e

Browse files
committed
test: add vul-playframework
1 parent 8dc52e7 commit 0dec83e

File tree

8 files changed

+99
-0
lines changed

8 files changed

+99
-0
lines changed

settings.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ include("vul:vul-springboot2-undertow")
3737
include("vul:vul-springboot3")
3838
include("vul:vul-springboot2-webflux")
3939
include("vul:vul-springboot3-webflux")
40+
include("vul:vul-playframework")
4041
include("memshell-agent:memshell-agent-attacher")
4142
include("memshell-agent:memshell-agent-asm")
4243
include("memshell-agent:memshell-agent-javassist")
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package controllers;
2+
3+
import play.mvc.Controller;
4+
import play.mvc.Http;
5+
import play.mvc.Result;
6+
7+
import java.util.Arrays;
8+
9+
/**
10+
* @author ReaJason
11+
* @since 2025/8/21
12+
*/
13+
public class TestController extends Controller {
14+
public TestController() {
15+
System.out.println("init");
16+
}
17+
18+
public Result index(Http.Request request) {
19+
request.queryString().forEach((k, v) -> {
20+
System.out.println(k + ":" + Arrays.toString(v));
21+
});
22+
return ok("hello world");
23+
}
24+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
import play.gradle.plugin.PlayPlugin
2+
3+
plugins {
4+
id("org.playframework.play") version "3.1.0-M2"
5+
id("org.playframework.twirl") version "2.0.9"
6+
}
7+
8+
val scalaVersion = System.getProperty("scala.version", PlayPlugin.DEFAULT_SCALA_VERSION).trimEnd { !it.isDigit() }
9+
10+
dependencies {
11+
implementation(platform("org.playframework:play-bom_$scalaVersion:3.0.8"))
12+
13+
// implementation("org.playframework:play-pekko-http-server_$scalaVersion")
14+
implementation("org.playframework:play-netty-server_$scalaVersion")
15+
16+
implementation("org.playframework:play-guice_$scalaVersion")
17+
implementation("org.playframework:play-java-forms_$scalaVersion")
18+
implementation("org.playframework:play-logback_$scalaVersion")
19+
20+
testImplementation("junit:junit:4.13.2")
21+
testImplementation("org.playframework:play-test_$scalaVersion")
22+
}
23+
24+
tasks.withType<ScalaCompile>().configureEach {
25+
options.compilerArgs.addAll(listOf("-Xlint:unchecked", "-Xlint:deprecation", "-Werror"))
26+
}
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# This is the main configuration file for the application.
2+
# https://www.playframework.com/documentation/latest/ConfigFile
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
3+
<!-- https://www.playframework.com/documentation/latest/SettingsLogger -->
4+
5+
<!DOCTYPE configuration>
6+
7+
<configuration>
8+
<import class="ch.qos.logback.classic.encoder.PatternLayoutEncoder"/>
9+
<import class="ch.qos.logback.classic.AsyncAppender"/>
10+
<import class="ch.qos.logback.core.FileAppender"/>
11+
<import class="ch.qos.logback.core.ConsoleAppender"/>
12+
13+
<appender name="FILE" class="FileAppender">
14+
<file>${application.home:-.}/logs/application.log</file>
15+
<encoder class="PatternLayoutEncoder">
16+
<pattern>%date [%level] from %logger in %thread - %message%n%xException</pattern>
17+
</encoder>
18+
</appender>
19+
20+
<appender name="STDOUT" class="ConsoleAppender">
21+
<encoder class="PatternLayoutEncoder">
22+
<pattern>%highlight(%-5level) %logger{15} - %message%n%xException{10}</pattern>
23+
</encoder>
24+
</appender>
25+
26+
<appender name="ASYNCFILE" class="AsyncAppender">
27+
<appender-ref ref="FILE"/>
28+
</appender>
29+
30+
<appender name="ASYNCSTDOUT" class="AsyncAppender">
31+
<appender-ref ref="STDOUT"/>
32+
</appender>
33+
34+
<logger name="play" level="INFO"/>
35+
<logger name="application" level="DEBUG"/>
36+
37+
<root level="WARN">
38+
<appender-ref ref="ASYNCFILE"/>
39+
<appender-ref ref="ASYNCSTDOUT"/>
40+
</root>
41+
42+
</configuration>

vul/vul-playframework/conf/routes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# Routes
2+
GET /test controllers.TestController.index(request: Request)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
sbt.version=1.11.3
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
addSbtPlugin("org.playframework" % "sbt-plugin" % "3.0.8")

0 commit comments

Comments
 (0)