This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Description of the base tag

 
Chris Boldon
Ranch Hand
Posts: 190
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ok, so what is the description of the base tag, because apparently I've had it wrong.



I was under the impression that base would set the base path to to location where the jsp being viewed is located. However, in the case about this isn't the case, so apparently I've been wrong. The js folder is a sub folder of the folder the JSPs are in. That JSP folder is called form, which is a sub of the application

ie.. localhost:8080/app/form/js is the dir structure.
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here is a link to the documentation.

Here's what it says:
Renders an HTML <base> element with an href attribute pointing to the absolute location of the enclosing JSP page. This tag is valid only when nested inside an HTML <head> element.


One thing you need to be aware of, though, is that this will not work if you put your JSP files in the WEB-INF/ folder as many developers do.
 
Brent Sterling
Ranch Hand
Posts: 948
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you saying that your example is not working? It seems like it should. Are you using tiles? What do you see in the html generated?

I will add this as well...this tag caused my project (and other projects) some grief when we deployed to production where we are using an HTTPS accelerator. From what I recall, using this tag caused links to include "http://" where they should have had "https://"

- Brent
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic