Servlet - web.xml vs Java config -


i'm migrating old project web.xml approach complete java-style servlet 3.0 configuration.

but can't understand how translate part of xml configuration in java code. in particular next snippet:

<jsp-config>     <taglib>         <taglib-uri>....</taglib-uri>         <taglib-location>....</taglib-location>     </taglib> </jsp-config> 

any hint welcome!

as secondary, more academic, question: servlet 3.0 api offer full coverage of xml, or not?

stefano,

since jsp 2.0, there no need in put <taglib> tag in web.xml. head first servlets , jsp book:

the container automatically builds map between tld files , names, when jsp invokes tag, container knows find tld describes tag. how? looking through specific set of locations tlds allowed live. when deploy web app, long put tld in place container search, container find tld , build map tag library.

so, have have tld file correct uri.

places put tld file:

  • directly inside web-inf
  • directly inside sub-directory of web-inf
  • inside meta-inf directory inside jar fi lethat’s inside web-inf/lib
  • inside sub-directory of meta-inf inside jar fi lethat’s inside web-nf/lib

Comments

Popular posts from this blog

javascript - How to get current YouTube IDs via iMacros? -

c# - Maintaining a program folder in program files out of date? -

emulation - Android map show my location didn't work -