Wednesday, 3 September 2014

Duplicate Form Request Interceptor In JAVA

Every project that we do, there are always some common requirement, that project must need to implement.
So one of the common requirement i want to discuss here is...

"duplicate form request submission"

In any project duplicate form request must be intercept and must be aborted, to avoid duplicate data or inconsistency.
In J2EE environment, we can achieve this functionality by using following resources-

  • Using Filter Class
  • Using Controller Class(Servlet)
Lets start creating.....

Presentation Tier Component (JSPs)

  • insertstudent.jsp
  • success.jsp
  • error.jsp

Controller Component (Filter)

  • DuplicateRequestInterceptor.class
  • StudentInsertServlet.class

Entries in Deployment Descriptor(web.xml)

  • web.xml

You have to include below code in all jsp page that are the part of your navigation, to stop duplicate form submission.

No comments:

Post a Comment