我的 EJBTest 有问题。
我已经安装了WildFly并配置了用户管理和应用程序管理。
我编写了一个 EJB 3.0 并部署了它:
@Stateless
@Remote(NewSessionBeanRemote.class)
public class NewSessionBean implements NewSessionBeanRemote {
List<String> bookShielf;
/**
* Default constructor.
*/
public NewSessionBean() {
bookShielf = new ArrayList<String>();
}
@Override
public void addBook(String bookName) {
bookShielf.add(bookName);
}
@Override
public List getBook() {
return bookShielf;
}
}
Run Code Online (Sandbox Code Playgroud)
后来我写了一个简单的客户端来连接它:
private static void invokeStatelessBean() throws NamingException {
// Let's lookup the remote stateless calculator
NewSessionBeanRemote remoteEjb = lookupRemoteSessionBean();
System.out.println("Obtained a remote stateless calculator for invocation");
String bookName = "TEST book";
remoteEjb.addBook(bookName); …Run Code Online (Sandbox Code Playgroud) 我有这个问题:
$(document).ready(function() {
$('#buttonTest').click(function() {
$.get('/WebTestProject/ServletEsempio', function(responseJson) {
var $table = $('<table>').appendTo($('#result'));
$.each(responseJson, function(index, product) {
$('<tr>').appendTo($table)
.append($('<td>').text(index))
.append($('<td>').text(product))
});
});
});
});
Run Code Online (Sandbox Code Playgroud)
这段代码可以调用我的servlet,但我没有找到如何关闭TAG,和.可能吗?
非常感谢大家.