Anthony Denahy

Greenhorn
+ Follow
since Jan 13, 2006
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Anthony Denahy

All fixed! The problem was in the Deployment Descriptor. The book I was using gave this as a suitable Descriptor for my first servlet:


but it seems that this is not enough - the following must be included also:



where the url-pattern can be a variety of things e.g. instead of "/servlet/Testing" I could use just "/Test", or if I wanted to be very tricky, even "/rabbit/wombat/walrus", in which case, if my TestingServlet.class was in the myApps/classes, then in my browser I would need to use the URL: http://localhost:8080/rabbit/wombat/walrus in order to run the servlet!
18 years ago
Progress! I can get servlets to work in my "myApp" directory, however, at present I need to use the actual class name - for some reason I cannot use the name mapped in web.xml, and Invoker is not on (I think).

Thankyou everyone - Bill, David, Ben. I have just read the section on asking good questions too - useful advice
[ January 14, 2006: Message edited by: Anthony Denahy ]
18 years ago
Thanks David. It is not an invoker issue - doesn't work either way. (?? P.S. I think I may have not completely uncommented the invoker)
[ January 14, 2006: Message edited by: Anthony Denahy ]
18 years ago
Thankyou for those suggestions Sara - I think I have all those things OK (sorry, I should have taken more effort to give the complete picture).

What I'll try to do is use another simple beginners tutorial, with Tomcat 5.5, and see if it works then.

Anthony
18 years ago
Thanks for your advice Karthi.
18 years ago
I'm doing a Grad Dip in IT, but it doesn't cover J2EE so I want to teach myself. I borrowed "Java for the Web with Servlets,JSP, and EJB" and thought, "Beaut, I'll just work my way through this and I'll have a good basic understanding of J2EE". Unfortunately, even though I have got Tomcat 4.1 working (I decided to use that since the book is 2002), for some unknown reason, when I try to call my servlet from Firefox (localhost:8080 etc) I get an error message: "The requested resource (/myApp/servlet/TestingServlet) is not available". This is the servlet code:

import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
import java.util.*;

public class TestingServlet extends HttpServlet {

public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException, IOException {

PrintWriter out = response.getWriter();
out.println("<HTML>");
out.println("<HEAD>");
out.println("<TITLE>Servlet Testing</TITLE>");
out.println("</HEAD>");
out.println("<BODY>");
out.println("Welcome to the Servlet Testing Center");
out.println("</BODY>");
out.println("</HTML>");
}
}

I must have everything set up OK as the example servlets that come with Tomcat work fine. Any ideas?
18 years ago
I'm feeling overwhelmed - JSP, EJB, Struts, Swing, Hibernate, Tomcat, JBoss!!! I don't think my university (La Trobe Uni, Australia) lecturers know much about these! I have completed 6 units of a Grad Dip in IT, including introductory Java programming, and Data Structures using Java. This coming semester I will finish with OO Programming using Java, plus Web Engineering (CGI, Perl ...). I am doing a career change from secondary maths and IT teaching, and need to get a job sooner rather than later (wife and 3 young children to support). I think I should teach myself J2EE. Yesterday I borrowed "Java for the Web with Servlets,JSP, and EJB" and thought, "Beaut, I'll just work my way through this and I'll have a good basic understanding of J2EE". Unfortunately, even though I have got Tomcat 4.1 working (I decided to use that since the book is 2002), for some unknown reason, when I try to call my servlet from Firefox (localhost:8080 etc) I get an error message: "The requested resource (/myApp/servlet/Testing) is not available".

The book is 4 years old so maybe I should try something more up to date anyway, though any advice on what may be going wrong would be welcome - the servlet code can be seen on: www.samspublishing.com/articles/article.asp?p=26920&seqNum=4

I like the look of the Head First series - do you think someone at my level should tackle Servlets & JSP and then EJB? Any general advice on getting started in an IT career would also be welcome.
18 years ago