Reputation: 1112
Spring WebFlow, I cant find path to files outside my flow?
I am working on a Spring Webflow2 project and sometimes I have to access JavaScript and Image files that are not in my flow. I cant find the right path to put into my JSP page.
Example:
This is in my JSP that is in the flow:
function ShowCalendar(CONTROL,START_YEAR,END_YEAR,FORMAT){
alert("Loading Calendar js/HTMLCalendar.jsp" );
ControlToSet = eval(CONTROL);
StartYear = START_YEAR;
EndYear = END_YEAR;
FormatAs = FORMAT;
var strFeatures = "width=" + CalWidth + ",height=140" + ",left=" + LEFT + ",top=" + TOP;
var CalWindow = window.open("../calendar.jsp","Calendar", strFeatures)
CalWindow.focus();
}
I get the alert but my project never finds calendar.jsp which is in the root of WebContent? can someone please help me out. I am also trying to load a image
src="/images/cal.bmp"
which is in WebContent/images but it is also not getting found?
Upvotes: 0
Views: 316
Reputation: 5105
Both of those are client-side requests for content. That is, from your browser. So they really don't have anything to do with WebFlow, they'll be relative to the URL the browser used to load the current page (unless your JSP also has an HTML base href
tag).
If your window.open()
URL or img src
are server-relative (starting with /), you'll need your web application's context-root in front of them. e.g. /myapplication/images
.
Upvotes: 1