In this tutorial , we will discuss how to display text ,saved in a text file using JSP & jQuery. In this example, the content of the text file is fetched and display on the browser. The html file contains a text area and a button. On clicking button, jQuery requests JSP for text saved in text file ,which it will display in the text area provided.
Code for the html file(jqDisplaycontent.html) :
<head> |
JSP Code(includetxt.jsp)
<%@ page import="java.io.*" %> |
Content of the text file (rose.txt):
| Welcome to RoseIndia.Net jQuery Tutorial Learn how you can do a lot of work with small code. jQuery is here to help us in achieving high result with less coding. jQuery is great!!!! |
OUTPUT :

After clicking button :
