|
Mantis - Resin
|
|||||
| Viewing Issue Advanced Details | |||||
|
|
|||||
| ID: | Category: | Severity: | Reproducibility: | Date Submitted: | Last Update: |
| 46 | minor | always | 03-22-05 00:00 | 05-11-05 00:00 | |
|
|
|||||
| Reporter: | sergek | Platform: | |||
| Assigned To: | OS: | ||||
| Priority: | urgent | OS Version: | |||
| Status: | closed | Product Version: | 3.0.12 | ||
| Product Build: | 3.0.12 | Resolution: | fixed | ||
| Projection: | none | ||||
| ETA: | none | Fixed in Version: | 3.0.13 | ||
|
|
|||||
| Summary: | 0000046: Tag re-use finding wrong parent | ||||
| Description: |
RSN-37 I have a custom tag library that looks for a parent tag. For example: <i:select> <c:forEach> <i:option></i:option> </c:forEach> </i:select> The option tag interacts with the select tag, so in my custom tag's doStartTag(), I have SelectTag parent = (SelectTag) TagSupport.findAncestorWithClass(this, SelectTag.class); I'm getting an exception when I have multiple select/option blocks. The problem seems to be how the tags are created and later reused. Here is the generated code for the option tag: if (_jsp_OptionTag_5 == null) { _jsp_OptionTag_5 = new com.lokitech.jsp.input.OptionTag(); _jsp_OptionTag_5.setPageContext(pageContext); _jsp_OptionTag_5.setParent((javax.servlet.jsp.tagext.Tag) _jsp_int_loop_1); } The second time the option tag is used, you have generated code that looks like this: if (_jsp_OptionTag_5 == null) { _jsp_OptionTag_5 = new com.lokitech.jsp.input.OptionTag(); _jsp_OptionTag_5.setPageContext(pageContext); _jsp_OptionTag_5.setParent((javax.servlet.jsp.tagext.Tag) _jsp_int_loop_2); } The second time this is run, obviously the _jsp_OptionTag_5 instance has already been created, and thus _jsp_int_loop_2 is not set as the parent. My custom tag either then gets the wrong parent tag (the first select tag), or it gets none (because of how I use forEach tags elsewhere on the page.) |
||||
| Steps To Reproduce: | |||||
| Additional Information: | Tested on Resin 3.0.10 through 3.0.12. Both Linux RH deployment and Windows XP development. JDK 1.4.2_07. | ||||
| Relationships | |||||
| Attached Files: | |||||
| Notes | |||||
|
|
|||||
|
|
||||
|
|
|||||
|
|
||||
|
|
|||||
|
|
||||
|
|
|||||
|
|
||||