Java 六号门!继续原始目的地:接线员!是未定义的 处境
我正在将一个项目从Java 六号门!继续原始目的地:接线员!是未定义的 处境,java,jakarta-ee,migration,wicket-1.5,wicket-6,Java,Jakarta Ee,Migration,Wicket 1.5,Wicket 6,我正在将一个项目从Wicket 1.5.7迁移到Wicket 6.12,下面将解释我遇到的一个错误 代码 错误 这是我在更改wicket版本时遇到的错误:运算符! 参数类型void未定义 注意:我在将鼠标悬停在上时看到此错误!继续原创目标 我试了什么 在搜索stackoverflow时,我遇到了以下问题: 还检查了apache wicket上的此主题: 因此,我将代码更改为: 问题: 在我的特殊情况下,旧情况和代码更改似乎都起作用 也许这只是一个小小的改变,是我的新代码错了吗,这应该如何工
Wicket 1.5.7
迁移到Wicket 6.12
,下面将解释我遇到的一个错误
代码
错误
这是我在更改wicket版本时遇到的错误:运算符!
参数类型void未定义
注意:我在将鼠标悬停在上时看到此错误!继续原创目标
我试了什么
在搜索stackoverflow时,我遇到了以下问题:
还检查了apache wicket上的此主题:
因此,我将代码更改为:
问题:
在我的特殊情况下,旧情况和代码更改似乎都起作用
- 也许这只是一个小小的改变,是我的新代码错了吗,这应该如何工作
- Wicket改变了那么多,以至于旧代码不再受支持,或者可以
!是否也可以使用continueToOriginalDestination
public class BuyProductPage extends WebPage {
public BuyProductPage() {
User user = session.getLoggedInUser();
if (user null) {
throw new RestartResponseAtInterceptPageException(LoginPage.class);
}
}
}
然后在LoginPage.java中,在用户登录后将其重定向回BuyProductPage:
public class LoginPage extends WebPage {
public LoginPage() {
// first, login the user, then check were to send him/her:
if (!continueToOriginalDestination()) {
// redirect the user to the default page.
setResponsePage(HomePage.class);
}
}
}
Wicket 6中的continueToOriginalDestination方法已更改,它现在是void,这使您的代码看起来更神奇,逻辑性更低:
public class LoginPage extends WebPage {
public LoginPage() {
// first, login the user, then check were to send him/her:
continueToOriginalDestination();
// Magic! If we get this far, it means that we should redirect the
// to the default page.
setResponsePage(HomePage.class);
}
}
public class LoginPage extends WebPage {
public LoginPage() {
// first, login the user, then check were to send him/her:
if (!continueToOriginalDestination()) {
// redirect the user to the default page.
setResponsePage(HomePage.class);
}
}
}
public class LoginPage extends WebPage {
public LoginPage() {
// first, login the user, then check were to send him/her:
continueToOriginalDestination();
// Magic! If we get this far, it means that we should redirect the
// to the default page.
setResponsePage(HomePage.class);
}
}