You continue to "swing" (in this case, throw) until you score a legal hit. Note that Prepare to Die skills continue to work even if you switch weapons - so if you are holding a javelin, throw it and miss, then pull out a sword, you may still swing your PTD skill until it hits.
-Bryan