|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
servlets on port 80
I'm running Tomcat 4 on windows 2000.
When i change the port to 80 in server.xml, only JSPs work..and not the servlets. ie: URL cannot find anything But when I go back to 8080, it all works. ie: URL displays the results. How do i fix this? I do not want users to always type url:8080to access my site. ![]() |
|
#2
|
|||
|
|||
|
Put a little of you web.xml on line.
|
|
#3
|
|||
|
|||
|
ok here goes:
------------------------------------------------------------------------------- <servlet> <servlet-name>default</servlet-name> <servlet-class> org.apache.catalina.servlets.DefaultServlet </servlet-class> <init-param> <param-name>debug</param-name> <param-value>0</param-value> </init-param> <init-param> <param-name>listings</param-name> <param-value>true</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet> <servlet-name>invoker</servlet-name> <servlet-class> org.apache.catalina.servlets.InvokerServlet </servlet-class> <init-param> <param-name>debug</param-name> <param-value>0</param-value> </init-param> <load-on-startup>2</load-on-startup> </servlet> <!-- The mapping for the invoker servlet --> <servlet-mapping> <servlet-name>invoker</servlet-name> <url-pattern>/servlet/*</url-pattern> </servlet-mapping> <!-- The mapping for the JSP servlet --> <servlet-mapping> <servlet-name>jsp</servlet-name> <url-pattern>*.jsp</url-pattern> </servlet-mapping> |
|
#4
|
|||
|
|||
|
I do not see anything in you web.xml your test servlet at all.
|
|
#5
|
|||
|
|||
|
I am assuming your TestServlet class is not in a package? If so, try putting it in a package called "test" or something. Then try the url
http://localhost/jclub/servlet/test.TestServlet And see what it does. I believe some app servers have a problem accessing servlets/classes that are in the default package (read: no package). |
|
#6
|
|||
|
|||
|
Ahh, i agree. I normally map all of my servlets in the web-xml, and do nto use the DefaultServlet. I agree with Nemi
|
|
#7
|
|||
|
|||
|
The web.xml is from the /conf directory not WEB-INF
I did map the servlet in /WEB-INF/web.xml Anyways...i'll try to put it in a package and c how it goes. Thanks |
|
#8
|
|||
|
|||
|
web.xml MUST go in the WEB-INF directory. servlets and beans MUST go in the WEB-INF/classes directory. Jar files MUST go in the WEB-INF/lib directory. The app server requires this.
The two sentences you posted were contradictory, so I am not sure if you have a web.xml in the WEB-INF directory or not. |
|
#9
|
|||
|
|||
|
Tomcat has two web.xml, one global and one for the local Web App.
|
|
#10
|
|||
|
|||
|
Interesting. Now that you mention it I remember reading references to this fact, but I must admit I did not think of it when he posted. I am currently running an older version of Websphere at work, which is quite behind the times.
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages > Java Help > servlets on port 80 |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|