Uploaded image for project: 'Struts 2'
  1. Struts 2
  2. WW-3659

strange behavior of s:a tag with s:include tag inside

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.2.3
    • Fix Version/s: 2.5.12
    • Labels:
      None
    • Environment:

      Windows XP SP3, Java SE 1.6.0_02 build 06, Apache tomcat 7.0.8

      Description

      I have two files.

      test.jsp
      <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
      <%@ taglib uri="/struts-tags" prefix="s" %>
      <s:set name="depId" value="1" scope="page"/>
      <s:a id="%{#attr.depId}" href="javascript:some-javascript-method('%{#attr.depId}')">
      	<s:include value="test2.jsp"/>
      </s:a>
      
      test2.jsp
      <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
      <%@ taglib uri="/struts-tags" prefix="s" %>
      <s:set name="test" value="1" scope="page"/>
      1
      

      The result of call http://localhost:8080/myapp/test.jsp is:

      <a id="1" href="javascript:some-javascript-method('')">1</a>
      

      as we can see, second evaluation of %{#attr.depId} is missing (must be javascript:some-javascript-method('1')). I cannot understand why it happens.
      But when I remove line <s:set name="test" value="1" scope="page"/> from test2.jsp file and call again I receive correct result:

      <a id="1" href="javascript:some-javascript-method('1')">1</a>
      

      Is this a bug or I do not understand something in Struts2

        Attachments

        1. WW-3659.patch
          2 kB
          Lukasz Lenart
        2. StrutsBugTest.war
          4.15 MB
          Alexander Visokov

          Activity

            People

            • Assignee:
              lukaszlenart Lukasz Lenart
              Reporter:
              sviborg Alexander Visokov
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: