• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

confused

 
Michelle Lee
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I just started a new job as a java programmer for three days without previous experience in this area. The major part of the project I am working with is done, my duty is to extend its feature and fix some bugs. I am so frustrated because I am still struggled with the working enviroment without do anything.
The problems I met are:
1. I have development directory like this:
src
...myproject
...mysystem
in src\myproject\mysystem. there is a servlet called myfile1.java (its first line shows: package myproject.mysystem) using other files in the same directory. I successfully compiled all other files in src\myproject\mysystem(which are self contained) and java serlvets in \src which import myproject.mysystem, but the stubbon myfile.java refused to be compiled, even I set the classpath to
c:\src;c:\src\myproject;c:\src\myproject\mysystem
How shall I set classpath to compile myfile1.java.
2. Some files reference servlet like this:
<a herf="/servlets/ThisServlet"> it still works.
The textbooks I have read refernces serlvets like this:<a herf="serlvet.ThisServlet> How can I configure web.xml so that I can use /servlets to
link to a serlvet?

Thank you very much for your help!
[ March 23, 2002: Message edited by: Mei Xiao ]
 
Sunny Liu
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it seems you are really new to java and servlet.
Here we go, Let's get back to work,
change compiling work directory to src and make sure you include . in your classpath.
use command
c:>echo %classpath%
to make sure you have . in your classpath then
src>javac myproject\mysystem\myfile.java
after compile copy myproject\mysystem\myfile.class and its related class files to WEB-INF\classes directory in your web application directory
then open web.xml file in directory WEB-INF
you may look in example app to find out how to register you servlet class and UrlMapping to the way you want.
 
Consider Paul's rocket mass heater.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic