This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
You should isolate the code into a separate class that is testable outside of the your JSP. Please please please take notice of the traps article and make sure that you pay proper attention to the quoting of file names,
Can you give more information than "it is not working..."?
What happens when you run it?
Do you get an error message?
Does it complete, but not do what you expect?
Does it put too much sugar in your coffee?
My second question would be - why do you need to trigger an external operation in this manner?
Doing so normally smacks of bad design. What does calling this windows specific batch file accomplish that you can't do in java?