determining if the page is postback

How can I determine if the page is loading or posted ?(something like IsPosBack in ASP.NET)
[105 byte] By [xyzta] at [2007-11-27 5:15:14]
# 1
If the referrer is the same as the current page.
BalusCa at 2007-7-12 10:37:23 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
how can i get the referrer page?
xyzta at 2007-7-12 10:37:23 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 3
ok i found ..:request.getHeader("referer")
xyzta at 2007-7-12 10:37:23 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 4
referer page is not good i think. because when the page is posted it is enlarged with the query string..isn't there a more accurate way to understand if the page is post back?
xyzta at 2007-7-12 10:37:23 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 5
Strip the query string from the referrer URI then. Or use POST instead of GET, then we can talk about postbacks.
BalusCa at 2007-7-12 10:37:23 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 6

> How can I determine if the page is loading or posted

> ?

> (something like IsPosBack in ASP.NET)

I don't know .Net so I don't know about the IsPosBack.

However , if you lookup HttpServletResponse here http://java.sun.com/javaee/5/docs/api/

there's a isCommitted method.

Perhas if response is committed on the the target page (the page which is in the action attribute of the form's post) then , isCommitted is set to true.

I havent tried this but it doesn't hurt if you experiment with it.

appy77a at 2007-7-12 10:37:23 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 7
A postback is a form submit to self, not to another page.
BalusCa at 2007-7-12 10:37:23 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...