CSS and JS pathes are lost after dispatching
Hello to all!
I’ve implemented a j2ee project in netbeans…
I created an *.html page powered by Ajax, it’s perfect when I run this page standalone but when my controller servlet forward to this page with dispatcher all js and css files will be lost!!
My Servlet mapping is:
<servlet-mapping>
<servlet-name>pedrama</servlet-name>
<url-pattern>/pedrama/*</url-pattern>
</servlet-mapping>
My *.html mapping is:
<servlet>
<display-name>worktable</display-name>
<servlet-name>worktable</servlet-name>
<jsp-file>/worktable.html</jsp-file>
</servlet>
<servlet-mapping>
<servlet-name>worktable</servlet-name>
<url-pattern>/worktable</url-pattern>
</servlet-mapping>
My Resources path:
localhost:15086/Pedrama/Styles/WorkTable/
and I use this in my html:
src="Styles/WorkTable/codebase/dhtmlxcommon.js"
Perfect mode:
localhost:15086/Pedrama/worktable(without controller)
Incorrect mode:
localhost:15086/Pedrama/pedrama/worktable (whit controller by dispatcher)
Please help me!
Can I use a method for specify paths in my web.xml?!