Hi I solved it.
It just have to Implement the security check in a servlet and add URL to that servlet into the form's action field with a parameter that represent URL to the page that you want to be the next page after log on. Then in the security check servlet reads username, password and nextPageURL and do the necessary operation with them.
Thanks Mallikarjun your comment was helped me.
subject: How specify the next page after form log on.