create mapping in the DD for the second servlet .
for ex : /serv2
now your first servlet should be
but i think you will have to change a lot of code. its better to start from scratch for these two servlets and you should keep your business logic outside the servlet.
create a java file for database related works and call it from the servlet
The referer isnt a mandatory field and usually only available if the client sends it - if the request originates from a link or resource. Direct requests do not contain a referrer. The referer field can be stripped from the HTTP header by a proxy or firewall. Session and request scoped attributes are a better solution.
Even after all these posts, I still have no good idea what is trying to be accomplished. And yes, relying upon the unreliable "referer" probably dooms it to failure.
Perhaps the actual goal might be posted at some point?
Joined: Mar 22, 2008
Thankful to all professionals who helped me and beared me
Actually the origional problem is this that I have an iFrame in all pages of the website that have source (/servlet/User). This servlet checks that if the user logged in successfully then displaying control panel else displaying html static contents to log in with action /servlet/Login
Login.java matches the login/pass from db and if ok then redirect to /servlet/User
Now the problem is this that when am redirecting any file then it displayed in iFrame instead of main page and I am unable to redirect my user from where they are comming