FCKeditor controls please go to the official website to download some of the content in the http://www.fckeditor.net idea, readers can download.
1. Open the compressed package fckeditor_2.6.3.zip, copy the FCKeditor folder to the WEB-INF, which can be directly used later.
2. There are two ways to use FCKeditor on the page.
Method 1: Javascript
(1) for direct use, seeMethod1.html
- <! Doctype HTML public "-// W3C // dtd html 4.01 transitional // en">
- <HTML>
- <Head>
- <SCRIPT type = "text/JavaScript" src = "FCKeditor/FCKeditor. js"> </SCRIPT>
- </Head>
- <Body>
- Method 1: Implement editor import through javascript <br>
- <SCRIPT type = "text/JavaScript">
- VaR ofckeditor = new FCKeditor ('fckeditor1 ');
- Ofckeditor. basepath = "FCKeditor /";
- // Ofckeditor. basepath = "/fckedittest/FCKeditor /";
- Ofckeditor. width = "50% ";
- Ofckeditor. Height = "400 ";
- Ofckeditor. value = "Initial Value ";
- // Ofckeditor. toolbarset = "Basic ";
- // The default value is default.
- Ofckeditor. toolbarset = "default ";
- Ofckeditor. Create ();
- </SCRIPT>
- <HR>
- </Body>
- </Html>
(2) PassTextarea, see method2.html
- <! Doctype HTML public "-// W3C // dtd html 4.01 transitional // en">
- <HTML>
- <Head>
- <SCRIPT type = "text/JavaScript" src = "FCKeditor/FCKeditor. js"> </SCRIPT>
- <SCRIPT type = "text/JavaScript">
- Window. onload = function (){
- VaR ofckeditor = new FCKeditor ('Mytextarea');
- Ofckeditor. basepath = "FCKeditor /";
- // Ofckeditor. basepath = "/fckedittest/FCKeditor /";
- Ofckeditor. replacetextarea ();
- }
- </SCRIPT>
- </Head>
- <Body>
- Method 2: Implement editor import through textarea <br>
- <Textarea rows = "4" Cols = "60" name ="Mytextarea"> This is a value </textarea>
- </Body>
- </Html>
Method 2: Use FCKeditor on tags
Before using tags, you need to build an environment. Copy the slf4j-simple-1.5.2.jar in idea to the lib directory and build the environment.
After the construction, you can use it on the JSP page. See method_jsp.jsp.
- <% @ Page Language = "Java" Import = "Java. util. *" pageencoding = "UTF-8" %>
- <% @ Taglib uri = "http://java.fckeditor.net" prefix = "fck" %>
- <! Doctype HTML public "-// W3C // dtd html 4.01 transitional // en">
- <HTML>
- <Head>
- <Title> method_jsp.jsp </title>
- </Head>
- <Body>
- In earlier versions, the value attribute of FCKeditor must be specified and the value cannot be blank.
- The version 2.6.3 has been resolved.
- <Fck: Editor InstanceName = "myeditor" basepath = "/FCKeditor"> </fck: Editor>
- </Body>
- </Html>
The effect is as follows: