• 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

information exchange by unrelated classes owned by different users

 
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello
Basically what I want to do is write a servlet that outputs a wml page that will tell me if I have new mail or not. The problem is that all servlets are run as the apache user instead of as me so all processes will be run as apache processes, ie 'frm -S -q' will say whether apache has been mailed anything and not me.
To solve this I do not wish to save the relavent information to a file and have apache access the file, I want the servlet to pass a string to a class run by my account and this class will return a string with the proper results. I do not have access to sockets on the system, but the class wouldn't really be remotely accessed anyway.
What I want to know is the way(if there is one) to comunicate between classes if they're not compiled together or part of the same package or even owned by the same user. I've looked at using Objectoutput/inputstream but it seems to use an intermediary socket which I don't have access to.
Sorry if this is the wrong board to post this, but I don't think it's really a servlet question..
Thanks,
Brendan
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Brendan
I may have completely missed your point but I think that all you're after doing is getting a parameter off of the http request and passing it along to another class that you've defined. If so then you have two immediate choices:
1) Build the url manually and use a http 'get' e.g. http://myserver/myPage.html?myParam=myVar
2) Include a form in the page and set the action url to the servlet's url, (thus using post)
You may need more than one param and if so you may find holding a cookie at the client that is then used to recreate the state of the server-side process more appropriate.
The fact that the classes have not been built/compiled together should not affect you at all.
Hope that this helps some
 
Brendan Kennedy
Ranch Hand
Posts: 65
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for replying
I'm not too knowlegable about cookies or what they can do - but I'll research it and see if they can help.
As far as I can see though nothing really should be happening client side except to initiate the servlet and recieving the wml data. Some of the info sent back that I want can only be gotten by running processes with my uid (basically from my account).
The problem is that all processes run by apache have the apache uid so the relavent information can't be obtained. The way I want to get around it is by haveing a class that was initiated by me in my account (and thus having my id) interact with the servlet and get the information back that way. I was wondering if there was a way to do this without using sockets(which I don't have access to) or periodically updating a text file.
I posted this on the servlet board just in case and was told to check out the Java mail api but it doesn't sound like solution I want :/
Any further comments would be greatly appreciated
Thanks,
Brendan
reply
    Bookmark Topic Watch Topic
  • New Topic