Any clever ways of handling the context in a web app?

前端 未结 13 1461
一整个雨季
一整个雨季 2020-12-02 13:37

In Java, web apps are bundled in to WARs. By default, many servlet containers will use the WAR name as the context name for the application.

Thus myapp.war gets depl

相关标签:
13条回答
  • 2020-12-02 14:04

    I've used most of these techniques (save the XSLT architecture).

    I think the crux (and consensus) of the problem is having a site with potentially multiple directories.

    If your directory depth (for lack of a better term) is constant, then you can rely on relative urls in things like CSS.

    Mind, the layout doesn't have to be completely flat, just consistent.

    For example, we've done hierarchies like /css, /js, /common, /admin, /user. Putting appropriate pages and resources in the proper directories. Having a structure like this works very well with Container based authentication.

    I've also mapped *.css and *.js to the JSP servlet, and made them dynamic so I can build them on the fly.

    I was just hoping there was something else I may have missed.

    0 讨论(0)
提交回复
热议问题