Click here to Skip to main content
16,007,814 members
Home / Discussions / Java
   

Java

 
AnswerRe: Paint problem in java Pin
TorstenH.19-Oct-10 23:12
TorstenH.19-Oct-10 23:12 
QuestionRe: Paint problem in java Pin
tamash_ionut20-Oct-10 10:45
tamash_ionut20-Oct-10 10:45 
AnswerRe: Paint problem in java Pin
TorstenH.21-Oct-10 23:00
TorstenH.21-Oct-10 23:00 
QuestionGlassfish Deployment error Pin
JDragon31415919-Oct-10 11:09
JDragon31415919-Oct-10 11:09 
AnswerRe: Glassfish Deployment error Pin
Richard MacCutchan19-Oct-10 23:17
mveRichard MacCutchan19-Oct-10 23:17 
AnswerRe: Glassfish Deployment error Pin
TorstenH.19-Oct-10 23:31
TorstenH.19-Oct-10 23:31 
GeneralRe: Glassfish Deployment error Pin
Richard MacCutchan20-Oct-10 1:24
mveRichard MacCutchan20-Oct-10 1:24 
QuestionProcessing JSP-Form using Servlet using AJAX Post method Pin
khurram_shahzad17-Oct-10 7:17
khurram_shahzad17-Oct-10 7:17 
I am trying to process data by servlet sended by jsp form using AJAX..... with 'GET' method its working okey ... but using 'POST' method to do this creating problem that onreadystatechage condition not exectue at (xmlhttp.readyState==4 && xmlhttp.status==200)
xmlhttp.onreadystatechange=function() {
                    if (xmlhttp.readyState==4 || xmlhttp.status==200) {
                        alert("state=4 OR 200"); //for testing...
                        //document.getElementById("myDiv").innerHTML=xmlhttp.responseText;
                        document.getElementById("TextChatHistory").value = xmlhttp.responseText;
                    }
}


i tryed to solve this too much .... but i cant .... Any one plz help me ..... THANK ...

COMPLETE PROGRAM CODE IS GIVEN BELOW,

JSP_CODE
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%--@page import="java.util.Timer.*, java.util.TimerTask.*"
    Timer timer;
--%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>

        <script type="text/javascript" >
            function AjaxFunction() {
                xmlhttp = null;
                if(window.XMLHttpRequest) {
                    xmlhttp = new XMLHttpRequest();
                    //alert("alert_Browser");
                } else {
                    xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
                    //alert("alert_ActiveX");
                }
                xmlhttp.onreadystatechange=function() {
                    if (xmlhttp.readyState==4 || xmlhttp.status==200) {
                        alert("state=4 OR 200"); //for testing...
                        //document.getElementById("myDiv").innerHTML=xmlhttp.responseText;
                        document.getElementById("TextChatHistory").value = xmlhttp.responseText;
                    }
		}
                xmlhttp.open("POST", "TextChat", true);
                var Parameter_MsgSType = "msgText=" + document.getElementById("msgText").value;
                alert(Parameter_MsgSType);  //for testing...
                xmlhttp.setRequestHeader("Content-type","application/x-www-form-urlencoded");
                xmlhttp.setRequestHeader("Content-lenght", Parameter_MsgSType.lenght);
                xmlhttp.setRequestHeader("Connection", "close");
                xmlhttp.send(Parameter_MsgSType);
                alert("Ajax fuinction finished");   //for testing...
            }
        </script>

    </head>
    <body>
        <!--<h1>Hello JSP!</h1>-->
        <div id="myText"></div> <!--for testing...-->
        <form name="TextChat" method="post" action="" >
            <textarea cols="50" rows="10" readonly id="TextChatHistory" name="TextChatHistory" >TextChat History</textarea>
            <br />
            <textarea cols="50" rows="3" id="msgText" >Enter Text</textarea>
            <select name="SentToType">
                <option value="p">Presentor</option>
                <option value="h">Host</option>
                <option value="a">Attendee</option>
                <option value="l">All</option>
            </select>
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <input type="submit" value="SEND" onclick="AjaxFunction()" />
        </form>
    </body>
</html>

Questionhelp required Pin
Nima Dorji15-Oct-10 5:30
Nima Dorji15-Oct-10 5:30 
AnswerRe: help required Pin
Richard MacCutchan15-Oct-10 6:00
mveRichard MacCutchan15-Oct-10 6:00 
QuestionSwing equivalent in java mobile Pin
trioum14-Oct-10 8:03
trioum14-Oct-10 8:03 
AnswerRe: Swing equivalent in java mobile Pin
Nagy Vilmos14-Oct-10 21:51
professionalNagy Vilmos14-Oct-10 21:51 
QuestionProblem in learning AJAX with PHP Pin
khurram_shahzad13-Oct-10 11:04
khurram_shahzad13-Oct-10 11:04 
AnswerRe: Problem in learning AJAX with PHP Pin
Richard MacCutchan13-Oct-10 11:43
mveRichard MacCutchan13-Oct-10 11:43 
GeneralRe: Problem in learning AJAX with PHP Pin
khurram_shahzad14-Oct-10 5:57
khurram_shahzad14-Oct-10 5:57 
QuestionDividing a text file into variable size chunks using Rabin fingerprint algorithm in java Pin
LOKESHWARI13-Oct-10 2:14
LOKESHWARI13-Oct-10 2:14 
AnswerRe: Dividing a text file into variable size chunks using Rabin fingerprint algorithm in java Pin
Cedric Moonen13-Oct-10 3:13
Cedric Moonen13-Oct-10 3:13 
QuestionDeveloping a Multitenant Application in Java Pin
sangeetha_spss12-Oct-10 3:03
sangeetha_spss12-Oct-10 3:03 
AnswerRe: Developing a Multitenant Application in Java Pin
Richard MacCutchan12-Oct-10 5:46
mveRichard MacCutchan12-Oct-10 5:46 
GeneralChossing a best option Pin
krishnareddy03612-Oct-10 1:46
krishnareddy03612-Oct-10 1:46 
GeneralRe: Chossing a best option Pin
DaveAuld12-Oct-10 1:56
professionalDaveAuld12-Oct-10 1:56 
GeneralRe: Chossing a best option Pin
jschell15-Oct-10 8:38
jschell15-Oct-10 8:38 
Questioncalling servlet in background from jsp Pin
khurram_shahzad10-Oct-10 7:16
khurram_shahzad10-Oct-10 7:16 
AnswerRe: calling servlet in background from jsp Pin
Richard MacCutchan10-Oct-10 8:50
mveRichard MacCutchan10-Oct-10 8:50 
AnswerRe: calling servlet in background from jsp Pin
Member 324727611-Oct-10 21:45
Member 324727611-Oct-10 21:45 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.