TitleDefault Template violates JSP specification
Date21-Mar-2006 13:47:18 EET
Version2.3 current
Submitter68.35.48.58
Bug criticalityMediumBug
Browser versionMozilla
Bug statusClosedBug
PageProvider usedVersion File Provider
Servlet ContainerResin 3.0.18
Operating SystemDebian Linux 3.1
URLhttp://msb0b.com/JSPWiki/Login.jsp?page=Main
Java versionSun 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!

-- JanneJalkanen

Fixed in 2.3.89

Add new attachment

Only authorized users are allowed to upload new attachments.
« This page (revision-5) was last changed on 22-Mar-2006 20:12 by Janne Jalkanen