目前,我在控制器和服务层之间的Autowire配置中遇到了问题.
我无法追查我的错误.
简单的日志信息
SEVERE: Exception while loading the app
SEVERE: Undeployment failed for context /OTT
SEVERE: Exception while loading the app : java.lang.IllegalStateException: ContainerBase.addChild: start: org.apache.catalina.LifecycleException: org.apache.catalina.LifecycleException: org.springframework.beans.factory.NoSuchBeanDefinitionException:
No qualifying bean of type [com.ott.service.EmployeeService] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}
Run Code Online (Sandbox Code Playgroud)
下面我还给出了Controller和Service Layer代码以及dispatcher-servlet.xml
调节器
package com.ott.controller;
import com.ott.service.EmployeeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
/**
*
* @author SPAR
*/
@Controller
public class AdminController {
private …Run Code Online (Sandbox Code Playgroud) 参考早期关于ng-if在DIV中的帖子以供参考此处给出的链接:: Ng-If如果在DIV内,但是当我尝试使用ng-if在ng-repeat on td内表时,它似乎没有工作得很好.纠正我,如果我错了我根据条件做了2次尝试显示列但没有工作.下面我给出了参考代码.有人可以帮我这个吗?如果您需要更多说明,请告知.
HTML
试试:: 1
<table>
<tr ng-repeat = "data in comments">
<td ng-if="data.type == 'hootsslllll' ">
//differnt template with hoot data
</td>
<td ng-if="data.type == 'story' ">
//differnt template with story data
</td>
<td ng-if="data.type == 'article' ">
//differnt template with article data
</td>
</tr>
</table>
Run Code Online (Sandbox Code Playgroud)
试试:: 2
<table>
<tr ng-repeat = "data in comments">
<div ng-if="data.type == 'hootsslllll' ">
<td> //differnt template with hoot data </td>
</div>
<div ng-if="data.type == 'story' ">
<td> //differnt …Run Code Online (Sandbox Code Playgroud) 我正在使用带有Angular的Struts1.2来发布一些数据,并希望在java中获取数据.
我能够从服务器检索数据并能够在屏幕上显示它.
现在我试图用Angular将一些数据发布到服务器并尝试从request.getParameterjava中获取数据.我做了三次尝试,但我不能.
下面我还提供了以下文件,包括我的三次尝试的说明和截图.
1. CartController.js
var myApp = angular.module('cartApp',[]);
myApp.controller('CartController', function ($scope,$http) {
$scope.bill = {};
$scope.items = [];
$http.post('/StrutsWithAngular/shopingCart.do')
.success(function(data, status, headers, config) {
$scope.items = data;
})
.error(function(data, status, headers, config) {
//alert("Error :: "+data);
});
// First Try
$scope.postData = function() {
$http({
method: 'POST',
url: '/StrutsWithAngular/shopingCart.do',
data: 'value=' + 'Parameter From Request' ,
headers: {'Content-Type': 'application/x-www-form-urlencoded'}
}).success(function(data, status, headers, config) {
alert("Success :: "+status);
$scope.items = data;
}).error(function(data, status, headers, config) {
alert("Error …Run Code Online (Sandbox Code Playgroud) 我有一个场景,我有两个或更多textarea,当用户输入textarea中的值,当值达到max-length,例如ng-max-length为15时,焦点应自动移动到下一个文本区域.
如何实现这一目标?
为了控制最大长度,我从这个链接中获得了解决方案.
但我不知道如何自动关注下一个元素
下面我给出了我试过的代码
textarea.html
<!DOCTYPE html>
<html>
<head>
<title>Angular App</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width">
</head>
<body>
<div ng-app="taApp">
<div ng-controller="taController">
<textarea my-maxlength="15" ng-model="ta1.text1" rows="4" cols="20"> </textarea>
<textarea my-maxlength="15" ng-model="ta2.text2" rows="4" cols="20"> </textarea>
<textarea my-maxlength="15" ng-model="ta3.text3" rows="4" cols="20"> </textarea>
</div>
</div>
<script src="js/libs/angularjs-1.0.2/angular.js" type="text/javascript"></script>
<script src="js/controller/pageController.js" type="text/javascript"></script>
<script src="js/controller/textAreaFocus.js" type="text/javascript"></script>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
textAreaFocus.js
angular.module('textareafocus',[]).directive('myMaxlength', function() {
return {
require: 'ngModel',
link: function (scope, element, attrs, ngModelCtrl) {
var maxlength = Number(attrs.myMaxlength);
function fromUser(text) {
if (text.length …Run Code Online (Sandbox Code Playgroud) 无法spring cloud eureka在服务中启动客户端。
我正在使用最新spring 2.1.1版本。
Discovery Server 以正确的方式启动,但不是服务客户端。
无法找出导致问题的原因.... 下面我有配置和详细日志。如果需要更多信息,请告诉我。
在应用程序类中,我使用了 @EnableDiscoveryClient
@SpringBootApplication
@EnableDiscoveryClient
public class TrackerServiceApplication {
public static void main(String[] args) {
SpringApplication.run(JobTrackerServiceApplication.class, args);
}
}
Run Code Online (Sandbox Code Playgroud)
在yml我给了server discovery URL.
spring:
application:
name: jtservice
eureka:
client:
service-url:
defaultZone: http://localhost:8761/eureka
Run Code Online (Sandbox Code Playgroud)
给出详细的启动日志
2018-12-28 01:18:57.283 WARN 15832 --- [ restartedMain] o.s.boot.actuate.endpoint.EndpointId : Endpoint ID 'service-registry' contains invalid characters, please migrate to a valid format.
2018-12-28 01:18:57.427 INFO 15832 --- [ restartedMain] o.s.cloud.context.scope.GenericScope : BeanFactory …Run Code Online (Sandbox Code Playgroud)