• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

web application inside web application ??

 
R K Singh
Ranch Hand
Posts: 5384
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
can we have web app inside webapp?
I mean in Tomcat inside webapps we have directory "app01" now we have another dir inside app01, let us say "app02".
Now dir tree is like

can I have WEB-INF directory in app02 and servlet there, say to call like
localhost:8080\app01\app02\servlet\MyServlet
I tried it but I am not able to run the servlet in side app02.
I set context in server.xml to app01.
I am able to access .jsp/.html pages directly(localhost:8080\app01\app02\MyJsp.jsp)
But when I call servlet(localhost:8080\app01\app02\servlet\MyServlet) then it fails. It shows 404 error.
anyone else has tried this ...
any remeady for this ??
TIA
 
Axel Janssen
Ranch Hand
Posts: 2166
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ravish.
No. This will never work (unless they change the specs considerably).
You must put servlets in ONE special directory under ONE webapp, which is called WEB-INF. There you put the classes in directories which mirrors the package structure of your servlet classes.
(mockexam.data.Controller.class goes in myApp\WEB-INF\mockexam\data\Controller.class).
Anyway. What would that be good for. Your nested apps?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic