This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
I am trying to replace one of my JSP files with a servlet. I have taken the Java file that is generated by tomcat and placed its code within one of my classes. Ive done this before and it has worked fine. However, this one has a binding to another file, which i am using the following code for
although the exception is not actually pointing to the lines above, I think this is the cause of the problem.
This compiles fine but gives the following exception when called:
That's a really odd thing to be doing. Why are you doing things this way?
Joined: Sep 27, 2005
Hi, thanks for the reply. And sorry for the name thing.
Perhaps there is an easier way of doing this. My problem is that I have a log in screen which takes in a username and a password, once you enter these and submit it(to itself), it will not log you in, but will give u options to which site you are given permissions to access. Then you can log in from that screen.
Now.. I want to be able to log into these from an external html document. Which means that I will need to bypass the log in screen.
I am doing it this way as it will be easier later on to modify the actions performed when logging in.
Maybe there is an easier way you can think of? i have gone a few ways and hit many dead ends.
Joined: Sep 27, 2005
Ive been looking into this a little more now, and perhaps the problem is not caused by the setBinding at all. It is failing to see the FacesContext altogether.
The code above is the first place that a facescontext is used and cannot be found.
What I don't understand is why you are cutting and pasting JSP-generated servlet code into your own servlet. That way lies angst and madness. Why do you feel you need to do womthing this bizarre in order to achieve your functionality?
Just to echo what Bear is saying: please don't do this. They just don't work this way your code will be non portable and horrible to maintain, assuming you can even get it working. It is also not something we'll be likely to help you with.