在GWT中,Java8与历史的等价物是什么?
我正在尝试将GWT程序转换为Java8。在GWT中,我有:在GWT中,Java8与历史的等价物是什么?,java,Java,我正在尝试将GWT程序转换为Java8。在GWT中,我有: History.newItem("joeyAwardOverview", true); 我已尝试将其替换为: startActivity(new Intent(this, JoeyAwardOverviewView.class)); 然而,“意图”不被认可。请问正确的代码是什么 我花了几个小时在这上面,发现: response.setContentType("text/html"); PrintWriter pw
History.newItem("joeyAwardOverview", true);
我已尝试将其替换为:
startActivity(new Intent(this, JoeyAwardOverviewView.class));
然而,“意图”不被认可。请问正确的代码是什么
我花了几个小时在这上面,发现:
response.setContentType("text/html");
PrintWriter pw=response.getWriter();
response.sendRedirect("SelectPerson.html");
pw.close();
但是,这会在当前页面的末尾显示目标html文件中的html代码,而不是显示目标页面
然后我发现:
submitHandler : function(contactForm) {
//do something here
var frm = $('#contactForm');
//alert($("#accountName").val());
$.ajax({
type: "POST",
url: "LoginView",
cache: false,
data: frm.serialize(),
success: function(data){
if(data == "1"){
window.location.assign("SelectPerson.html");
}else{
$('#ajaxGetUserServletResponse').text(data);
$("#accountName").focus();
}
//console.log('Submission was successful.');
//console.log(data);
}
});
}
submitHandler : function(contactForm) {
//do something here
var frm = $('#contactForm');
//alert($("#accountName").val());
$.ajax({
type: "POST",
url: "LoginView",
cache: false,
data: frm.serialize(),
success: function(data){
if(data == "1"){
window.location.assign("SelectPerson.html");
}else{
$('#ajaxGetUserServletResponse').text(data);
$("#accountName").focus();
}
//console.log('Submission was successful.');
//console.log(data);
}
});
}
在java中,简单地说:
response.getWriter().write("1");
response.getWriter().write("1");
答案是:
在java中,简单地说:
response.getWriter().write("1");
response.getWriter().write("1");
通过返回不同的数字并进行测试,您可以转移到不同的页面。例如,如果您以管理员身份登录,显示“管理”页面,如果领导显示侦察员列表,等等。除了术语“Joey AwardOverview”之外,这些代码片段彼此无关。你为什么希望这样做有效?什么是
历史记录。newItem
?意图是Android,而不是Java 8。GWT指的是浏览器历史记录。Java 8无法访问用户web浏览器的浏览器历史记录。在GWT中,“history.newItem(“joeyAwardOverview”,true);”显示下一个视图。好的,我一直在搜索java等价物,我只找到了“startActivity(新意图(这个,JoeyAwardOverviewView.class));”。所以我的问题仍然存在——我如何用java显示下一个视图?您实际上想做什么?将GWT程序升级到Java 8?使用swing或javafx将GWT程序修改为桌面Java程序?将GWT程序修改为Android应用程序?