Hi @akatsuki07 ,
There has to be a logic based on which the page should redirect. To check if the product is out of stock, the call has to go to the server to get the count. Dispatcher won't be able to handle this since there is no identifier that dispatcher would have for out of stock product.
You can handle this logic in your client side code (javascript) if the product component is using ajax. From there is the response for it is out of stock you can forward the request in js snippet using
window.location.href="target page path"
Else you can handle it in model class or servlet.