默认模块中控制器的命名空间/前缀(Namespace / Prefix of Controller in Default Module)
在我的zf应用程序中,我有3个模块:
- 申请人
- 公司
- 管理
而且,在我的application.ini中,我选择了一个默认模块
resources.frontController.defaultModule = "applicant"
因此,一些控制器类的命名如下:
class IndexController extends Zend_Controller_Action /* in Applicant Module */ class Company_IndexController extends Zend_Controller_Action class Admin_IndexController extends Zend_Controller_Action
由于申请人是我的默认模块,因此我不需要在类名中使用模块名称作为前缀。
如何使用前缀方式在默认模块中命名类?
我想使用这些类名
class Applicant_IndexController extends Zend_Controller_Action class Company_IndexController extends Zend_Controller_Action class Admin_IndexController extends Zend_Controller_Action
但是我收到了这个错误:
Fatal error: Uncaught exception 'Zend_Controller_Dispatcher_Exception' with message 'Invalid controller specified (error)' in ZendFramework-1.11.6/library/Zend/Controller/Dispatcher/Standard.php on line 248
In my zf application I have 3 modules:
- applicant
- company
- admin
And, in my application.ini I've picked a default module
resources.frontController.defaultModule = "applicant"
So, some of controllers classes are named like:
class IndexController extends Zend_Controller_Action /* in Applicant Module */ class Company_IndexController extends Zend_Controller_Action class Admin_IndexController extends Zend_Controller_Action
Since applicant is my default module, I don't need to use module name as prefix in class name.
How can I use the prefixed way to name classes in my default module?
I want to use these class names
class Applicant_IndexController extends Zend_Controller_Action class Company_IndexController extends Zend_Controller_Action class Admin_IndexController extends Zend_Controller_Action
but I'm getting this error:
Fatal error: Uncaught exception 'Zend_Controller_Dispatcher_Exception' with message 'Invalid controller specified (error)' in ZendFramework-1.11.6/library/Zend/Controller/Dispatcher/Standard.php on line 248
原文:https://stackoverflow.com/questions/6361974
最满意答案
使用
:
* nix平台上的类路径分隔符java -cp "/home/shbash6/astyanax/astyanax-examples/build/libs/*:/home/shbash6/astyanax/astyanax-cassandra/build/libs/*:/home/shbash6/astyanax/astyanax-core/build/libs/*:/home/shbash6/astyanax/astyanax-thrift/build/libs/*" com.netflix.astyanax.examples.AstClient
Use
:
classpath separators on *nix platformsjava -cp "/home/shbash6/astyanax/astyanax-examples/build/libs/*:/home/shbash6/astyanax/astyanax-cassandra/build/libs/*:/home/shbash6/astyanax/astyanax-core/build/libs/*:/home/shbash6/astyanax/astyanax-thrift/build/libs/*" com.netflix.astyanax.examples.AstClient
相关问答
更多-
方法setRepeatLastToken在Astyanax中做了什么?(What does the method setRepeatLastToken do in Astyanax?)[2023-02-22]
源代码注释几乎解释了setRepeatLastToken(boolean)的功能。 但是这里有详细信息: 根据这篇文章,Cassandra使用MD5或MurMurHash(取决于Cassandra版本)算法从密钥生成令牌。 这两种算法都很快但可以产生冲突(不同密钥的标记值相同)。 因此,可能存在多个存储在同一令牌下的行(通常,如果数据集足够大)。 Cassandra根据令牌将数据存储在节点上。 使用随机分区程序时,数据检索按令牌顺序(不是键顺序)完成。 这是有道理的,因为记录是按顺序从相同节点读取的,并且比 ... -
由于您在EC2实例上运行cassandra,请检查cassandra的端口号。 (您已选择9042)位于ec2安全组的允许列表中,并且您可以访问它。 如果没有添加端口号。 在ec2安全组的入站列表中,将ip范围设置为0.0.0.0。 Alos检查ec2上的防火墙是否已关闭。 默认情况下它是假的,但无论如何都要检查它。 如果您已经这样做了,那么您的客户端可能会在防火墙后面阻止出站流量到您选择的端口(9042)。 最后,如果你没有使用任何弹性ip,最好在你的setSeeds部分和cassandra.yaml的r ...
-
使用Astyanax实现以下目标: 用cqlsh: cqlsh:TEST_KS> INSERT INTO "MESSAGE_CF" (KEY, "DELETED_RECEIVER", "DELETED_SENDER", "SENDER") VALUES ('user-1241324', 'Yes', 'No', 'user@mail.com'); cqlsh:TEST_KS> SELECT * FROM "MESSAGE_CF"; ...
-
我遇到了一个类似的问题,我的注释从未在构造函数的字段中考虑过。 实际上,我使用了SpringData,并且不可能直接在一个字段上映射注释(如@Indexed )。 要在case类的构造函数中启用注释,首先应创建此类: object FixedScalaAnnotations { type Id = com.packagecontainingid.Id @field //replace by the right package type Column = com.packagecontainingco ...
-
原来我的项目使用的astyanax库调用了比1.1.1更旧版本的cassandra。 在pom中添加排除解决了我的问题:
com.netflix.astyanax astyanax 1.0.4 ... -
使用: * nix平台上的类路径分隔符 java -cp "/home/shbash6/astyanax/astyanax-examples/build/libs/*:/home/shbash6/astyanax/astyanax-cassandra/build/libs/*:/home/shbash6/astyanax/astyanax-core/build/libs/*:/home/shbash6/astyanax/astyanax-thrift/build/libs/*" com.netflix.as ...
-
Astyanax在使用CQL时不会限制返回的行数。 您可能想要检查您的Cassandra配置。 我会警告说,返回太多行可能会导致客户端级别出现其他问题,例如内存不足。 干杯 Astyanax, when using CQL, does not limit how many rows are returned. You may want to check your Cassandra configuration. I would warn that returning too many rows may ca ...
-
Astyanax cql3 COUNT查询返回ROWS而不是NUMBER(Astyanax cql3 COUNT query returning ROWS not NUMBER)[2023-11-07]
你应该用 System.out.println("CQL Count: " + result.getResult().getRows().getRowByIndex(0).getColumns().getColumnByName("count").getLongValue()); You should use System.out.println("CQL Count: " + result.getResult().getRows().getRowByIndex(0).getColumns().getCo ... -
如何使用astyanax在Cassandra中设置GCGraceSeconds?(How can I set GCGraceSeconds in Cassandra using astyanax?)[2021-08-17]
在更新版本的cassandra中,您实际上是在每个列系列的基础上设置gc_grace_seconds作为模式的一部分。 据我所知,Astyanax目前不支持设置该属性。 ColumnFamilyDefinition类中没有相应的方法。 https://github.com/Netflix/astyanax/blob/master/src/main/java/com/netflix/astyanax/ddl/ColumnFamilyDefinition.java 如果您愿意,可以使用cassandra-cli ... -
我能够使用Scala中的库。 如果有人对此感兴趣,您可以从这里获得POC https://github.com/abhsrivastava/AstyanaxScala I was able to use the library from Scala. If anyone is interested in this you can get a POC from here https://github.com/abhsrivastava/AstyanaxScala