• 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:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

reading results from javabean into JSP

 
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ranch Hand
Posts: 2874
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
any takers???..
 
Ranch Hand
Posts: 1211
Mac IntelliJ IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
reply
    Bookmark Topic Watch Topic
  • New Topic