Jump to content

Recommended Posts

Posted

I just put file web.xml in folder /home/vaninf/public_html/WEB-INF/

 

Please restart Tomcat server.

 

My user name is vaninf.

 

Thanks.

Posted

Why doesn't the servlet mapping in web.xml work?

 

My web.xml is in folder /home/vaninf/public_html/WEB-INF/

 

Is it caused by configuration of Tomcat?

Posted

It has nothing to do with .war file, I didn't create .war file. I uploaded the servlet class files and web.xml into /home/vaninf/public_html/WEB-INF/ folder by myself, I accessed http://vaninf.heliohost.org/index.htm

to invoke the servlet because index.htm is mapped to the servlet. The server shows "The requested URL /index.htm

was not found on this server."

 

I think this is caused by Apache http server, it must have been configured to pass only .jsp file requests to Tomcat server, so

all other file requests are blocked by Apache http server, they can't reach Tomcat server. So the servlet mapping defined in

web.xml are not used when we access http://vaninf.heliohost.org/index.htm, because index.htm is not .jsp file name.

 

Am I right?

Posted

Yes, Apache is much better at serving html files. Tomcat handles .jsp etc.

 

It has nothing to do with .war file, I didn't create .war file.

Why do you keep requesting for them to be deployed then? http://www.helionet.org/index/topic/28363-please-deploy-my-war-file/ http://www.helionet.org/index/topic/28339-please-deploy-my-war-file/ http://www.helionet.org/index/topic/28326-please-deploy-my-war-file/ ?
Posted

To prove you and I are correct, I have changed the servlet mapping in web.xml, now the servlets

are mapped to .jsp file names. I have uploaded web.xml again. To let the new web.xml take effect,

Tomcat server should be restarted. Could you please restart Tomcat server? Thanks

Posted

The deployed war files don't work as expected because request.getServerName(), request.getServerPort()

and request.getContextPath() return wrong values. My web application won't work if I deploy it this way.



The new servlet mapping defined in web.xml still doesn't work. Could you please find out why?



The new servlet mapping defined in web.xml still doesn't work. Could you please find out why?

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...