How do we get the absolute path to the applications root directory using Spring?

Using is the way. Ignore what the IDE tells you. They are not good at that.

Just try to run it.

Sorry, apparently I didn't denote the thmnl so ittried to render :/ my bad. – Zee Jan 10 at 18:11 @Zachary Spencer see updated – Bozho Jan 10 at 18:17 This still does not work, I'm gonna combine it with dwbs answe and see what I come up with – Zee Jan 10 at 19:13 @Zachary Spencer how it doesn't work? – Bozho Jan 10 at 19:20 I believe part of the problem is the IntelliJ Idea is starting my app up at /, but it still resides at /m/, thus the application context is /.

While the app really runs at /m/ And I have no idea why this is occuring. – Zee Jan 10 at 19:29.

Bozho is right. I have used HTML BASE tag too: If you can put this tag in a few places (ideally in only one JSP) you can get your code cleaner.

1 for a nice use of a base head tag, Sinuhe! – MichaÅ‚ Minicki Jan 10 at 18:27.

You can (apart from other responders hints) also use Spring JSP tag (spring:url) which is modeled after the JSTL c:url tag (see Bozhos reply). The tld reference: static.springsource.org/spring/docs/3.0.... And the bottom of this mvc:resources block for an example use: static.springsource.org/spring/docs/3.0.....

You will not be able to imbed the c:url tag directly in the attribute, if your form tag is a jsp tag (perhaps, ). In that situation I do the following.

However, if I use it goes to the root of the server, not the tomcat application. If I use it goes to a path relative to the current page. I've tried and but neither of them seem to work.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions