Solved

isPostBack???

Posted on 2004-04-23
4
4,042 Views
Last Modified: 2012-08-13
Hai,

Is there any function similar to the isPostBack of ASP.Net in JSP?

Vikram.V
0
Comment
Question by:vikram_1982
  • 2
4 Comments
 
LVL 9

Expert Comment

by:Nick_72
ID: 10898940
what does that function do?
0
 
LVL 7

Expert Comment

by:searlas
ID: 10900245
Not exactly, but a reasonable replacement for
if isPostBack...

would be:
if ( "POST".equals(request.getMethod()) ) {
...
}
0
 
LVL 35

Expert Comment

by:TimYates
ID: 10900336
0
 
LVL 9

Accepted Solution

by:
Nick_72 earned 20 total points
ID: 10900414
ah ok, the IsPostBack property can be used to determine if the page is submitted to itself. In that case, you can use both getMethod and getRequestURL to determine if the call came from the same page:

Lets say your pageURL is "http://somesite.com/page.html"

if ( "POST".equalsIgnoreCase(request.getMethod()) &&
   ((request.getRemoteURL() != null && 
      request.getRemoteURL().toString().equalsIgnoreCase("http://somesite.com/page.html")) {

    //you have a postback call :)
}
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Is your phone running out of space to hold pictures?  This article will show you quick tips on how to solve this problem.
Many businesses neglect disaster recovery and treat it as an after-thought. I can tell you first hand that data will be lost, hard drives die, servers will be hacked, and careless (or malicious) employees can ruin your data.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question