0

The problem which I addressed is that I'm trying to add javascript file to use it in certain page in my project, I built the project with only one servlet and many controllers using the annotations and reflection.

I set two url-mappings:

   <servlet-mapping>
    <servlet-name>ServletManager</servlet-name>
    <url-pattern> *.* </url-pattern>
   </servlet-mapping>

   <servlet-mapping>
    <servlet-name>ServletManager</servlet-name>
    <url-pattern> / </url-pattern>
   </servlet-mapping>

the first one for mapping the resources and the second one for mapping the http request (note: the project has only one servlet and many controllers)

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
Ibrahim
  • 77
  • 3
  • 10
  • First mapping is syntactically wrong. Second overrides the default servlet altogether. I can imagine that this will cause a lot of trouble although you aren't very specific in describing the actual problems you faced. What exactly is the concrete functional requirement? Perhaps you're looking for one of those answers: http://stackoverflow.com/q/4140448 or http://stackoverflow.com/q/870150 – BalusC Aug 05 '15 at 12:46
  • the problem that this url: myapp/WebContent/scripts.js go to the servlet. What must I do to solve this problem? – Ibrahim Aug 05 '15 at 12:54
  • That will indeed happen with this servlet mappings. Just fix those mappings. How to fix them depends on the concrete functional requirement which you still didn't elaborate anywhere. And, I usually don't post links for decoration. Click them and learn. – BalusC Aug 05 '15 at 12:55
  • ok, thanks for replying. – Ibrahim Aug 05 '15 at 13:01

0 Answers0