JSP Ewebeditor Use Description _ Web page Editor

Source: Internet
Author: User
Tags file upload
<display-name>defaultroot</display-name>
<servlet>
<servlet-name>debugjsp</servlet-name>
<description>added to compile JSPs with debug info</description>
<servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
<init-param>
<param-name>classdebuginfo</param-name>
<param-value>true</param-value>
</init-param>
<load-on-startup>3</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>debugjsp</servlet-name>
<url-pattern>*.jsp</url-pattern>
</servlet-mapping>
Copy to the web-inf/web.xml in your application;
3, the Web-inf under the Style.xml and Button.xml copy to your application Web-inf directory;
4, the Ewebeditor/web-inf/lib under the Dom4j.jar and Jspsmartupload.jar package copy to your application web-inf/lib;
Note: Net.jar for the ewebeditor of the original/web-inf/classes under the class file, I put it packaged and put into the application of the LIB, lest with other class confusion;
5, in the code you want to invoke the editor to add:
<iframe id= "EWebEditor1" name= content_html "src=". /ewebeditor/ewebeditor.jsp?id=content&style=standard "frameborder=" 0 "scrolling=" no "width=" 650 "height=" 350 " ></IFRAME>
<input type= "hidden" name= "content"/>
Before <script language= "JavaScript" >
function Subchk ()//
{
Document.form1.content.value= Window.content_html.getHTML ();
}
</script>
Trigger this function when submitting a form
Copy the value in the Ewebeditor to your form and call it in your form:
<form name= "Form1" onsubmit= "Subchk ()" >
6, restart the server can be.
Second, set up:
Interface modification: Generally only modify the/web-inf directory below the Style.xml and button.xml on it, button.xml for the editing interface configuration file, if the menu display is not complete, you can modify the size inside.
====================================================
Upload Image Path settings:
Default upload default directory for xx/upload/,xx for your root directory
Here to set the upload file save path, note that the path to be started by root ===3 place ======================
Modify here to modify the Web-inf/style.xml file correspondence <suploaddir>/upload/</suploaddir>
Modify here to modify ewebeditor.jsp file correspondence
Modify here to modify upload.jsp file correspondence
For example, to upload to the root directory under/upload/:
In upload.jsp
String suploadfilepath= "/upload/";
In Style.xml
<suploaddir>/upload/</suploaddir>
In ewebeditor.jsp
String suploadfilepath= ".. /upload/"//Set File upload image display address in Ewebeditor Editor
That's good.
Modify upload file size limit, in Web-inf/style.xml
<sfilesize>2000</sfilesize>//Other file sizes
<sflashsize>500</sflashsize>//flash File Size
<sremotesize>1000</sremotesize>//Publish content Size
<simagesize>1000</simagesize>//picture File size
<smediasize>1000</smediasize>//Multimedia File Size
Precautions :
1, just deploy or debug when the file cannot be uploaded, you can modify the ewebeditor.jsp
String suploadfilepath= ".. /upload/"; Value or modify the characters in the file, refresh after changing back to normal, you can resume uploading;
2, if the use of UTF-8 encoding, you need to call the JSP page head to join the content-type= "text/html;" Charset=utf-8 ", do not use filter to Ewebeditor uniform" UTF-8 "or coding other than gb2312;
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.