我正在研究虚拟域系统.我有一个通配符DNS设置为*.loc,我正在尝试处理我的.htaccess文件.以下代码有效:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www.)?example\.loc$ [NC]
RewriteCond %{REQUEST_URI} !^/example/
RewriteRule (.*) /example/$1 [L,QSA]
Run Code Online (Sandbox Code Playgroud)
但是,我希望这可以与我放入的任何内容一起使用.但是,我需要%{REQUEST_URI}对作为域的文本进行检查.我尝试使用此代码:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www.)?([a-zA-Z0-9-]*.)?([a-zA-Z0-9-]+)\.loc$ [NC]
RewriteCond %{REQUEST_URI} !^/%3/
RewriteRule (.*) /%3/$1 [L,QSA]
Run Code Online (Sandbox Code Playgroud)
但该行RewriteCond %{REQUEST_URI} !^/%3/导致我的代码抛出内部服务器错误.我理解这是因为我的代码中有%N,但有没有办法可以使用它?我需要这一行,否则,我的代码会因内部重定向而失败.
我希望这对某人有意义.我需要的是能够在后面的RewriteCond中反向引用RewriteCond.
apache .htaccess mod-rewrite backreference wildcard-subdomain
我写了这个测试代码
public class ConstructorTestApplication {
private static String result;
public static void main(String[] args) {
ConstructorTest test1 = new ConstructorTest(0);
System.out.println(result);
}
private static class ConstructorTest {
public ConstructorTest(double param){
result = "double constructor called!";
}
public ConstructorTest(float param) {
result = "float constructor called!";
}
}
}
Run Code Online (Sandbox Code Playgroud)
结果是
float constructor called!
Run Code Online (Sandbox Code Playgroud)
为什么调用float构造函数而不是双构造函数?这是动态方法查找的一部分吗?
在我的Angular 6应用程序中,我需要一个不执行任何操作的函数。显然,我可以自己编写,但是我正在阅读有关我想使用的angular.noop的信息。但是,angular.noop is not a function尝试使用它时出现错误。我在Angular的文档中找不到关于此的任何信息。AngularJS的angular.noop函数是否有Angular 6版本?
我知道是什么事 这不是Angular.noop用于什么的重复项?。我问的是Angular6。我的问题很简单:“像AngularJS中一样,是否在Angular 6中内置了noop函数?”。
使用 a DropdownButton,我需要所选项目的颜色与点击按钮时出现的下拉菜单中的项目列表的颜色不同。根据Flutter 文档,我应该使用selectedItemBuilder. 正如文档中的示例所示,使用selectedItemBuilder结果时所选文本向上移动,这看起来不太好。
如何使所选项目与下拉图标一致,同时菜单项和所选项目具有单独的颜色?