| Title | Default Template violates JSP specification |
| Date | 21-Mar-2006 13:47:18 EET |
| Version | 2.3 current |
| Submitter | 68.35.48.58 |
| Bug criticality | MediumBug |
| Browser version | Mozilla |
| Bug status | ClosedBug |
| PageProvider used | Version File Provider |
| Servlet Container | Resin 3.0.18 |
| Operating System | Debian Linux 3.1 |
| URL | http://msb0b.com/JSPWiki/Login.jsp?page=Main![]() |
| Java version | Sun J2SDK 1.5.06 |
Resin gives the following error message when serving Wiki.jsp:
javax.servlet.jsp.JspException: /templates/default/commonheader.jsp:65: interpolated runtime values are forbidden by the JSP spec at `skins/<%=skinName%>/skin.css'
The same error is repeated on line 71.
That line apparantly violates the following specification on p. 1-59 of jsp-2_0-fr-spec.pdf.
When using scriptlet expressions, the expression must appear by itself (multiple expressions, and mixing of expressions and string constants are not permitted).
The workaround is to construct the string before it is used in expression tag. I have made the change and the patch is as follows:
*** ../webapps/JSPWiki/templates/default/commonheader.jsp 2006-03-05 17:25:32.000000000 -0500
--- templates/default/commonheader.jsp 2006-03-21 06:31:58.000000000 -0500
***************
*** 61,75 ****
for( Iterator i = skins.iterator(); i.hasNext(); )
{
String skinName = (String)i.next();
%>
! <link rel="alternate stylesheet" type="text/css" href="<wiki:Link format="url" templatefile="skins/<%=skinName%>/skin.css"/> title="<%=skinName%>" />
<%
}
%>
! <% if(prefSkinName != null) { %>
<link rel="stylesheet" type="text/css"
! href="<wiki:Link format="url" templatefile="skins/<%=prefSkinName%>"/> />
<% } %>
<%-- Here we define the "run when the page loads" -script. --%>
--- 61,78 ----
for( Iterator i = skins.iterator(); i.hasNext(); )
{
String skinName = (String)i.next();
+ String skinCss = "skins/" + skinName + "/skin.css";
%>
! <link rel="alternate stylesheet" type="text/css" href="<wiki:Link format="url" templatefile="<%=skinCss%>"/> title="<%=skinName%>" />
<%
}
%>
! <% if(prefSkinName != null) {
! String skinsPrefSkinName = "skins/" + prefSkinName;
! %>
<link rel="stylesheet" type="text/css"
! href="<wiki:Link format="url" templatefile="<%=skinsPrefSkinName%>"/> />
<% } %>
<%-- Here we define the "run when the page loads" -script. --%>
-- msb0b
Confirmed. I'll patch this in asap. Thanks!
Fixed in 2.3.89
