我刚刚创建了我的第一个Symfony2项目.但URL中的"/web/app_dev.php"部分让我很烦.应该可以在没有虚拟主机的情况下执行此操作...
但是当我通过.htaccess尝试这个时,我总是得到路由错误,并且"web /"总是被添加到url ...
编辑:整个项目也在一个名为"symfonyTest"的子目录中.演示页面的URL是"http://localhost/symfonyTest/web/app_dev.php/demo/",它应该变为"http:// localhost/symfonyTest/demo /".链接也应具有此语法.这可能吗?
我正在尝试创建我的第一个Spring MVC Web应用程序.我已经下载了Spring Tool Suite并按照以下说明操作:
在STS中设置新项目:单击文件 - >新建 - >弹簧模板项目 - > Spring MVC项目引入依赖项并编译项目:右键单击新项目 - >运行方式 - > Maven安装在内部运行项目应用程序服务器:右键单击您的新项目 - >运行方式 - >在服务器上运行 - > SpringSource tc服务器如果有效,您将看到一个网页上写着"恭喜!您正在运行Spring!" (/sf/answers/171136381/)
但是当我启动服务器时,我总是会收到以下错误:
Mrz 29, 2012 12:29:57 PM org.apache.catalina.startup.SetContextPropertiesRule begin
Warnung: [SetContextPropertiesRule]{Context} Setting property 'source' to 'org.eclipse.jst.jee.server:undnochmal' did not find a matching property.
[TomcatWeavingInsightClassLoader@db27fb2] warning ignoring duplicate definition: jar:file:/C:/springsource/vfabric-tc-server-developer-2.6.4.RELEASE/spring-insight-instance/insight/collection-plugins/insight-collection-1.5.1.SR2.jar!/META-INF/aop.xml
[TomcatWeavingInsightClassLoader@db27fb2] warning ignoring duplicate definition: jar:file:/C:/springsource/vfabric-tc-server-developer-2.6.4.RELEASE/spring-insight-instance/insight/collection-plugins/insight-plugin-jdbc-1.5.1.SR2.jar!/META-INF/aop.xml
[TomcatWeavingInsightClassLoader@db27fb2] warning ignoring duplicate definition: jar:file:/C:/springsource/vfabric-tc-server-developer-2.6.4.RELEASE/spring-insight-instance/insight/collection-plugins/insight-collection-1.5.1.SR2.jar!/META-INF/aop-ajc.xml
[TomcatWeavingInsightClassLoader@db27fb2] warning ignoring duplicate definition: jar:file:/C:/springsource/vfabric-tc-server-developer-2.6.4.RELEASE/spring-insight-instance/insight/collection-plugins/insight-plugin-jdbc-1.5.1.SR2.jar!/META-INF/aop-ajc.xml
[TomcatWeavingInsightClassLoader@db27fb2] warning ignoring duplicate definition: …Run Code Online (Sandbox Code Playgroud) 有人可以告诉我为什么这是可能的吗?私有属性只能从类本身进行更改.s :: $ c是可读的(getC()),但为什么我可以写它?
<?php
class s{
private $c;
public function __construct() {
$this->c = new t;
}
public function getC() {
return $this->c;
}
}
class t {
public $a = 1;
public $b = 2;
}
$x = new s();
$x->getC()->a = 5;
echo $x->getC()->a;
?>
Run Code Online (Sandbox Code Playgroud)
输出:5