Solved

isPostBack???

Posted on 2004-04-23
4
4,032 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
caughtSpeeding java challenge 16 136
Can't access image with tomcat/html 6 97
spring example non maven 4 87
login form jsp example 2 24
When you’re making plans to join the modern business race, you should analyze various details that may affect your results. Nowadays, millions of businesses are trying to grow into established and appreciated professional enterprises.
This tutorial shows how to create a greeting card by combining two image layers and a text layer on a PC using a free image editing app.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

776 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