Sunday, 26 July 2015

JSP

Let’s start with jsp

JSP (java server pages) as we learnt that jsp is used for combine html tags and java methods.  Let’s check how we can use both of this.


Start to create web project :

Reaquirements  : -


  •                 Eclipse/NetBeans IDE,
  •                 Apche Web Server  or Glassfish server.
                                We need server for run jsp files. We cannot run this file without web server.

My first Web Project in Eclipse IDE.                 


Strat eclipse IDE.


  • Click on file menu. In that select new option.
  • Find dynamic web project select it. 

Or if you can’t find web dynamic project select other in that type dynamic you can see dynamic web page in web folder select it.



  • You can see this popup box.
                Type your project Name and select new Runtime.
                Select apache server to that latest version. Here it is apache 8.0.



                Now you can see new popup box in  that you have to give path to apache home directory as seen in image.

            Then click next button again click next button. 
Then new popup box appear in that you have to mark the check box to generate web.xml.

Click finish button.


Now your project created.

Now in project explorer you can see  your project.

IN web content right click on that in new menu  select jsp .


Type your jsp file name as index.jsp



To run the jsp file press ctrl+F11. You will see this popup in that select server here it will Apache.

Now output is like…