• Post Reply Bookmark Topic Watch Topic
  • New Topic

Rookie question on request variable

 
peter daalder
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi

I'm from another world ;-), but i have (and want) to implement a java solution within my world (Peoplesoft). From within my code I'm able to instantiate classes, and use their methods (there are limits though).

Now what I'm trying to do is build a class (wrapper) that will do somethings for me that I'm unable to do in my world. Currently my class looks like



Obvious this will not implement the functionality that I'm looking for, but the class i'm working on won't compile because it is unable to find request (and response). The code that I'm trying to build a wrapper for is coming from a JSP. I understand the functionality behind the request/response variables, but I wonder how you can make these variables available within a class that you want to compile (I do this with "javac -classpath <dir/jars> test.java)

Any tips one what is and isn't possible is much appreciated.

 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The servlet and JSP API jars are provided with whatever servlet container you plan to use. For example, Tomcat will provide them in its /lib folder.

However, your class possesses a main method. That indicates that it is a standalone Java application and that will not work in conjunction with the servlet container.

You'll need to elaborate on what you are trying to accomplish because what you've got so far is a dead end.
 
peter daalder
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Basically I need to intregrate OpenAM with Peoplesoft. I only need to integrate the return part.

A user connects to the webserver for Peoplesoft, and will be presented with a jsp page that will send them to the IDP to authenticate. Once authenticated the IDP will redirect the user back to the application. Currently this application is a JSP page, however I would prefer to remove that layer, and directly integrate it with Peoplesoft.

This means I need from within Peoplesoft to access the classes (there are a bunch of them) directly, or a class that works as a wrapper. As I'm able to access the java classes from within Peoplesoft and I don't want to over complicate the work within Peoplesoft (reduce the risk of errors), I prefer the 2nd option. The code below is from the JSP that acts as the application in the OpenAm solution. This code needs to be available by a wrapper class, or by a direct call. The first 'try' line uses the request/response object. As this was failing I thought to strip the code, and focus on understanding how these objects work. I've learned that these are 'special' variables. I'm sorry to ask such basic question, but I haven't done much Java yet, so obvious that the main part is there as all tutorials are starting with this ;-).

Just tell me if what I'm doing is feasible in Java or not. I don't have that insight (yet), however I would believe you can call the response/request variables from within a package. I would be surprised that these variables are only available with a *.jsp file.

 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
108
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How is the JSP activated from the system? If it's by making an HTTP request, the JSP can easily be replaced by a servlet that responds to the same URL (whichis preferable -- these days Java code ina JSP is a huge no-no).

But only a servlet running in a servlet container (just as the JSP is now), will do. A general Java class cannot be used.
 
peter daalder
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well because of your previous hint, I worked it out. I'm able to call the java class, but unfortunately I don't think I will have the request object. As the time this class is called, the executer is not anymore at the webserver level, but at an application server level. I'm not yet giving up, but I have this feeling that it isn't gonna be easy. anyway it isn't easy for me. Fortunately some colleague of mine has some more java knowledge, and he will help me out next week

Thanks a lot for your earlier response, this is what I need to proceed. If I do get it to work, I will drop the results and I hope you don't mind to give me your feedback on it.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65530
108
IntelliJ IDE Java jQuery Mac Mac OS X
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!