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
最满意答案
我想你可以使用
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 forMFMessageComposeViewController
.)
相关问答
更多-
如何检查iOS版本?(How to check iOS version?)[2022-07-21]
快速回答... 从Swift 2.0开始,您可以在if或guard使用#available来保护只能在某些系统上运行的代码。 if #available(iOS 9, *) {} 在Objective-C中,您需要检查系统版本并进行比较。 iOS 8及更高版本中的[[NSProcessInfo processInfo] operatingSystemVersion] 。 完整的答案... 在Objective-C和Swift中,在极少数情况下,最好避免依赖操作系统版本作为设备或操作系统功能的指示。 通常有更 ... -
最新版本 ,无需处理NSString中的数字搜索就是定义macros (见原始答案: 检查iPhone iOS版本 ) 这些宏确实存在于github中,请参阅: https : //github.com/carlj/CJAMacros/blob/master/CJAMacros/CJAMacros.h 喜欢这个: #define SYSTEM_VERSION_EQUAL_TO(v) ([[[UIDevice currentDevice] systemVersion] com ...
-
没有配置iOS设备可用于兼容的iOS版本(No provisioned iOS devices are available with a compatible iOS version)[2023-02-19]
通过关闭并重新打开xcode来解决这个问题。 Xcode ...这是新的Windows。 I finally found a solution to this. If anyone else has this problem then it might be useful to know that Xcode now creates applications for ARM7 by default. To support the iPhone 3G and other arm6 devices, you n ... -
您需要了解一些事项: 您的设备是否包含在配置文件中? 是否在设备上安装了配置文件? 你在编译什么操作系统? 当您的设备为5.1时,可能您的部署目标设置为6.0。 您的设备必须至少与部署目标版本相同或更高。 There are a few things you need to look into: Is your device included in the provisioning profile? Is the provisioning profile installed on the device? W ...
-
我想你可以使用NSClassFromString(@"MFMessageComposeViewController")来查看该类是否可用。 (警告:你无法以这种方式检查UIGestureRecognizer因为Apple使用了同名的私有类。对于MFMessageComposeViewController也是如此。) I think you could use NSClassFromString(@"MFMessageComposeViewController") to see if the class is ...
-
如果没有越狱设备,你就不太可能降级。 唯一的解决方案是获取特定ios版本的软件映像并在XCode Simulator中运行它们。 除非您正在使用非常特定于硬件的软件(我说的是驱动程序级代码),否则无需担心所有iOS平台上的设备测试。 如果它在一个运行,那么它将在其他运行。 只需降级Xcode模拟器。 此外,91%(Apple数据源)的用户已经升级到iOS 6,所以除非你的应用程序像Whatsapp或者像他们一样出名,否则你不必担心剩下的9%。 It is very unlikely that you can ...
-
添加以下代码: if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone){ if ([[UIScreen mainScreen] respondsToSelector: @selector(scale)]) { CGSize result = [[UIScreen mainScreen] bounds].size; CGFloat scale = [UIScreen mainScree ...
-
这个字母数字字符串是内部编号 ,这个答案解释了一种获取它的方法。 祝你好运! This alphanumeric string is the build number, and this answer explains a way to get it. Good luck!
-
我能够使用iOS设备版本 UIDevice.CurrentDevice.CheckSystemVersion(7, 0) 如果设备版本高于(或等于)iOS 7,则上述方法返回BOOL值true,否则返回false。 I am able to get the iOS device version using UIDevice.CurrentDevice.CheckSystemVersion(7, 0) The above method returns the BOOL value true, if the ...
-
http://zsprawl.com/iOS/2012/05/check-the-ios-version-with-javascript/ 那里有一个教程,这是我能找到的最新版本(可能是2012年),因为我知道许多方法不适用于较新的IOS,值得一试! :) http://zsprawl.com/iOS/2012/05/check-the-ios-version-with-javascript/ There is a tutorial there, it was the most recent i could ...