Custom JSP taglib - widget for text files. Lets you add a simple text editor
to your web applications. For example the following code lets you edit a file /WEB-INF/web.xml
<%@ taglib uri="taglib.tld" prefix="e" %> <e:EditFile file="/WEB-INF/web.xml"/> and you will get this: Attributes className and style lets you provide custom CSS settings
for edit area. By default taglib uses build-in servlet for saving data. You have to describe
it in your web.xml file:
<servlet> <servlet-name>SaveFileServlet</servlet-name> <servlet-class>com.cj.edit.SaveFileServlet</servlet-class> </servlet> You can provide JavaScript callbacks for this saving procedure. Attribute
beforeSave describes a name for JavaScript function that will be called
at the beginning. Attribute afterSave describes a name for JavaScript function that will be called
at the end. So you can show/hide for example process indicator. Attribute callback
describes a name for JavaScript function lets you display/process a result of saving. This function accepts
text parameter indicates how many bytes were saved. A negative value means some error. For example:
<script language="JavaScript"> function f(amount) { if (eval(amount)<0) alert("Error!"); else alert("Success"); } </script> <e:EditFile file="myfile.jsp" callback="f"/> Also you can provide your own server-side script (servlet, JSP etc.) for
data saving (attribute action). This script (servlet) will get the following
parameters in HTTP POST:
Tags are: EditFile Body tag implements Edit File widget. Attributes are: 1) file describes an URI for your file.
for downloading: Library: editfiletag.jar Description: taglib.tld See also Coldtags suite - the largest collection of custom JSP tags.
|
Also in Coldtags:
|