相对于 Spring boot 的 path variable ;Solon 的不需注解,只要变量名对上即可:

//path var demo
//
@Mapping("e/{p_q}/{obj}/{id}")
public String test_e(Context 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.5.11</version>
</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>  

相关文章:

  • 2021-12-27
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-06-18
  • 2021-07-24
  • 2022-01-18
  • 2021-12-27
猜你喜欢
  • 2021-10-19
  • 2021-09-05
  • 2021-07-21
  • 2022-12-23
  • 2021-12-31
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案