Solved

jsp and servlet question (should be simple)

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
handling Struts tag, JSTL tag and scriptlet in Ajax. 7 171
Best practices to work on a spring MVC project 1 117
Handle form fields in spring mvc controller 1 60
java operators 3 110
Some code to ensure data integrity when using macros within Excel. Also included code that helps secure your data within an Excel workbook.
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

920 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now