Results 1 to 2 of 2
  1. #1
    meisam is offline Member
    Join Date
    Mar 2009
    Posts
    1
    Rep Power
    0

    Default 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?!

  2. #2
    serjant's Avatar
    serjant is offline Senior Member
    Join Date
    Jun 2008
    Location
    Ukraine,Zaporozhye
    Posts
    487
    Rep Power
    6

    Default

    Create in WEB-INF js and css folders and put their your css and js files, then in source of jsp files you configure pathes like styke="/style/<your css file>"(the same with js)

Similar Threads

  1. I'm lost :(
    By leonardjr in forum New To Java
    Replies: 8
    Last Post: 03-03-2009, 04:18 AM
  2. So Lost
    By kandt in forum New To Java
    Replies: 5
    Last Post: 12-13-2008, 09:55 PM
  3. Dispatching requests to other Servlet
    By gapper in forum Java Servlet
    Replies: 1
    Last Post: 02-06-2008, 06:57 AM
  4. Dispatching request to another Servlet
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 01-27-2008, 08:20 PM
  5. Replies: 2
    Last Post: 07-04-2007, 05:23 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •