我正试图在我的JSF应用程序中使用primefaces扩展ckEditor,正如这里所描述的那样。我将依赖项添加到我的pom.xml中
<dependency>
<groupId>org.primefaces.extensions</groupId>
<artifactId>primefaces-extensions</artifactId>
<version>4.0.0</version>
</dependency>我的观点是这样的:
<p:growl id="editorgrowl" showDetail="true" />
<pe:ckEditor id="editor" value="#{mbEditorController.content}"
toolbar="[['Cut','Copy','Paste','PasteText','PasteFromWord','-', 'SpellChecker', 'Scayt']]">
<p:ajax event="save"
listener="#{mbEditorController.saveListener}"
update="editorgrowl" />
</pe:ckEditor>这是控制器(托管bean):
@ManagedBean(name = "mbEditorController")
@ViewScoped
public class EditorView implements Serializable {
private static final long serialVersionUID = 6822767317343704211L;
private String content;
private String secondContent;
public EditorView() {
content = "Type in your text here...";
secondContent = "This is a second editor";
}
public void saveListener() {
content = content.replaceAll("\\r|\\n", "");
final FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_INFO, "Content",
content.length() > 150 ? content.substring(0, 100) : content);
FacesContext.getCurrentInstance().addMessage(null, msg);
}
public void secondSaveListener() {
secondContent = secondContent.replaceAll("\\r|\\n", "");
final FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_INFO, "Second Content",
secondContent.length() > 150 ? secondContent.substring(0, 100) : secondContent);
FacesContext.getCurrentInstance().addMessage(null, msg);
}
// getters, setters
}不幸的是,我看不到工具栏,但只能看到文本输入区域,正如您在下面的屏幕截图中看到的那样:

更新
我的控制台中有一个javascript错误:
http://localhost:8080/MyApp/javax.faces.resource/ckeditor/ckeditor.js.xhtml?ln=primefaces-extensions&v=4.0.0 Failed to load resource: the server responded with a status of 404 (Not Found)是什么导致了这个问题?我是不是遗漏了什么?
发布于 2016-05-30 12:33:25
添加以下依赖项:
<dependency>
<groupId>org.primefaces.extensions</groupId>
<artifactId>resources-ckeditor</artifactId>
<version>4.0.0</version>
</dependency>https://stackoverflow.com/questions/37520069
复制相似问题