Solved

jsp and servlet question (should be simple)

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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Fisheye tool 2 122
sortaSum challenge java 17 174
servlet example 17 59
going to wrong jsp page 2 50
The world seems to conceive of a curious bubble separating IT from “the business.”  More so than just about any other pursuit in the commercial world, people think of IT as some kind of an island.
We have put together a white paper that aims to explain how MSPs can both improve their offering and ease the pain of after-hours service by: -Suggesting changes to workflow -Indicating how to rework policy to suit your team -Providing ConnectW…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

730 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