aspose file tools*
The moose likes JSP and the fly likes reading results from javabean into JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "reading results from javabean into JSP" Watch "reading results from javabean into JSP" New topic
Author

reading results from javabean into JSP

aliya sharma
Ranch Hand

Joined: Aug 11, 2004
Posts: 48
Hello,
I'm new to JSP. I have already posted a question in servlet forum but have figured out that problem and my servlet is working fine. I have a bean that store the query results and then send them to a controller servlet which in turns forwards the result to JSP to read and display it. My bean and servlet is working fine(i tested them both with some System.out statement). Below is a part of my servlet code(its passing part_no parameter to the bean:

I'm accessing this through result.jsp by:

but when i try to access this page..it doesn't show me any result.just the static "hello" that i added. I'm realy confused now. COuld anyone please guide me in right direction or tell me whats wrong with my code. I would really appreciate your help.
Adeel Ansari
Ranch Hand

Joined: Aug 15, 2004
Posts: 2874
Originally posted by aliya sharma:



you should do something like,

<jsp:getProperty name="result" property="part"/>
<jsp:getProperty name="result" property="content"/>

try this. hope this will solve your problem.
aliya sharma
Ranch Hand

Joined: Aug 11, 2004
Posts: 48
Hello Adeel,
I changed my code as you mentioned but i'm still only getting static parts of result.java. here's my JSP code.



heres my javabean

Any other suggestions??.I would really appreciate your help with this.
aliya sharma
Ranch Hand

Joined: Aug 11, 2004
Posts: 48
I finally got it working!!!. I changed the scope to session and got the desired results. Could anyone please tell me why it wasn't working when i had set the scope to "request". like this:
aliya sharma
Ranch Hand

Joined: Aug 11, 2004
Posts: 48
any takers???..
Sonny Gill
Ranch Hand

Joined: Feb 02, 2002
Posts: 1211

Cant see any obvious reason for it from looking at your code.
Try to look at the generated Java file for the JSP, that might help you find the reason for it.


The future is here. It's just not evenly distributed yet. - William Gibson
Consultant @ Xebia. Sonny Gill Tweets
 
jQuery in Action, 2nd edition
 
subject: reading results from javabean into JSP