• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Servlet to JSP - HOW?!?!?!?!?!

 
Sam Smoot
Ranch Hand
Posts: 238
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, I'm going along and starting to get the hang of this and WHAM... I realize I'm still stuck..
I am running the servlet below and it works (surprised me, too! ) Now I want to know how to refer this back to a JSP page to display the results. I've done the "code the HTML in your servlet" thingy, but I know there must be a better way... is there?
Thanks!
Servlet code:
 
Rene Larsen
Ranch Hand
Posts: 1179
Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You should change the methods 'doGet' and 'doPost' to one method called 'service' because it do both POST and GET.
Put 'result' in the httpsession like this:

and then do this:

From the JSP page you can get the result this way:

/Rene
 
Sam Smoot
Ranch Hand
Posts: 238
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks! I got it to work, still confused, but it works!
 
Rene Larsen
Ranch Hand
Posts: 1179
Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why confused?
What is it you don't understend?
This link show how to make Dynamic Tables with Servlet - JSP - Beans:
http://www.coderanch.com/t/280687/JSP/java/Displaying-Dynamic-Tables
/Rene
 
Sam Smoot
Ranch Hand
Posts: 238
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Confused is me.. I'm still living in a procedural world.... ("aged" mainframe Assembler programmer drafted into new world).
[ July 10, 2002: Message edited by: Sam Smoot ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic