• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

setBinding

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
reply
    Bookmark Topic Watch Topic
  • New Topic