【发布时间】:2012-07-21 23:13:34
【问题描述】:
我正在使用 spring roo 中的脚本命令来创建我正在处理的应用程序。
这是我正在使用的 roo 脚本。
project --topLevelPackage is.kdh.cyberdojo --projectName cyberdojo --java 6 --packaging WAR
jpa setup --provider HIBERNATE --database HYPERSONIC_IN_MEMORY
entity jpa --class ~.domain.Attendance --testAutomatically --table ATTENDANCE
field date --fieldName attended --type java.util.Date --notNull --column ATTENDED
entity jpa --class ~.domain.BarCode --testAutomatically --table BARCODE
entity jpa --class ~.domain.Person --testAutomatically --table PERSON
field string --fieldName socialSecurityNumber --sizeMax 10 --notNull --column SOCIAL_SECURITY_NUMBER --unique true
field string --fieldName name --sizeMax 128 --notNull --column NAME
field string --fieldName address --sizeMax 128 --notNull --column ADDRESS
field string --fieldName city --sizeMax 128 --notNull --column CITY
field string --fieldName phone --sizeMax 128 --notNull --column PHONE
field string --fieldName mobile --sizeMax 24 --notNull --column MOBILE
field string --fieldName email --sizeMax 128 --notNull --column EMAIL
field date --fieldName created --type java.util.Date --notNull --column CREATED
field date --fieldName modified --type java.util.Date --notNull --column MODIFIED
field boolean --fieldName active --column ACTIVE --notNull --value true
field string --fieldName registrationNumber --column REGISTRATION_NUMBER --notNull --sizeMax 10
field string --fieldName comments --column COMMENTS --sizeMax 4096
field reference --fieldName parent --type is.kdh.cyberdojo.domain.Person --cardinality MANY_TO_ONE
field reference --fieldName barCode --type is.kdh.cyberdojo.domain.BarCode --cardinality ONE_TO_ONE
entity jpa --class ~.domain.Course --testAutomatically --table COURSE
field string --fieldName name --sizeMax 128 --notNull --column NAME
field string --fieldName description --sizeMax 2048 --notNull --column DESCRIPTION
field boolean --fieldName active --notNull --column ACTIVE
field date --fieldName validFrom --type java.util.Date --notNull --column VALID_FROM
field date --fieldName validTo --type java.util.Date --notNull --column VALID_TO
field number --fieldName occurrence --type int --notNull --column OCCURRENCE
field set --fieldName instructors --type is.kdh.cyberdojo.domain.Person
entity jpa --class ~.domain.UserType --testAutomatically --table USERTYPE
field string --fieldName name --sizeMax 128 --notNull --column NAME
test integration
perform tests
web jsf setup --implementation APACHE_MYFACES --theme EGGPLANT
web jsf all --package ~.jsf
logging setup --level WARN --package WEB
perform eclipse
security setup
quit
一切都很好,直到我得到安全设置命令 - 然后脚本执行被中止。
roo 打印出来的消息是
Command 'security setup' was found but is not currently available (type 'help' then ENTER to learn about this command)
我知道可以同时使用 spring security 和 jsf。我设置 roo 脚本的方式有什么问题吗?
顺便说一句:如果我使用 mvc 而不是 jsf,那么 spring 安全性设置得很好,一切正常。
【问题讨论】:
-
可能你遇到了这个错误jira.springsource.org/browse/ROO-2908。如果 web.xml 设置不正确,安全设置将失败。
-
我使用的是 1.2.1 版本 - 此错误已在 1.2.0.RC1 版本中修复
-
有谁知道为什么这不起作用?
-
您是否尝试将实现切换到 Mojarra?
-
我更新了我的 pom.xml 文件以使用 PF 3.3.1 和主题 1.0.5,但我仍然无法在 spring roo shell 中使用安全设置命令。 Roo 仍然打印出与以前相同的消息。“找到了命令 'security setup' 但当前不可用(键入 'help' 然后 ENTER 了解此命令)”
标签: spring jsf spring-security spring-roo