config类中定义方法:

@Override
public void configHandler(Handlers me) {
me.add(new ContextPathHandler("base_path"));
}

然后在页面head标签中中添加:

<base href="${base_path}/" />

这样项目中的资源文件引用就不会出问题了

相关文章:

  • 2021-07-29
  • 2021-12-21
  • 2022-12-23
  • 2021-12-10
  • 2021-09-01
  • 2021-07-05
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-11-29
  • 2021-11-29
  • 2022-12-23
  • 2021-11-19
  • 2021-12-01
相关资源
相似解决方案