Experts,
I have a JSP form page which has Text Area field.I have a string contains 300 lines. when I paste the content in text area field, it accepting the content.but when i submit the form, page got stuck there only and not moving to servlet.
If I give less than 50/60 lines. its accepting and moving the content to servlet. Any pointers would help how to achieve getting this 300 lines of content to servlet from jsp.
here is my index.jsp
<form id="form1" name="form1" action="FirstwebServlet">
<div id="textAreaField" style="display: none;" >
<textarea rows="50" cols="50" id="textAreaField" name="textAreaField">Please pass your custom filter in Standard format. please refer HyperLink for the format.</textarea>
</div>
</form>
-------------------------------------------------------------------------
My servlet on submitting this index.jsp form will be called and it has the below code
In FirstwebServlet this is the code,
StringBuffer test= new StringBuffer(request.getParameter("textAreaField"));
System.out.println("get the TextAreaFieldValue: "+test);
My string test has 300 lines of string. Its not working.
--------------------------------------------------------------------
What I have tried:
I tried the same with html and its working. not sure if the servlet doesn't have the capability or not. Please advise.
index.jsp
<HTML>
<HEAD>
<TITLE>Submitting Text Areas</TITLE>
</HEAD>
<BODY>
<H1>Submitting Text Areas</H1>
<FORM ACTION="formAction.jsp" METHOD="POST">
Please enter your text:
<BR>
<TEXTAREA NAME="textarea1" ROWS="5"></TEXTAREA>
<BR>
<INPUT TYPE="SUBMIT" VALUE="Submit">
</FORM>
</BODY>
<HTML>
-----------------------------------------------------------------------------
formAction.jsp
<HTML>
<HEAD>
<TITLE>Reading Text Areas</TITLE>
</HEAD>
<BODY>
<H1>Reading Text Areas</H1>
You typed:
<BR>
<%
StringBuffer text = new StringBuffer(request.getParameter("textarea1"));
int loc = (new String(text)).indexOf('\n');
while(loc > 0){
text.replace(loc, loc+1, "<BR>");
loc = (new String(text)).indexOf('\n');
}
out.println(text);
%>
</BODY>