Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Passing user defined java objects to a JSP page without using session  RSS feed

 
suj666 Nair
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to pass a user defined object to my JSP page.<BR>The hinderence being I cannot use sessions.<BR>The user defined object contains data and when instantiated at my JSP page the value turns out to be null.<BR>When I test the user objects from a stand alone application it contains all the data . But this data vanishes when I call the same object from a JSP
 
Adam Hardy
Ranch Hand
Posts: 567
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It depends where you are instantiating your user defined object. If you are instantiating it in a servlet, you can pass it to the JSP as an attribute on the request when you forward to the JSP or include the JSP.
 
suj666 Nair
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry ,but I have another constraint too in this workflow project I cannotuse servlets as the IBM MQ series workflow Webclient uses Model view controller architecture. There by resulting that I cannot write and add any servlet,So I need to just use Java beans for the business logic and JSP as the front end of program activites.Thus I need to pass user defined objects to and fro between the bean and JSP
 
Adam Hardy
Ranch Hand
Posts: 567
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Let me get this straight. When you run this as part of a stand-alone application, you instantiate the bean and call one of its get methods, and you get the data. When you instantiate the bean in a JSP, the call to the bean returns null?
If that's the case there is obviously something unknown happening inside your bean that you are not allowing for in your code. What about your error handling? What does the bean do with exceptions? Do you log anything?
Or are you already sure that there is something wrong that the JSP page is doing or causing, like not picking up parameters or something?
Adam
 
Junilu Lacar
Sheriff
Posts: 10948
158
Android Debian Eclipse IDE IntelliJ IDE Java Linux Mac Spring Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by suj666 Nair:
Sorry ,but I have another constraint ...I cannotuse servlets ...I cannot write and add any servlet,So I need to just use Java beans for the business logic and JSP as the front end of program activites.

JSPs are essentially servlets. JSPs are the source code for servlets automagically generated by the Servlet engine.
If you post some of the JSP and JavaBean code that you're having trouble with we would have a better idea of how to fix your problem.
Junilu
[This message has been edited by JUNILU LACAR (edited December 21, 2001).]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!