JavaBeat
Struts Tutorials | Hibernate Tutorials | JSP Tutorials | Servlet Tutorials | EJB Tutorials | Struts Resources | Spring Resources | Hibernate Resources
JSP Home Articles Resources Tutorials FAQs Forums  

1. Getting familiar with your JSP server

2. Your first JSP

3. Adding dynamic content via expressions

4. Scriptlets

5. Mixing Scriptlets and HTML

6. Directives

7. Declarations

8. Tags

9. Sessions

10. Beans and Forms Processing

11. Tag Libraries

12. Form Editing

13. Log-in pages

14. SQL

15. Sending Email

16. Further learning

Your first JSP

JSP simply puts Java inside HTML pages.  You can take any existing HTML page and change its extension to ".jsp" instead of ".html".  In fact, this is the perfect exercise for your first JSP.

Take the HTML file you used in the previous exercise.  Change its extension from ".html" to ".jsp".  Now load the new file, with the ".jsp" extension, in your browser.

You will see the same output, but it will take longer!  But only the first time.  If you reload it again, it will load normally.

What is happening behind the scenes is that your JSP is being turned into a Java file, compiled and loaded.  This compilation only happens once, so after the first load, the file doesn't take long to load anymore.  (But everytime you change the JSP file, it will be re-compiled again.)

Of course, it is not very useful to just write HTML pages with a .jsp extension!  We now proceed to see what makes JSP so useful.


Sponsors
Webmaster Hosting Forum
Java Jobs
MyVideoLib
India News
Internet Advances
Latest QnA
Describe the lifecycle of a receiver application in order to receive a message?
Messages are not successful until they have been acknowledged. What are the types of acknowledgments?
What happens to messages if a transaction is rolled back?
What is the Role of the JMS Provider?
What is JMS administered object ?

JavaBeat Media (2004-2008), India
javabeat | planetoss | links directory | advertise
Copyright (2004 - 2008), JavaBeat