Sunday, 26 May 2013

Java Server Pages


JavaServer Pages (JSP)
                                            is a technology that helps software developers create dynamically generated web pages based on HTML, XML, or other document types.

1. The system pre requisites for working with JSP is to have your java environment and tomcat server set
                       
                          follow this post to set java environment and
                                    this post for tomcat

     If you are done, then come on.. explore yourself into cool stuffs :-)

2. The developer pre requisites for working with JSP is to have knowledge of java and HTML 

    Well you need not be an expert. Just go through this post and come back


Your First JSP program

1. Type the below given program in the text file

                         <HTML>
                                <BODY>
                                        Hello Developer !!!
                                </BODY>
                         </HTML>

2. Save the file with .jsp extension in the below path where all your .class and .jsp files should be    
    present

                           /apache-tomcat-7.0.37/webapps/ROOT/

3. In order to execute the program, you need to start your tomcat server, its so simple 
 
       - open your terminal and traverse  to the bin folder in tomcat which you had 
          downloaded by following this post
 
       - type ./catalina.sh start and ./catalina.sh stop to stop the server
 
     Example : root@localhost:/home/vignesh/Desktop/apache-tomcat-7.0.37/bin# ./catalina.sh start
 
     Note: Once you have started the catalina server, you can verify it by typing 
                                                  
                                                    http://localhost:8080 
               on the address bar of your browser.

               Tats it !!!!! 
 
4. Now, from browser open the file you just created :-) Yeah its you who did it !!!!!
 

But I guess you may be wondering what's the difference between 
HTML and JSP??? well  

HTML is client side but JSP is server side. 

confused?? relax
  • HTML provides a means to describe the structure of text-based information in a document - by denoting certain text as links, headings, paragraphs, lists, and so on.

  • The JSP syntax adds additional XML-like tags, called JSP actions, to be used to invoke built-in functionality.


Please leave your doubts or suggestions in comments section..

1 comment: