Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

setBinding

 
R Mousavi
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64696
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"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
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64696
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's a really odd thing to be doing. Why are you doing things this way?
 
R Mousavi
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 64696
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic