An optimal solution for resolving double form submission problem using Struts:
DispatchStrutsAction
--------------------
package com.myapp.struts;
public class DispatchStrutsAction extends DispatchAction {
private final static String LOGINSUCCESS = "loginsuccess";
private final static String LOGINPAGE = "loginpage";
public ActionForward beforeLogin(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
this.saveToken(request);//save token before showing Login.jsp
return mapping.findForward(LOGINPAGE);
}
public ActionForward login(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
if(this.isTokenValid(request)){
resetToken(request);
}else if(!this.isTokenValid(request)){
System.out.println("Page Resubmit");
}
return mapping.findForward(LOGINSUCCESS);
}
}
Sunday, November 8, 2009
Handling double form submission problem with Struts
Thursday, October 8, 2009
Solution for Double form submission problem
Here is an optimal solution for double form submission problem using open source jQuery javascript library:
$(’form’).submit(function(){
$(this).find(”input[type='image'],input[type='submit']“).click(function(){
return false;
});
});
$(’form’).submit(function(){
$(this).find(”input[type='image'],input[type='submit']“).click(function(){
return false;
});
});
Wednesday, July 29, 2009
Virtual reality Machinima
This is way in advance so if you have seen Matrix movie you will know this. VR Machinima where computer signals are connected with your brain and display is like you are in virtual world. User will be sitting on a VR chair. All the actions done by the user will be applied in the virtual world. So playing games like driving a Nascar in VR world
Monday, June 15, 2009
Eclipse Maven m2eclipse native2ascii bug
Maven m2eclipse plugin has a very annoying bug which does not allow native2ascii ANT task to work properly.
This can be resolved as follows:
To make it working download the latest Maven installation from http://maven.apache.org/download.html and in Eclipse point your m2eclipse plugin to use this external runtime instead of the embedded installation. This can be set as follows:
Window-->Preferences-->Maven-->Installations-->click add and point to your Maven installation directory-->Check external and click ok
Note: To build project using Maven first goto Run configurations and select Maven Runtime: External.
This can be resolved as follows:
To make it working download the latest Maven installation from http://maven.apache.org/download.html and in Eclipse point your m2eclipse plugin to use this external runtime instead of the embedded installation. This can be set as follows:
Window-->Preferences-->Maven-->Installations-->click add and point to your Maven installation directory-->Check external and click ok
Note: To build project using Maven first goto Run configurations and select Maven Runtime: External.
Virtual Copying
Copy-Paste on different computers in same wireless network:
Have you ever tried to copy from one computer and paste on another computer you are working on, by mistake?
This is possible! If both your computers on which you are working are on same wireless network and have the copy-paste utility installed.
Have you ever tried to copy from one computer and paste on another computer you are working on, by mistake?
This is possible! If both your computers on which you are working are on same wireless network and have the copy-paste utility installed.
Subscribe to:
Posts (Atom)