相对于 Spring boot 的 path variable ;Solon 的不需注解,只要变量名对上即可:
//path var demo
//
@XMapping("e/{p_q}/{obj}/{id}")
public String test_e(XContext ctx, String p_q, String obj, String id) {
return ctx.path() + "::" + p_q + "-" + obj + "-" + id;
}
注:maven-compiler-plugin
添加编译参数:-parameters
,例:
<!-- 框架引用 -->
<dependency>
<groupId>org.noear</groupId>
<artifactId>solon-web</artifactId>
<version>1.0.10</version>
<type>pom</type>
</dependency>
<!-- 编译插件配置 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<compilerArgument>-parameters</compilerArgument>
<source>1.8</source>
<target>1.8</target>
<encoding>UTF-8</encoding>
</configuration>
</plugin>
网友评论