I'm struggling with including a static file into my JSPs on Websphere 6.0.2.17. I tried this:
<% final String MY_DIR = ResourceBundle.getBundle("mybundle").getString("props.pages.wcm"); %>
<% final String page = ResourceBundle.getBundle("mybundle").getString("page"); %>
<% final String inc = MY_DIR + "/" + bonus; %>
<%@include file="<%= inc %>"%>
The path is /wcm/some/other/dir/page and I can happily print that out with out.write(inc)
. Unfortunatly the include
(and the jsp:include
) isn't including the file at all. There is no error message, but the content isn't included... The file is accessible via the browser though.
Do I have to create a full JSP for this to work? I just need a HTML file.
Update
Because there will be more pages to be included sooner or later I decided to create a custom taglib for this case. That way I can capsulate the functionality and set the base directory for my static content in a property file.