History | Log In     View a printable version of the current page.  
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
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

 All   Comments   Change History   FishEye      Sort Order:
There are no comments yet on this issue.