August 12th, 2008, 10:04 AM
[RESOLVED] Sending Data
Hi, I am very ( I mean very ) new to J2EE and web development. I have been working with J2SE for years now and I understand Java very well.
That being said, I have recently taken over a project that was being worked on by a co-worker who recently left the company. The project is running on Tomcat 5.5 and using Java 1.5 with AJAX, Hibernate, Struts and Tiles.
What I am trying to fix is a section of code where there is a page with a box for comments that the user of the web site can place whatever they want into. Sometimes they would like to place a + or % symbol in the comment box.
However, when they do so the symbols are not showing up on the other side. The reason is, they are using a POST command like a GET command and placing everything in the URL (yes all of the comment data is a key / value pair at the end of the URL).
Now, I am no web guru, but I do know that besides having character issues (reserved chars), there is that little limitation of 1024 characters...
Here is the code:
I have tried to place a key/value pair in the request.send("key=value") field to no avail. When I go into the execute method on the other end and try to retrieve the value based off of the key I get null.
function getDataDiv(urlString )
var url = doublecheckHost() + urlString +"&rand=" + (Math.random() * 5);
request.onreadystatechange = setDataDiv;
request.open("POST", url, true);
Can somebody recommend a fix for this, or something I can read that would give me a clue? I have been pouring over AJAX web pages and have found lots of suggestions, but none have worked thus far.
Click Here to Expand Forum to Full Width
This a Codeguru.com survey!