3

I have a application by the name (say ) SR.DEV.1.001.war . The builds will change as might have thought already to SR.DEV.1.001 ..004 and so on . However, the jsp's inside have links like DS/admin or DS/user .

I have checked online for a few resources so as to help me , like here , here and here

After trying them out, Im still having the same issue . I tried in context.xml in META-INF

  01)  <?xml version="1.0" encoding="UTF-8"?>
               <Context  docBase="/SR.DEV.1.001.war"  path=""  reloadable="true" />

  02) <?xml version="1.0" encoding="UTF-8"?>
               <Context  docBase="/SR.DEV.1.001.war"  path="/"  reloadable="true" />

  03) <?xml version="1.0" encoding="UTF-8"?>
               <Context  docBase="/"  path="/DS"  reloadable="true" />

  04) <?xml version="1.0" encoding="UTF-8"?>
               <Context  docBase=""  path="/DS"  reloadable="true" />

Please help me fix the issue , as without which , its difficult for me to manage the versions of the war , without affecting the context .

If it helps, I also have a redirect.jsp which is loaded as welcome file in web.xml.

         redirect.jsp : 

        <%@ page language="java" import="java.util.*" pageEncoding="ISO-8859-1"%>
        <%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
        <%response.sendRedirect("/DS/pdui/show.do"); %>

Thanks in advance .

Community
  • 1
  • 1
Anshuman M
  • 31
  • 1
  • 6

1 Answers1

2

When adding a context.xml to the META-INF directory of the web application you should only need to specify the path, the other fields are deducted from where the application is deployed. The docBase is only needed if you specify the path inside the hosts or server.xml.

<?xml version="1.0" encoding="UTF-8"?>
<Context path="/DS"  reloadable="true" />

So basically the above should be enough, make sure that you don't have any leftovers from your previous attempts as that might influence how this works. (Although I believe this one should take precedence over the others).

M. Deinum
  • 115,695
  • 22
  • 220
  • 224
  • hi Deinum , First of all thanks for the update . I did how you suggested , however , somehow it did not work . I deleted the log files , cleaned the work folder , cleaned the \conf\Catalina\localhost\ folder any left overs ... After deployment i see SR.DEV.1.001.xml file in \conf\Catalina\localhost directory . However, when I tried going to the http://localhost:8080/DS it dint work . Any suggesstions , or anything else I need to worry about ? – Anshuman M Aug 23 '13 at 17:03
  • Can you post he context of the context.xml file. Also make sure that you don't have leftovers in the server.xml file of tomcat. – M. Deinum Aug 24 '13 at 08:25
  • context.xml – Anshuman M Aug 28 '13 at 22:00
  • Server.xml in conf folder : There is no change than the default one that comes along with TOMCAT. – Anshuman M Aug 28 '13 at 22:07
  • After deployment there should be a file with the name of the `.xml` which is what appears to be happening... Now what isn't working? Also which change are you hinting at? Normally there is no change to the server.xml... – M. Deinum Aug 29 '13 at 06:24
  • The problem I'm facing is : I should be able to access http://localhost:8080/DS/admin or http://localhost:8080/DS/user. But, if Im changing the build number, I can access the project by : http://localhost:8080/SR.DEV.1.001/admin .... http://localhost:8080/SR.DEV.2.001/admin and so on. – Anshuman M Aug 30 '13 at 17:27
  • I have not seen any replies on this yet . Im still facing the issue and struggling to move ahead . I would be thankful , if I could use some help. – Anshuman M Sep 09 '13 at 23:51