How to Write to Database or Read from Database via Web

I am developing a web base application, I have jakata tomcat server installed and configured, is working well!
How to write a  simple JSP program that print "hello world" on the web?
What are the steps in running or executing a JSP?

Simplest way is to create a blank text file and save it in the application folder!

To begin :-
tomcat_home:- folder where you have installed tomcat, would have webapps folder. (eg:- c:\program files\tomcat\)
tomcat_home would have folders like bin, common, webapp etc.

1) create a new folder in tomcat_home\webapps by any name(for example testjsp)

2) goto tomcat_home\webapps\testjsp folder and create a folder by name WEB-INF (make sure you name it WEB-INF and not web-inf)

3) in tomcat_home\webapps\testjsp folder create a test.jsp file

4) open test.jsp in an editor(eg notepad) and type Hello JSP

5) save the test.jsp file

6) run the tomcat server

7) open internet explorer and put the address http://localhost:8080/testjsp/test.jsp that should bring up a page with Hello JSP as content.  You can browse examples inside the webapps folder of tomcat_home

Above mentioned step should work if you have not changed the default configuration of tomcat at the time of installation.

*-- Swivel

Related:

Java Books
Java Certification, Programming, JavaBean and Object Oriented Reference Books

Return to : Java Programming Hints and Tips

All the site contents are Copyright © www.erpgreat.com and the content authors. All rights reserved.
All product names are trademarks of their respective companies.
The site www.erpgreat.com is not affiliated with or endorsed by any company listed at this site.
Every effort is made to ensure the content integrity.  Information used on this site is at your own risk.
 The content on this site may not be reproduced or redistributed without the express written permission of
www.erpgreat.com or the content authors.