Hi Stein,
You want - On first invocation of servlet call doPost() , and on second
invocation of the same servlet call doGet() .
I can suggest a HTML/JavaScript trick . Instead of having a usual Submit
button in the form, u can have two normal form buttons(say b1 & b2). On
onClick() event of b1 u will call -
function b1Click(form) {
form.action = "http://server/Servlet/someservlet"
form.method = "POST"
form.submit()
}
And, on onClick() of b2 u can call -
function b2Click(form) {
form.action = "http://server/Servlet/someservlet"
form.method = "GET"
form.submit()
}
If u want strict ordering for clicking b1 & b2(i.e click b1 after b2), u
can write some html/javascript for this. I can help the ordering problem
also if u want.
I hope, this should solve ur purpose.
--Mukul Gandhi
At 12:45 AM 7/12/99 +0200, you wrote:
>Hello,
>
>I'm writing my first servlet that actually to do something other then
>writing helloworld..
>
>This is a single servlet that do some database stuff in the doGet and
>doPost methods..
>
>After putting data into the database in doPost I want to call the doGet
>method, but then I just get the 'Repost form data' if the user reloads
>the page..
>
>I 'solved it' by redirecting after zero seconds, but there got to be a
>better way. Right?
>
>
>Stein
___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".
Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html