Win a copy of Think Java: How to Think Like a Computer Scientist this week in the Java in General forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Urgent Strange Problem, please help!

 
Stephen Wei
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello all.
I am encountering a strange problem, do not know what could be the cause. the user inputs some data and submits them to my mail servlet, then my mail servlet reads the input, and send out the mail. But I find that if my total size of input is greater than about 750 bytes, the server alsays returns me an error, and my servlet seems to be not able to read the input correctly.
Here is some of my rough codes, notice that I am doing code conferting, because the page contains Japanese characters.
On client side, here is my html.
<form action="../servlet/SurveyMail">
<p align="left"><font size="4"><strong>Subject:</strong></font><input
type="text" size="100" name="subject"></p>
<p align="left"><font size="4"><strong>Message:</strong></font><textarea
name="message" rows="20" cols="100"></textarea></p>
Here is some of my servlet code:
String subject = request.getParameter("subject");
subject = new String(subject.getBytes("ISO8859_1"), "JISAutoDetect");
String message = request.getParameter("message");
message = new String(message.getBytes("ISO8859_1"), "JISAutoDetect");
String fullMessage;
String to;
StringBuffer unsentList = new StringBuffer("");
int errorFlag = 0;
HttpSession session = request.getSession(true);
MailProcess mailer = new MailProcess();

try{
DbProcess dbManage = new DbProcess();
Vector vector = dbManage.getSurveyMemberEmailList();
for(int i=0; i<vector.size(); i++){
to = vector.elementAt(i).toString();
fullMessage = message + "\n\n" + "here is the link: " + surveypage;
Thread.sleep(5000); //sleep for 5 seconds;
mailer.sendMail(from, to, subject, fullMessage, mailHost, unsentList);

I am using tomcat3.3, servlet 2.2, JDK1.3, what is wrong with my code? any thing wrong with the threads?
Please comment, thanks.
 
Stephen Wei
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello all:
I think I may have found out what the problem is.
I did not specify the "POST" method for my form, so my form use the default "GET" method, which seems to limit the size of data to be submitted.
I will try to correct it, and test. If there is more problems, I will get back...
THanks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic