• 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

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

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 567
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Sheriff
Posts: 17644
300
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).]
 
Drove my Chevy to the levee but the levee was dry. A wrung this tiny ad and it was still dry.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic