This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Servlets and the fly likes Servlet to JSP - HOW?!?!?!?!?! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Servlet to JSP - HOW?!?!?!?!?!" Watch "Servlet to JSP - HOW?!?!?!?!?!" New topic
Author

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

Sam Smoot
Ranch Hand

Joined: Apr 18, 2002
Posts: 238
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:


CNSS/NSA Infosec Professional,<br />Software Engineer
Rene Larsen
Ranch Hand

Joined: Oct 12, 2001
Posts: 1179

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


Regards, Rene Larsen
Dropbox Invite
Sam Smoot
Ranch Hand

Joined: Apr 18, 2002
Posts: 238
Thanks! I got it to work, still confused, but it works!
Rene Larsen
Ranch Hand

Joined: Oct 12, 2001
Posts: 1179

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

Joined: Apr 18, 2002
Posts: 238
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 ]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Servlet to JSP - HOW?!?!?!?!?!
 
Similar Threads
Response Redirection
Servlet Chaining
response already commited error
input to ireport
Session is not invalidated