• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Fix my bug plzzzz

 
Frederik Ericsson
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello friends,
I badly need your help. I am using java 1.4 & tomcat 4.1

Installed tomcat with eclipse perfectly, tested index.jsp, working fine.

Project
/Test
/Test/index.jsp
/Test/WEB-INF/src/Date.java
/Test/WEB-INF/web.xml

Done Project->Properties->Java Build Path->Defaulf output foldes
as /Test/WEB-INF/classes

Basically I dont know how to compile the file Date.java. while compiling core java file, I used to go to Run tab -> Run -> Project Name -> main class -> Run. But here I dont know.

If am doing the same I could not find the Date.java to compile and run. Once i come to know how to run then it wont be a problem to send the date.class file to the /Test/WEB-INF/classes folder bcos I have done the project setting output folder as /classes.

One more thing I have tried this as well, I have compiled this Date.java in cmd and got the Date.class file, I copied to the /Test/WEB-INF/classes folder and tested. It was working fine too. then there is no point in IDE. So I need your help pleaseeeeeeeeeeeeeee Guys..



Date.java
import java.io.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class Date extends HttpServlet {
public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {
java.util.Date d = new java.util.Date();
int _date = d.getDate();
PrintWriter out = response.getWriter();
out.println( _date);
}
}

web.xml

Welcome to Tomcat

Welcome to Tomcat


H
Date


H
/ssss


with regards.
 
ramgopal revuri
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

once you build the project in eclipse, it should have compile all of your java files in your project and place the class files in the folder specified.

Thanks
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Legitimate Coder", welcome to the ranch. Please take a few moments to read the Javaranch naming policy. After reading the policy, you can change your name here. We try to be friendly around here but we do have our rules, and not following the naming policy can result in having your account deleted.

We'd prefer to keep you with us.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic