0

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?

Johnathan Smith
  • 1,112
  • 2
  • 17
  • 34
  • it depends on how your web and your dispatcher are written. for instance I use a resources dispatcher that allows me to access images vi /resources/image.jpg – rptmat57 Sep 04 '12 at 17:41

1 Answers1

1

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.

dbreaux
  • 4,982
  • 1
  • 25
  • 64