我在多模块maven项目中使用Vaadin-CDI,其中包含一个常用类所需的模块,如接口,抽象类等.我的问题是,我无法像往常一样对@Inject类进行anotated @UIScoped,它被置于另一个核心模块中.我仍然得到UnsatisfiedResolutionException
SEVERE: CDI Beans module deployment failed
javax.enterprise.inject.UnsatisfiedResolutionException: Api type [com.web.core.TestClass] is not found with the qualifiers
Qualifiers: [@javax.enterprise.inject.Default()]
for injection into Field Injection Point, field name : cls, Bean Owner : [DispUI, Name:null, WebBeans Type:MANAGED, API
Types:[com.vaadin.ui.AbstractComponent,java.util.EventListener,com.vaadin.event.MethodEventSource,com.vaadin.server.Abs
tractClientConnector,com.vaadin.server.VariableOwner,java.lang.Iterable,com.vaadin.ui.HasComponents$ComponentAttachDetac
hNotifier,java.lang.Object,java.io.Serializable,com.vaadin.ui.LegacyComponent,com.vaadin.event.ConnectorEventListener,co
m.vaadin.event.Action$Notifier,com.vaadin.ui.Component,com.vaadin.event.Action$Container,com.vaadin.ui.SingleComponentCo
ntainer,com.vaadin.ui.HasComponents,com.vaadin.server.Sizeable,com.vaadin.ui.Component$Focusable,com.vaadin.server.Clien
tConnector,com.vaadin.ui.AbstractSingleComponentContainer,com.vaadin.shared.Connector,com.web.disp.DispUI,com.vaa
din.ui.UI], Qualifiers:[javax.enterprise.inject.Any,javax.enterprise.inject.Default]]
Run Code Online (Sandbox Code Playgroud)
我在IBM WebSphere Info中找到了一些名为2的建议.解决了一个不可满足的依赖关系. (可在此处找到http://pic.dhe.ibm.com/infocenter/wasinfo/v8r0/index.jsp?topic=%2Fcom.ibm.websphere.nd.multiplatform.doc%2Finfo%2Fae%2Fae%2Ftweb_troubleshoot_cdi. HTML).据此,我检查了我的项目的部署程序集属性,并正确添加了core.jar.
接下来我应该检查什么?非常感谢您的回答!
我有div一些信息,.innerHTML通过点击按钮填写.我的目标是.slideDown在添加div中的文本时想要div.有可能用jQuery做到吗?
例:
<div id="calcInfo"></div>
Run Code Online (Sandbox Code Playgroud)
将文本添加到div中 -
document.getElementById("calcInfo").innerHTML = 'someText';
Run Code Online (Sandbox Code Playgroud)
我想在它之后使用这个功能:)
if ($('#calcInfo').text().trim().length > 0) {
$('#calcInfo').slideDown('slow', function() {});
};
Run Code Online (Sandbox Code Playgroud)
我正在尝试.change()功能,但它只适用于input和textarea元素.非常感谢您的回答!
的Ondrej
我遇到了这种情况的问题(我会试着让它变得更容易) - 我的数据库中有用户列出了角色列表和状态列表.
public class User implements Serializable {
@ManyToMany(cascade = CascadeType.ALL, fetch= FetchType.LAZY)
@JoinTable(name = "role_to_user",
joinColumns={@JoinColumn(name = "user_id")},
inverseJoinColumns={@JoinColumn(name = "role_id")})
private Set<Role> roles = new LinkedHashSet<Role>();
@ManyToMany(cascade = CascadeType.ALL, fetch= FetchType.LAZY)
@JoinTable(name = "status_to_user",
joinColumns={@JoinColumn(name = "user_id")},
inverseJoinColumns={@JoinColumn(name = "status_id")})
private Set<Status> statuses = new LinkedHashSet<Status>();
}
Run Code Online (Sandbox Code Playgroud)
我正在尝试创建一个hibernate标准,该标准能够使用指定的角色和状态返回用户(在使用角色表和状态表加入之后).就像是 :
返回role = 1或role = 2且status = 1的用户
我google了一些东西,现在我可以创建一个查询,只返回指定角色的用户,但不是状态.
Criteria cr = session.createCriteria(User.class)
.createCriteria("roles")
.add(Restrictions.or(Restrictions.eq("roletype", 1), Restrictions.eq("roletype", 2)));
Run Code Online (Sandbox Code Playgroud)
表用户和角色通过role_to_user表与两列(user_id,role_id)连接,类似于表用户和状态通过status_to_role表
谢谢你的建议 :)