Solved

jsp and servlet question (should be simple)

Posted on 2006-11-18
3
203 Views
Last Modified: 2010-04-01
I'm new to using JSP so this question should be simple.  I have a servlet already created that runs a process and generates a message, and i have an html page already created.  

What i want to do is simply display the message in the html.  My question is how would i get the message from the servlet to the jsp page?
Would i just store the message in the session variable in the servlet and pull it out from the session in the jsp page, and if so how can this be done?
0
Comment
Question by:tbboyett
  • 2
3 Comments
 
LVL 10

Expert Comment

by:jaggernat
ID: 17973287
0
 
LVL 5

Author Comment

by:tbboyett
ID: 17973361
Hey jaggernat thanks for the response.

I understand how to use the Printwriter in a servlet but i'm trying to determine if there is an easy way to pass information from a servlet to a JSP page.  My reason for doing this is because the html page is rather complicated and i would prefer not to generate it in the servlet since it is already created.

is there an easy way to pass the information from servlet to jsp?
0
 
LVL 10

Accepted Solution

by:
jaggernat earned 300 total points
ID: 17973585
put the informaiton in session (in servlet)  and retrieve it in the jsp.
you would use

session.setAttribute("objname",obj)   in servlet

and

session.getAttribute("objname");   in the jsp
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you are looking at this article, you have most likely been hit by some version of ransomware and are trying to find out if there is anything you can do, or what way you should react - READ ON!
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question