This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
the way you are moving on here is not correct. you are treating your servlet class like a plain java class . a servlet will work only if it is being called by the container.
keep this in mind:
a servlet class becomes a servlet when the container calls the init(ServletConfig) method of the servlet by passing ServletConfig object .
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?
Farakh khan
Ranch Hand
Joined: Mar 22, 2008
Posts: 672
posted
0
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
JavaScript. There is nothing you can do on the server to affect the behavior of anything outside of the window/iframe that the response is being sent to.
Farakh khan
Ranch Hand
Joined: Mar 22, 2008
Posts: 672
posted
0
Bear Bibeault wrote:JavaScript. There is nothing you can do on the server to affect the behavior of anything outside of the window/iframe that the response is being sent to.
Thanks for your favorable reply
I tried a lot java scripts but as I am not good in Javascripts, unable to write. Can you help me to guide little bit
Thanks again & best regards
Farakh khan
Ranch Hand
Joined: Mar 22, 2008
Posts: 672
posted
0
Bear Bibeault wrote:JavaScript. There is nothing you can do on the server to affect the behavior of anything outside of the window/iframe that the response is being sent to.