Hi, I know this is a very stupid question. But I am a beginner in JSP and is bit confused using it since not only JSP but web programming is very new to me. Please somebody tell me how do I run a JSP file after writing it using an editor like Notepad. I have installed Tomcat and can run the example file of Tomcat using an address as follows: http://localhost:8080/jsp-examples/colors/colrs.jsp
I wanted to run some JSP files after keeping then in a folder called pband. I kept a file named index.jsp in a folder named pband and them kept the folder under <tomcat installation path>\jsp-examples\ and then executed the file from a browser by writing the following address: http://localhost:8080/jsp-examples/pband/ and it worked fine.
But here is the problem: Now I copied the folder pband under the path <tomcat installation path> and tried to executed the file by writing the following address: http://localhost:8080/pband/ and it DID NOT WORK. Why?
Please somebody explain to me clearly. Thank you very much. [ August 20, 2007: Message edited by: Prosenjit Banerjee ]
http://localhost:8080/pband/ and it DID NOT WORK. Why?
In Tomcat, web applications are kept under the "webapps" folder. So under "webapps", copy your "pband" directory. Moreover, web applications use a special directory called WEB-INF. (look in webapps/ROOT) So make one in your "pband" directory. It will be a good idea to make a special file called "web.xml" into the WEB-INF directory. Copy the one which is in webapps/ROOT/WEB-INF, edit it, and remove the part between "JSPC servlet mappings start" and "JSPC servlet mappings end".(if you're using Tomcat 6, there will be nothing to remove)
Thank you Christophe for your prompt answer. I did what you said and it worked! Thanks. But now there is another problem. I am studying a book named Beginning JaverServer Pages and supplied me some example codes. C:\Program Files\Apache Software Foundation\Tomcat 5.0\webapps\ch02\ contains two files: index.jsp (for selecting a portal using a drop down list) showportal.jsp (dynamically renders the portal page)
running it using address http://localhost:8080/ch02/example1/ works fine. Also clicking on the "select" button renders showportal.jsp having folling code:
The problem is: I copied both the index.jsp and showportal.jsp to my pband folder having the path C:\Program Files\Apache Software Foundation\Tomcat 5.0\webapps\pband Now the address http://localhost:8080/pband/ showd the index file correctly but on clicking the "Select" button an error page occured showing org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application
Please tell me where am I going wrong. [ August 20, 2007: Message edited by: Prosenjit Banerjee ]
Originally posted by Prosenjit Banerjee: org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application