更改Tomcat Web应用程序上下文(Changing Tomcat web application context)
我有一个Web应用程序,它的设计始终在根上下文(“/”)下工作。 所以所有的
css
,js
和链接都以/
/css/style.css
(例如/css/style.css
)。 现在我需要将此Web应用程序移动到某个不同的上下文(比如/app1
)。 可以使用[Context path=""]
项轻松更改server.xml
配置文件并在新上下文app1
启动Web应用程序。 但网页被破坏是因为所有链接现在都不正确。 它们指向旧的根上下文/css/style.css
而不是新的app1
上下文。 是否有任何神奇的方法来解决这个问题,而无需通过添加一些“上下文”变量来修复每个链接? 使用的服务器 - Tomcat 5.应用程序是用Java编写的,使用JSP,Struts2,Spring和UrlRewrite过滤器。 更有趣的是听到与理论辩论中的这些问题作斗争的真实经验。 谢谢。PS我没看到UrlRewrite过滤器如何帮助我,因为它只能在
app1
上下文中工作。 因此,对/css/style.css
链接的请求将不会传递给它。I have a web application, which was designed and always worked under root context ("/"). So all
css
,js
and links started with/
(for example/css/style.css
). Now I need to move this web application to some different context (let's say/app1
). It is easy to changeserver.xml
configuration file and bring up web application in new contextapp1
using[Context path=""]
item. But web pages are broken because all links are now incorrect. They point to old root context/css/style.css
instead of newapp1
context. Is there any magic way to fix this problem without fixing each link by prefixing with some "context" variable? Used server - Tomcat 5. Application is written with Java and uses JSP, Struts2, Spring and UrlRewrite filter. More interesting is to hear real experience in fighting with such problems that theoretical debates. Thank you.P.S. I do not see how UrlRewrite filter can help me because it will work only in
app1
context. So requests to links like/css/style.css
will not be passed to it.
原文:https://stackoverflow.com/questions/2065843
最满意答案
您必须在应用程序设置中将Facebook应用程序设置为游戏类别 。 否则,您无法使用
GameRequestDialog
,因为您的应用不是游戏。 在这种情况下,Facebook会为您提供AppInviteDialog
。You must set your Facebook app as a game category, in the App settings. Otherwise, you can't use
GameRequestDialog
, because your app is not a game. In this case, Facebook gives youAppInviteDialog
.
相关问答
更多-
我认为你是一个很好的开源,并且可以免费为Android平台使用游戏引擎。 那么现在有许多免费和开放源代码的游戏引擎可用,但是它们仍然在进行中。 目前我会建议您使用Android的AndEngine游戏引擎 。 AndEngine游戏引擎为Android 网址: http : //www.andengine.org 博客: http : //www.andengine.org/blog 下载源代码: http : //code.google.com/p/andengine/ 提示和教程: http : //t ...
-
借助@Isaac Payne提供的代码,我正在修改Dialog的代码。 public class MyApp extends Application { SharedPreferences mPrefs; @Override public void onCreate() { super.onCreate(); Context mContext = this.getApplicationContext(); //0 ...
-
facebook请求对话框android只显示部分朋友列表(facebook request dialog android shows only a partial list of friends)[2024-02-26]
user_friends将仅返回使用发出请求的应用的朋友。 通过Graph API参考 user_friends will return only the friends who used the app that makes the request. via Graph API Reference -
今天我一直在努力争取同样的东西。 我终于找到了一种适合我的方式。 我使用sdk 3.0.2b,我遵循这里的指南https://developers.facebook.com/docs/howtos/androidsdk/3.0/send-requests/ 在步骤2中,指南建议编码: private void sendRequestDialog() { Bundle params = new Bundle(); params.putString("message", "Learn how to ...
-
点击Facebook上的游戏请求通知后,未找到内容错误(Content not found error after clicking on game request notification on facebook)[2024-01-28]
最后,它现在正在工作。 可能是他们修复了一些facebook bug,并且其工作没有任何改变。 Finally, its working now. May be some facebook bug which they fixed and its working without any changes. -
Facebook Unity SDK登录。(Facebook Unity SDK Login. How to always force in-game WebView login dialog?)[2023-03-21]
我在Facebook文档中找到了这个(点击第2页后的问号): Android apps should use the default login behavior defined by the SDK, which may use the web-view Login dialog. On iOS, only kiosk apps may use a web-view Login dialog. 我们的应用程序不是自助服务终端应用程序,因此在iOS上我们无法使用基于Web视图的登录。 如果我理解正 ... -
为什么不在Fragment中实例化它或你想要的碎片? 这是Webview Fragments的文档http://developer.android.com/reference/android/webkit/WebViewFragment.html 现在Facebook确实将一些原生片段集成到他们的SDK中,例如Picker Fragment: https : //developers.facebook.com/docs/reference/android/3.0/PickerFragment 这是将webf ...
-
如何邀请朋友加入不是游戏的Facebook应用程序?(How to invite friends to the Facebook application that is not a game?)[2022-05-25]
Facebook建议使用发送对话框邀请朋友加入应用: https : //developers.facebook.com/docs/sharing/reference/send-dialog Facebook recommends using the Send Dialog to invite friends to Apps: https://developers.facebook.com/docs/sharing/reference/send-dialog -
您必须在应用程序设置中将Facebook应用程序设置为游戏类别 。 否则,您无法使用GameRequestDialog ,因为您的应用不是游戏。 在这种情况下,Facebook会为您提供AppInviteDialog 。 You must set your Facebook app as a game category, in the App settings. Otherwise, you can't use GameRequestDialog, because your app is not a gam ...
-
打开facebook sdk提供的Facebook.java然后我有这样的变化: public void authorize(Activity activity, String[] permissions, int activityCode, final DialogListener listener) { boolean singleSignOnStarted = false; mAuthDialogListener = listener; ...