首页 \ 问答 \ GWT多个html页面和导航(GWT Multiple html pages and navigation)

GWT多个html页面和导航(GWT Multiple html pages and navigation)

嗨首先我想提一下,我知道基于ajax的应用程序和重用相同的页面。

这里的要求是,我希望有两个单独的页面,一个用于登录,另一个用于主应用程序。 现在,这不是因为我只是想要它,而是因为我在两个页面中有非常不同的布局,我很乐意将html元素和css直接放在页面中,然后将div包含在动态html中以供gwt填充。

即使在myfaces的情况下,我还没有看到用于登录和主应用页面的相同页面的应用程序。 无论如何,我面临的问题是,让我说我有两页

Login.html with div:div id =“login”

带有div的main.html:div id =“main”

我已经在web.xml中的欢迎文件列表中声明了它们现在我从登录页面开始用gwt小部件填充“登录”div并点击按钮我使用以下jsni代码重定向到“/Main.html ?gwt.codesvr = 127.0.0.1:9997"

private native void gotoURL(String url)/ - {$ wnd.location.href = url; } - /;

然后尝试填充“主”div。 但我注意到的行为是应用程序再次调用入口点,它没有找到任何元素作为“登录”并给出NPE。 有没有办法做到这一点? 还要摆脱“?gwt.codesvr = 127.0.0.1:9997”?

谢谢


Hi firstly i want to mention that i am aware of ajax based application and reuse of same page.

The requirement here is that, i want to have two separate pages one for login and other for the main application. Now, this is not because i just want it, but because i have very different layouts in the two pages which i am comfortable to put together with html elements and css directly in the page and then putting divs to contain dynamic html for gwt to populate.

Even in case of myfaces i have not seen application with same page for login and the main app page. Anyways, the problem i am facing is, lets say i have two pages

Login.html with a div : div id="login"

Main.html with a div: div id="main"

i have declared both of them in my welcome file list in web.xml Now i start with Login page fill the "login" div with gwt widgets and on click of a button i am using following jsni code to redirect to "/Main.html?gwt.codesvr=127.0.0.1:9997"

private native void gotoURL(String url) /-{ $wnd.location.href=url; }-/;

and then trying to populate the "main" div. But the behaviour as i noticed is that the application call the entry point again and it doesnt find any element as "login" and gives NPE. Is there a way to do this? also to get rid of the "?gwt.codesvr=127.0.0.1:9997"?

Thanks


原文:https://stackoverflow.com/questions/4714747
更新时间:2022-09-18 22:09

最满意答案

我想你可以使用NSClassFromString(@"MFMessageComposeViewController")来查看该类是否可用。

(警告:你无法以这种方式检查UIGestureRecognizer因为Apple使用了同名的私有类。对于MFMessageComposeViewController也是如此。)


I think you could use NSClassFromString(@"MFMessageComposeViewController") to see if the class is available.

(Caveat: You couldn't check for UIGestureRecognizer this way because Apple used private class with the same name. Same could be true for MFMessageComposeViewController.)

相关问答

更多

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)