Include static file in JSP with variable filename on WebSphere 6

Posted by cringe on Stack Overflow See other posts from Stack Overflow or by cringe
Published on 2010-05-25T13:57:35Z Indexed on 2010/05/25 14:01 UTC
Read the original article Hit count: 345

Filed under:
|
|
|

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.

© Stack Overflow or respective owner

Related posts about java

Related posts about jsp