Solved

jsp and servlet question (should be simple)

Posted on 2006-11-18
3
202 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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Running Java Servlet inside Eclipse Luna 6 156
method inner class 6 82
Best practices to work on a spring MVC project 1 124
login form jsp example 2 24
When we purchase storage, we typically are advertised storage of 500GB, 1TB, 2TB and so on. However, when you actually install it into your computer, your 500GB HDD will actually show up as 465GB. Why? It has to do with the way people and computers…
SEO can be a real minefield to navigate, but there are three simple ways to up your SEO game just be re-assessing your content output.
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

776 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