How can i compile and run jsp pages using tomcat. Where should i place my jsp page. In which folder i have to placed it.
Asked
Active
Viewed 3,676 times
-1
-
Well I am using netbeans IDE and it does everything for me. What IDE are you using? – Voooza Feb 23 '11 at 10:42
-
how can i run jsp page with help of tomcat??? – neha soni Feb 23 '11 at 11:11
-
which v link i have to click inorder to accept an answer??? – neha soni Feb 23 '11 at 11:28
-
Like this: http://j-integra.intrinsyc.com/support/com/doc/servlet_com/deployingJSPtoTomCat.html – duffymo Feb 23 '11 at 10:41
-
This basic [tutorial](http://www.youtube.com/user/camigonz#p/u/0/0Xqm131EG6Y) might be useful for you if you just want to learn how to write a **very basic** jsp example and run it on Tomcat – Bartzilla Feb 23 '11 at 11:31
1 Answers
5
A simple example of JSP can be like this
<html>
<head>
<title>Hello World JSP</title>
</head>
<body>
<% out.println("Hello World"); %>
</body>
</html>
To run this JSP page
Save the file in c:\Program Files\Tomcat\tomcat-5.5.9\jsp-examples\
as HelloWorld.jsp
Start the TomCat Server.
Type the following URL
in the address bar of your web browser.
http://localhost:8080/jsp-examples/helloworld.jsp
The JSP page will be displayed in the web browser.
A JSP page is converted to a servlet internally by the JSP Engine.And the source file for that servlet can be found at \work
directory in TomCat.
For more information on how JSP works and how it is different from Servlet take a look at this
What is the difference between JSF, Servlet and JSP?
Also Take a look at
Hidden features of JSP/Servlet