获取下一个数字
我使用弹簧靴和百里叶奶酪,
我从模板中的数字开始
//想要显示startnubmer +1
//想要显示startnubmer +2
是否有一种方法可以用百里叶以
最终创建一个Java类
public class TLCounter {
private int count;
public TLCounter()
{
count = 0;
}
public TLCounter(int init)
{
count = init;
}
public int get()
{
return count;
}
public void clear()
{
count = 0;
}
public int incrementAndGet()
{
return ++count;
}
public String toString()
{
return ""+count;
}
}
通过我的胸腺上的变量,然后调用方法
<th:block th:with="counterBullet = ${counter.incrementAndGet()}">
<p th:text="${counterBullet}">1.</p>
</th:block>
I use spring boot and thymeleaf
I start with a number in a template
//want to display startNubmer +1
//want to display startNubmer +2
Is there a way to get that with thymeleaf
Finally create a java class
public class TLCounter {
private int count;
public TLCounter()
{
count = 0;
}
public TLCounter(int init)
{
count = init;
}
public int get()
{
return count;
}
public void clear()
{
count = 0;
}
public int incrementAndGet()
{
return ++count;
}
public String toString()
{
return ""+count;
}
}
Pass a variable in my thymeleaf page, and call method
<th:block th:with="counterBullet = ${counter.incrementAndGet()}">
<p th:text="${counterBullet}">1.</p>
</th:block>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论