aspose file tools*
The moose likes Servlets and the fly likes setBinding Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "setBinding" Watch "setBinding" New topic
Author

setBinding

R Mousavi
Greenhorn

Joined: Sep 27, 2005
Posts: 7
Hi,

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:


Could anybody help me?

Thanks in advance.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61654
    
  67

"Reza",

There aren't may rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks!
bear
Forum Bartender


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61654
    
  67

That's a really odd thing to be doing. Why are you doing things this way?
R Mousavi
Greenhorn

Joined: Sep 27, 2005
Posts: 7
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.

Cheers.
R Mousavi
Greenhorn

Joined: Sep 27, 2005
Posts: 7
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.

Any ideas why this is??
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61654
    
  67

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?
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

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.
 
 
subject: setBinding