应用程序有一个顶部栏,上面有 3 个仪表板按钮。每个链接都会通过 iframe 在页面上打开一个新的仪表板。
应用程序组件.html
<md-toolbar class="toolbar">
<span>Dashboardds</span>
<span class="spacer"></span>
<button md-button [routerLink]="['/dashboard', 'first']" id="first" class="top-link">First</button>
<button md-button [routerLink]="['/dashboard', 'second']" id="second" class="top-link">Second</button>
<button md-button [routerLink]="['/dashboard', 'third']" id="third" class="top-link">Third</button>
</md-toolbar>
<router-outlet></router-outlet>
Run Code Online (Sandbox Code Playgroud)
app.module.ts
{path: 'dashboard/:id', component: DashboardComponent},
{path: '', redirectTo: 'dashboard/first', pathMatch: 'full'},
{path: '**', redirectTo: 'dashboard/first', pathMatch: 'full'}
Run Code Online (Sandbox Code Playgroud)
仪表板组件非常简单。它有 3 个网址和 1 个 iframe。
仪表板.component.html
export class DashboardComponent implements OnInit, OnChanges {
dashboardUrl: SafeUrl;
first_url: string = "first url of the dashboard";
second_url:string="second url of the dashboard";
third_url:string="third url of …Run Code Online (Sandbox Code Playgroud) 我无法连接到具有SEDA队列的驼峰路由.在服务器端我有以下配置:
<camel:route>
<camel:from uri="seda:input"/>
<camel:log message =">>>>>data is : ${body}"/>
<camel:inOnly uri="activemq:queue:TESTQUEUE"/>
</camel:route>
Run Code Online (Sandbox Code Playgroud)
我试图从像这样的独立客户端这条路线:
public static void main(String[] args) {
CamelContext context = new DefaultCamelContext();
producer = context.createProducerTemplate();
producer.sendBody("seda:input","Hey");
}
Run Code Online (Sandbox Code Playgroud)
但我的生产者无法连接到seda队列.无法打到我的路线排队.无法在我的bean属性中添加camelContext.我得到"bean类的无效属性'camelContext'".如果我将正文发送到SEDA队列,则消息将转到那里,但不会发送到溃败的下一个元素
我是JUnit的新手,并试图在遗留项目中实现它.这是一个Java EE项目.它的UI层位于Flex中,后端将Hibernate作为带有SQL Server数据库的ORM层.它运行在Tomcat上.
我正在采取婴儿步骤自己学习JUnit并将其实现到代码库中.有一个类有它的findByFK方法.如果找到任何类对象,则此方法返回类对象的数组.
该方法在Web应用程序上运行良好,但我无法运行其JUnit测试用例.测试用例不在容器中,也无法访问数据源.
如何在容器内运行JUnit测试用例?
我刚开始使用JUnit,并且不希望因集成问题而过度复杂化.有没有办法解决数据源和Web服务器等问题?
我是Groovy的新手,并试图在我的应用程序中实现Spock框架.这是我的测试代码:
def "Test class with mock object"() {
setup:
SomeObject sp = Mock()
test= TestClass()
when:
System.out.println('comes here');
push.exec(sp)
then:
sp.length == 1
}
Run Code Online (Sandbox Code Playgroud)
这里TestClass抛出一些异常,我必须在测试方法中捕获或再次抛出它.我试过了
try {
push.exec(sp)
} catch (Exception e) {
}
Run Code Online (Sandbox Code Playgroud)
但还是得到了
groovy.lang.MissingMethodException: No signature of method: test.spock.TestClassTest.TestClass() is applicable for argument types: () values: []
Possible solutions: use([Ljava.lang.Object;), use(java.util.List, groovy.lang.Closure), use(java.lang.Class, groovy.lang.Closure), dump(), with(groovy.lang.Closure), each(groovy.lang.Closure)
Run Code Online (Sandbox Code Playgroud) 我试图从后端获取响应xml并在jQuery的帮助下在页面上解析它.
代码很简单:
var response = "<Response><SomeElement><FewMoreElement></FewMoreElement><FewMoreElement></FewMoreElement><FewMoreElement></FewMoreElement></SomeElement></Response>";
$.parseXML(response).find("someElement").each(function(searchResp){
//Do something
});
Run Code Online (Sandbox Code Playgroud) 我有一个Contact可以拥有Address对象的对象.
class Contact {
var firstName: String = ""
var lastName: String = ""
var middleName: String = ""
var id: Int = -1
var addresses: Array<Address> = []
Run Code Online (Sandbox Code Playgroud)
如何Address从json字典中获取每个对象时对其进行初始化?
init(json: Dictionary<String, AnyObject>) {
if let line1 = json["streetLine"] as? String {
self.streetLine1 = line1
}
if let city = json["city"] as? String {
self.city = city
}
if let state = json["state"] as? String {
self.state = state
}
if let …Run Code Online (Sandbox Code Playgroud) 无法将流对象包装在一个try/catch block.
我试过这样的:
reponseNodes.stream().parallel().collect(Collectors.toMap(responseNode -> responseNode.getLabel(), responseNode -> processImage(responseNode)));
Run Code Online (Sandbox Code Playgroud)
Eclipse开始抱怨下划线processImage(responseNode)并建议它需要Surround with try/catch.
然后我更新到:
return reponseNodes.stream().parallel().collect(Collectors.toMap(responseNode -> responseNode.getLabel(), responseNode -> try { processImage(responseNode) } catch (Exception e) { throw new UncheckedException(e); }));
Run Code Online (Sandbox Code Playgroud)
更新的代码也不起作用.
在Java编写了10年之后,我是Scala的新手.仍然掌握功能编程.如何检查列表是否为空?代码看起来像这样:
val filterList = filters.map { filter =>
//some operations
}
Run Code Online (Sandbox Code Playgroud)
//其他功能
filterList.foldLeft(true)((result1, result2) => {
Run Code Online (Sandbox Code Playgroud)
现在,如果filters为null,那么filterList也将为null.
我正在使用填充对象列表md-nav-list。当用户单击时md-list-item,我想导航到候选详细路由器,并将其传递给candidate.id它。
不知道如何在上呼叫路由器md-list-item。
<md-nav-list *ngFor="let candidate of candidates">
<md-list-item class="candidate-row">
<div class="column2">
<span class="name">{{candidate.name}},</span>
</div>
</md-list-item>
</md-nav-list>
Run Code Online (Sandbox Code Playgroud)
候选人详细信息的路由器是
{path: 'candidate/:id', component: CandidateDetailsComponent}
其余代码可以在这里找到 https://github.com/himanshuy/hiringplus-ui/tree/page2
是否可以从PHP或网页运行Ant的build.xml?
有时候BAs想要进行构建和部署,我想通过MediaWiki页面提供这个.Mediawiki正在Windows XAMPP上运行.
是否有任何MediaWiki插件或更好的解决方案?
在线下我想传递一些build.xml变量.
我是这个项目的新手,它的代码没有任何记录器声明.遵循任何流程都是单调乏味且耗时的.
由于应用程序的异常处理框架,所有异常都属于一个常见的异常块,从那里追溯是非常麻烦的.
是否有任何Eclipse插件可以帮助我调试问题?我正在寻找类似于XCode的调试功能,它会停止导致异常的行的流量.你可以追溯到那个.
更新了我的问题.
注意:我正在使用Eclipse Juno并在开发AspectJ日志记录实用程序的过程中帮助我调试语句.
我有section divs自己的形式.每个部分可以有多个字段.它适用于Bootstrap 2.3 css.当我用Bootstrap 3.0 css替换它时,所有字段都来自div部分.我试过检查元素,但找不到任何区别.
CSS
.section {
position: relative;
margin: 15px 0;
padding: 39px 19px 14px;
background-color: #fff;
border: 1px solid #649300;
-webkit-border-radius: 4px;
-moz-border-radius: 4px;
border-radius: 4px;
}
Run Code Online (Sandbox Code Playgroud)
HTML
<div class="section" name="amount">
<span class="section-title">Amount Information</span>
<div class="span6 form-inline">
<label class="pocLabel">
Amount Of</label>
<input type="text" name="amount" required="">
</div>
<div class="span6 form-inline">
<label class="pocLabel">
Customer First Name</label>
<input type="text" name="firstName" required="">
</div>
<div class="span6 form-inline">
<label class="pocLabel">
Customer Last Name</label>
<input type="text" name="lastName" required="">
</div>
<div class="span6 …Run Code Online (Sandbox Code Playgroud) 找到最小的数字很容易.我发现很难在数组中找到一个大于零的最小数字.
public static int findSmallestOld(int[] arr) {
int smallest = arr[0];
for(int i=1; i<arr.length; i++) {
if(arr[i]<smallest) {
smallest = arr[i];
}
}
return smallest;
}
Run Code Online (Sandbox Code Playgroud)
几个示例输入可能是
{0,0,0,3}输出= 3
{0,1,0,4}输出= 1