
|
If you were logged in you would be able to see more operations.
|
|
|
Struts Menu
Created: 26/Jun/06 07:02 PM
Updated: 23/Mar/07 02:04 PM
|
|
| Component/s: |
Displayers
|
| Affects Version/s: |
2.4
|
| Fix Version/s: |
2.4.2
|
|
|
CSSListMenuDisplayer doesn´t seem to be handling correctly menu tags without location, action or page:
<Menu name="admin" title="Administration" toolTip="Administration tasks" >
<Item title="Budget Lines" toolTip="Budget lines management" page="/budgetLines.jsp" />
<Item title="Workflow history" toolTip="View workflow history of a request" page="/viewWorkflow.jsp" />
</Menu>
In the example, the main component 'admin' has not location, page or action. If you use this definition will obtain this (note the 'null' string in the href of 'Administration'):
<ul id="primary-nav" class="menuList">
<li class="menubar">
<a href="null">Administration</a>
<ul>
<li><a href="/e-SCP/budgetLines.jsp" title="Budget lines management">Budget Lines</a></li>
<li><a href="/e-SCP/viewWorkflow.jsp" title="View workflow history of a request">Workflow history</a></li>
</ul>
</li>
</ul>
I have been viewing the CSSListMenuDisplayer class and I have seen some suspicious code. For example, there is a strange concatenation of if clauses at the beginning of the displayComponents method:
protected void displayComponents(MenuComponent menu, int level)
throws JspException, IOException {
MenuComponent[] components = menu.getMenuComponents();
if (components.length > 0) {
// if there is a location/page/action tag on base item use it
if (components.length == 0){
...
Thanks in advance
|
|
Description
|
CSSListMenuDisplayer doesn´t seem to be handling correctly menu tags without location, action or page:
<Menu name="admin" title="Administration" toolTip="Administration tasks" >
<Item title="Budget Lines" toolTip="Budget lines management" page="/budgetLines.jsp" />
<Item title="Workflow history" toolTip="View workflow history of a request" page="/viewWorkflow.jsp" />
</Menu>
In the example, the main component 'admin' has not location, page or action. If you use this definition will obtain this (note the 'null' string in the href of 'Administration'):
<ul id="primary-nav" class="menuList">
<li class="menubar">
<a href="null">Administration</a>
<ul>
<li><a href="/e-SCP/budgetLines.jsp" title="Budget lines management">Budget Lines</a></li>
<li><a href="/e-SCP/viewWorkflow.jsp" title="View workflow history of a request">Workflow history</a></li>
</ul>
</li>
</ul>
I have been viewing the CSSListMenuDisplayer class and I have seen some suspicious code. For example, there is a strange concatenation of if clauses at the beginning of the displayComponents method:
protected void displayComponents(MenuComponent menu, int level)
throws JspException, IOException {
MenuComponent[] components = menu.getMenuComponents();
if (components.length > 0) {
// if there is a location/page/action tag on base item use it
if (components.length == 0){
...
Thanks in advance |
Show » |
|
if (menu.getUrl() == null) {
menu.setUrl("#");
}
Having <a href="#"> will result in a link that does nothing when you click on it (except for invoking JavaScript events).