クラスMylistPage3 thatsはうまく動作します。なぜAttributeAppenderにエラーが発生しますか?コンストラクタを使用してページをインスタンス化できませんか?
public class MyListPage3 extends WebPage {
private static final long serialVersionUID = 1L;
Model<String> infostringMdl = Model.of("Info: -");
Model<String> classModelOfMsg = Model.of("btn btn-success btn-lg btn-block");
Label infolabel = new Label("info", infostringMdl);
public MyListPage3(final PageParameters parameters) {
infolabel.setOutputMarkupId(true);
infostringMdl.setObject("Hello World");
classModelOfMsg.setObject("btn btn-success btn-lg btn-block");
//infolabel.add(new AttributeAppender("class", classModelOfMsg, " "));
add(infolabel);
}
}
HTML:
...
<table>
<tr>
<td width:="50%"><span wicket:id="info"
class="btn btn-default btn-lg btn-block">info here</span></td>
</tr>
</table>
...
私は、Javaとスパンのクラスを設定したいのですが、ラインで...
infolabel.add(new AttributeAppender("class", classModelOfMsg, " "));
...私はエラーを取得します:
WicketMessage: Can't instantiate page using constructor public Pages.MyListPage3(org.apache.wicket.PageParameters) and argument
Root cause:
java.lang.ClassNotFoundException: org.apache.wicket.behavior.Behavior
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
...
...
私はmvn依存関係を実行します。ツリー 結果は
[INFO] ------------------------------------------------------------------------
[INFO] Building WicketExamples 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ WicketExamples ---
[INFO] com.mkyong.core:WicketExamples:war:1.0-SNAPSHOT
[INFO] +- org.apache.wicket:wicket-core:jar:6.21.0:compile
[INFO] | +- org.apache.wicket:wicket-util:jar:6.21.0:compile
[INFO] | \- org.apache.wicket:wicket-request:jar:6.21.0:compile
[INFO] +- org.codehaus.jackson:jackson-mapper-asl:jar:1.8.5:compile
[INFO] | \- org.codehaus.jackson:jackson-core-asl:jar:1.8.5:compile
[INFO] +- org.apache.wicket:wicket:jar:1.4.17:compile
[INFO] +- de.agilecoders.wicket:wicket-bootstrap-core:jar:0.8.3:compile
[INFO] | +- de.agilecoders.wicket.webjars:wicket-webjars:jar:0.2.0:compile
[INFO] | | \- org.webjars:webjars-locator:jar:0.1:compile
[INFO] | | +- org.reflections:reflections:jar:0.9.8:compile
[INFO] | | | +- javassist:javassist:jar:3.12.1.GA:compile
[INFO] | | | \- dom4j:dom4j:jar:1.6.1:compile
[INFO] | | | \- xml-apis:xml-apis:jar:1.0.b2:compile
[INFO] | | \- commons-lang:commons-lang:jar:2.6:compile
[INFO] | +- org.webjars:bootstrap:jar:2.3.1-1:compile
[INFO] | | \- org.webjars:jquery:jar:1.9.0:compile
[INFO] | +- org.webjars:modernizr:jar:2.6.2-1:compile
[INFO] | +- joda-time:joda-time:jar:2.0:compile
[INFO] | +- com.google.guava:guava:jar:14.0.1:compile
[INFO] | \- org.apache.wicket:wicket-extensions:jar:6.21.0:compile
[INFO] +- de.agilecoders.wicket:wicket-bootstrap-extensions:jar:0.8.3:compile
[INFO] | +- com.google.javascript:closure-compiler:jar:v20130411:compile
[INFO] | | +- args4j:args4j:jar:2.0.16:compile
[INFO] | | +- com.google.protobuf:protobuf-java:jar:2.4.1:compile
[INFO] | | +- org.json:json:jar:20090211:compile
[INFO] | | \- com.google.code.findbugs:jsr305:jar:1.3.9:compile
[INFO] | \- org.webjars:jquerypp:jar:1.0b2:compile
[INFO] +- de.agilecoders.wicket:wicket-bootstrap-themes:jar:0.8.3:compile
[INFO] +- org.slf4j:slf4j-log4j12:jar:1.5.6:compile
[INFO] | \- log4j:log4j:jar:1.2.16:compile
[INFO] +- junit:junit:jar:4.10:test
[INFO] | \- org.hamcrest:hamcrest-core:jar:1.3:test
[INFO] +- org.mockito:mockito-all:jar:1.8.5:test
[INFO] +- javax.servlet:servlet-api:jar:2.5:provided
[INFO] +- org.slf4j:slf4j-api:jar:1.6.4:compile
[INFO] \- org.slf4j:jcl-over-slf4j:jar:1.6.4:test
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.473 s
[INFO] Finished at: 2016-04-12T20:10:30+02:00
[INFO] Final Memory: 18M/226M
[INFO] ------------------------------------------------------------------------
ここでは何が問題になりますか?
org.apache.wicket:wicket:jar:1.4.17ここではエラーの原因は?
私はテストページを作成しました..すべてが問題ありません。 – sanluck
あなたのコメントSanluckに感謝します。あなたのpom.xmlのWicketの設定はどうですか? – Ullzy