*
The moose likes JSP and the fly likes Running jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "Running jsp" Watch "Running jsp" New topic
Author

Running jsp

laks subramanian
Greenhorn

Joined: Feb 05, 2002
Posts: 17
I have a really basic question. After i type in the .jsp file in a editor(say textpad), what wud i do next inorder to run it? Should I complie it? and how would i deploy in JSWDK?
Thanks in advance
ersin eser
Ranch Hand

Joined: Feb 22, 2001
Posts: 1072
Well You need a container ( ie: Tomcat) create a folder under webapps. That is going to be your application name and put the jsp directly under that folder. Container will compile the file.
Say you created a folder called "Test" under webapps folder of Tomcat and a file called "MyFirstJsp.jsp" under Test folder , the way to access it ( after starting Tomcat) is typing http://localhost:8080/Test/MyFirstJsp.jsp
I would recommend you to read this book
laks subramanian
Greenhorn

Joined: Feb 05, 2002
Posts: 17
Erin
Thanks for the reply. I use JSWDK-1.0.1 for running jsp.After starting the server I tried running the examples thats part of the server. It shows the following error
HANDLER THREAD PROBLEM: java.io.IOException: Socket Closed
java.io.IOException: Socket Closed
at java.net.PlainSocketImpl.getInputStream(Unknown Source)
at java.net.Socket$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.Socket.getInputStream(Unknown Source)
at com.sun.web.server.ConnectionHandler.run(ConnectionHandler.java:161)
Any clues what to do?
thanks again
ersin eser
Ranch Hand

Joined: Feb 22, 2001
Posts: 1072
I ve never used JSWDK ( isn't it kind of old?), so this is going to be a guess: Is JSWDK-1.0.1 up & running?
Can you try downloading and using Tomcat or Resin?
laks subramanian
Greenhorn

Joined: Feb 05, 2002
Posts: 17
hey ersin,
i am having problem in downloading tomcat. the links show something called parent directory or something that confuses me. i request you to give instructions on how to set up the tomcat server for runnig jsp
thanks
ersin eser
Ranch Hand

Joined: Feb 22, 2001
Posts: 1072
Hi We have a Tomcat forum for it
http://www.coderanch.com/forums/f-56/Tomcat
Latest Tomcat is under bin ( http://jakarta.apache.org/builds/jakarta-tomcat-4.0/release/v4.0.3/bin/ ) directory
if you have a windows machine just download the .exe file otherwise download the appropriate file for your OS.
Windows version installs it as a service thus sometimes it gives you a bind error when you try to start Tomcat ( because it is already running) so go to start|settings| control panel|Administrative tools | services and find Apache Tomcat on the list and change the configuration to Manual start& stop . This will enable you to start or stop Tomcat at your own will and you will not get a bind error.
if you are using windows machine, You can start and stop Tomcat by going thru start | programs ...
( you can create a shortcut to start & stop services on your deesktop using regular windows steps for creating a short cut)
Pranit Saha
Ranch Hand

Joined: Sep 09, 2001
Posts: 130
Hi,
Is there any way to run Tomcat automatically when my machine starts..
Pranit..
laks subramanian
Greenhorn

Joined: Feb 05, 2002
Posts: 17
hey ersin,
i tried running the same program in weblogic server and it worked fine. not sure whats the prob with JSWDK. Anyways I thank you for your time
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Running jsp
 
Similar Threads
View the images as four per row instead of long row that is never ending
how to set up a navigaeting tree according to the database records?
passing Enumeration as an Attribute from servlet to jsp
write javascript function in java ?
open excel file