Java Autopostback?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Vittorix

    #1

    Java Autopostback?

    Hi everybody,

    I'm writing a web server in Java for html and servlets.
    when the server receives a GET request, it works fine.

    problem: when I use POST, the server program stops and the submit button has
    to be clicked another time or the page has to be manually refreshed (after
    that it works fine).
    so, the program waits for the client to send a new signal/request.
    The problem is caused by a in.readLine() statement:

    if(method.equal s("GET") && URI.contains("? "))
    paraLine = URI.substring(U RI.indexOf("?") +1, URI.length());
    else if(method.equal s("POST"))
    paraLine = in.readLine(); // in the POST request, the parameters are
    in the http request body

    how to avoid that?

    --
    ciao
    Vittorix


Working...