Issue Details (XML | Word | Printable)

Key: SM-20
Type: Improvement Improvement
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Matt Raible
Reporter: Matt Raible
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Struts Menu

DisplayMenuTag.parseString accept non-string variables

Created: 08/May/06 11:45 PM   Updated: 06/Oct/06 12:40 AM   Resolved: 06/Oct/06 12:40 AM
Component/s: Menu Core
Affects Version/s: 2.3
Fix Version/s: 2.4.2


 Description  « Hide
Moved from SourceForge https://sourceforge.net/tracker/index.php?func=detail&aid=965199&group_id=48726&atid=453977:

The new variable feature for a menu item is great!
Changing the parseString method to retrieve variables
that are not strings would be even better. My specific
example is a menu item that loads an object based on
an ID session attribute. The id attribute is a Long and
thus causes an ClassCastException. I've created a
string representation of this as a workaround, but would
love to see a small change...

Instead of this:

private StringBuffer parseString(String str,
HttpServletRequest request) {
//...
String value = (String) pageContext.findAttribute
(variable);
//...
}

Consider:

private StringBuffer parseString(String str,
HttpServletRequest request) {
//...
String value = String.valueOf(pageContext.findAttribute
(variable));
//...
}

submitted by jonwilmoth@yahoo.com

Matt Raible made changes - 03/Oct/06 03:59 PM
Field Original Value New Value
Fix Version/s 2.4.2 [ 10091 ]
Fix Version/s 2.5 [ 10070 ]
Matt Raible made changes - 06/Oct/06 12:40 AM
Resolution Fixed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]