0

I configured all my JSP page in web.xml file to hide .jsp extension and I created custom URL in web.xml file corresponding to each JSP page due to SEO point of view but when I deployed this application at server tomcat which is running under Apache web server so my server team replies me like this but I am not getting what does they mean.

Please note that you are running in a server where apache is the web server and Tomcat is a servlet container. This way all static requests such as images, CSS, js, HTML are handled by apache and jsp, servlets are handled by Tomcat. This means Apache will forward any request that you send with the following extension to tomcat

.jsp 
/servlet 
.do

This means in order for Tomcat to execute your code you need to send a request to apache as .jsp, /servlet and .do. Once you send this way, it will automatically send to tomcat to running there. In your case /hosting will be executed by apache only and that's why you get this error of 404.

web.xml

<servlet>
   <servlet-name>domain</servlet-name>
   <jsp-file>/domain-registration.jsp</jsp-file>
</servlet>
<servlet-mapping>
   <servlet-name>domain</servlet-name> 
   <url-pattern>/domain-registration</url-pattern>
</servlet-mapping>
Ravi
  • 30,829
  • 42
  • 119
  • 173
  • you might feel useful https://stackoverflow.com/questions/14018215/what-is-url-pattern-in-web-xml-and-how-to-configure-servlet/14018272#14018272 – Ravi Oct 02 '17 at 09:46
  • In tag use domain – Pravin Fofariya Oct 02 '17 at 12:25
  • Thanks @PravinFofariya i will check and update you and i really like if would give me fb id or mail id . for more query i need some java related help actually i am facing some issue little little issues.If you would guide me then its really a great help for me. – Boolment Software Oct 02 '17 at 12:57

1 Answers1

0

Do give the proper error, on which url you are getting 404?

Try any other url-pattern you have already specified in the web.xml, check if it works properly or not. I think there is some syntax mistake in your web.xml file other wise it should work.

Desmond
  • 405
  • 1
  • 6
  • 12
  • No actually its working fine in my local system i have no issue but while i deployed this application at server then i am getting this issue. And i reaise my concern to my server people then they send main this reply. Please note that you are running in a server where apache is the web server and tomcat is a servlet container. This way all static requests such as images, css, js, html are handled by apache and jsp, servlets are handled by Tomcat. This means apache will forward any request that you send with the following extension to tomcat .jsp /servlet .do – Boolment Software Oct 02 '17 at 12:59
  • This means in order for tomcat to execute your code you need to send request to apache as .jsp, /servlet and .do. Once you send this way, it will automatically send to tomcat to running there. In your case /hosting will be executed by apache only and thats why you get this error of 404. One example to achieve this is to call a .do to a servlet as /servlet/hosting etc. Please check with your developers on this as they can help you further. – Boolment Software Oct 02 '17 at 13:01
  • Okay then there it may be a problem at their side – Desmond Oct 02 '17 at 13:04