| Author |
Deploying Servlets/JSP on Linux w/Tomcat
|
Vrunda Joshi
Ranch Hand
Joined: Dec 03, 2001
Posts: 104
|
|
Hi all, I need help in deploying my servlets on Linux server.I have in built Tomcat 5. I created a WEB-INF/classes structure and put my .class files in it. I am trying to run the basic HelloWorld Servlet with the url as my website's id followed by/servlet/HelloWorld but it's not working. I don't know what's going wrong. I am absolutely new in this "LINUX DEPLOYMENT" field. Thanks in advance -Vrunda [ May 16, 2006: Message edited by: Bear Bibeault ]
|
-Vrunda Joshi<br />SCJP,SCWCD,SCBCD(preparing...)
|
 |
Ben Souther
Sheriff
Joined: Dec 11, 2004
Posts: 13410
|
|
This doesn't sound like a linux specific issue. That your url has "servlet/" in it tells me that you're probably using an older book or tutorial that relies on the invoker servlet for deploying your servlet. The invoker has been taken out of commission in newer versions of Tomcat. Now, you must add a servlet entry and a servlet mapping to your deployment descriptor (web.xml). See the following page for more information on the invoker servlet. http://faq.javaranch.com/view?InvokerServlet
|
Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
|
 |
Vrunda Joshi
Ranch Hand
Joined: Dec 03, 2001
Posts: 104
|
|
hey Ben Souther, Thanks a lot for the reply.I really appreciate it.I am trying to deploy my servlet that way because that was mentioned in my site's documentation. I am going through the link you have given.It has lots of info. thanks a lot -Vrunda
|
 |
Vrunda Joshi
Ranch Hand
Joined: Dec 03, 2001
Posts: 104
|
|
hi all, I wanted help in deploying JSP pages also. I posted this question in JSP's thread,but got a reply that it was a "Cross-Post" and my post was closed.So I had to include everything here... I am trying to deploy my JSP pages on my server,my simple jsp page has only <% int i=4; %> Hello! The count is now <%= i %> but still it's not working.In the browser I can see only "Hello!The count is now " so I don't know what's going wrong. My server has included JAVA,and tomcat 5.I haven't yet set any env variables. Thanks in advance -Vrunda
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56155
|
|
|
What does a View Source reveal?
|
[Smart Questions] [JSP FAQ] [Books by Bear] [Bear's FrontMan] [About Bear]
|
 |
Vrunda Joshi
Ranch Hand
Joined: Dec 03, 2001
Posts: 104
|
|
hey Bear Bibeault Thanks for your reply. I tried it again. The view source looks like this.I know it looks bad and and is hard to read but had to paste it as it is to give an idea. <%@ page contentType="text/html; charset=iso-8859-1" language="java" import="java.sql.*" errorPage="" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title> </head> <body> <% int i=4; %> Hello! The count is now <%= i %> </body> </html> Thanks a lot for taking time to reply. -Vrunda
|
 |
Ben Souther
Sheriff
Joined: Dec 11, 2004
Posts: 13410
|
|
Since this thread has morphed into a JSP question... Moving to JSP
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56155
|
|
Since the following is waht is being sent to the browser it's clear that the JSP is not being interpreted. So, at the risk of whiplash, moving this one more time as it's clearly become a Tomcat setup issue.
|
 |
Ben Souther
Sheriff
Joined: Dec 11, 2004
Posts: 13410
|
|
A common mistake when naming JSPs is to use an upper case file extension name: my-page.JSP If that's not it. What does your directory structure look like? Are you using a connector and an external web server such as Apache HTTPD?
|
 |
Bear Bibeault
Author and ninkuma
Marshal
Joined: Jan 10, 2002
Posts: 56155
|
|
|
And can you view the JSP examples that come with Tomcat?
|
 |
Vrunda Joshi
Ranch Hand
Joined: Dec 03, 2001
Posts: 104
|
|
hey Bear Bibeault & Ben Souther, Thanks for all your help.I had to enable Java for my site and make some changes and now my servlets & JSP pages are working on my web site. thanks a lot, I will write back if I need any help, as I have already done today Have a good Weekend!!! -Vrunda Joshi
|
 |
 |
I agree. Here's the link: jrebel
|
|
subject: Deploying Servlets/JSP on Linux w/Tomcat
|
|
|