- Introduction to jsp
Essentially JSP pages are just normal HTML with Java codes embedded in them. So a general understanding of HTML and Java is required for learnning JSP. If you do not have even basic knowledge about HTML, please consider taking the course HTML.
How JSP works? The below is the process:
1.The Web browser sends a request to your web server asking for a page.
2.The Web server loads the page and looks for JSP code to run.
3.If JSP code is found, the web server runs the code and sends the results to the Web browser. So the result page on the client side looks like a pure HTML page.
2.jsp Tags and include files
Basically we use the <%,%>for jsp tags.For eg:
out.println"this is my first jsp program";
You can include the external jsp page by using following syntax:
<%@ include page="abc.jsp"%>
or
3.simple program using jsp
Let's create the our first jsp program called first.jsp and second.jsp.
Note: see code in above image
Now save both program in same folder and run the first.jsp in browser.You see the the text box,submit button and the link on browser.if you type any string on the text box and click on submit button or link then you get the result looklike this:
Result:- Hi+"string" i.e. if you type bijay then result is: Hi bijay