...

View Full Version : use of logic equal tag in struts



Parijat
02-26-2004, 10:06 AM
I'm getting this error :
E SRVE0026E: [Servlet Error]-[No selector attribute ;cookie/header/name/parameter; was specified]: javax.servlet.jsp.JspException: No selector attribute (cookie/header/name/parameter) was specified
at org.apache.struts.taglib.logic.CompareTagBase.condition(CompareTagBase.java:249)

when i'm trying to reload (in sorted form )my jsp page which is :

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ taglib uri="struts/bean" prefix="bean" %>
<%@ taglib uri="struts/html" prefix="html" %>
<%@ taglib uri="struts/logic" prefix="logic" %>

<html:html>
<html:base/>
<HEAD>
<link href="../../css/Master.css" rel="stylesheet" type="text/css">
<TITLE><bean:message key="title.manageProjects" /></TITLE>
<SCRIPT src="../../js/common.js">
</SCRIPT>
<SCRIPT src="../../js/windowops.js">
</SCRIPT>
<SCRIPT language="javascript">
function fnDeleteProject()
{
if(confirm(' * Deleting a project will remove all non-published\n models and variables contained within the project.\n * This action cannot be undone. \n\n Do you want to delete the selected project(s) ? '))
{
document.forms[0].method.value="deleteProject";
document.forms[0].submit();
}
}

function fnAction()
{
alert(document.forms[0].actionMenu.value);
var selectedAction=document.forms[0].actionMenu.value;


if (selectedAction=="Delete Projects")
{
var chkBoxCheckedDelete=fnChkBoxChecked();
if(chkBoxCheckedDelete==0)
{
alert('Please select the projects for this action ');
return;

}
else
{
fnDeleteProject();
}
}

}



function fnChkBoxChecked()
{
var chkBoxesSelected=0;
for (i=0;i<document.forms[0].selectedProjects.length;i++)
{
if(document.forms[0].selectedProjects[i].checked==true)
{
chkBoxesSelected++;
}
}


return chkBoxesSelected;

}

function fnEditDefinedProject(name)
{
document.forms[0].editProjectName.value=name;
document.forms[0].method.value="editDefineProject";
document.forms[0].submit();
}

function fnSort(column)
{
document.forms[0].method.value="sortProject";
document.forms[0].sortColumn.value=column;
if(document.forms[0].sortOrder.value=="asc")
{
document.forms[0].sortOrder.value="desc";
}
else if(document.forms[0].sortOrder.value=="desc")
{
document.forms[0].sortOrder.value="asc";
}
document.forms[0].submit();
}

</SCRIPT>
</HEAD>
<BODY>
<FONT class="title">manage&nbsp;&gt;&nbsp;projects</FONT>
<html:form action="ProjectAction">

<TABLE cellspacing="0" width="100%">
<TBODY>
<TR class="tableHeader">
<TD width="10%"><A href="javascript:checkAll('selectedProjects')" class="linkStyleNormalWhite"><DIV id="checkAllDiv">Check All</DIV></TD>
<TD width="20%" valign="bottom"><A href="JavaScript:fnSort('name')" class="linkStyleNormalWhite">
<logic:notEmpty name="ProjectForm" property="sortColumn" scope="request">
<logic:notEmpty name="ProjectForm" property="sortOrder" scope="request">
<logic:equal name="ProjectForm" property="sortColumn" value="name" scope="request">
<logic:equal name="ProjectForm" property="sortOrder" value="asc" scope="request">
<IMG align="bottom" id="toggleImage"
border="0" src="../../images/ascending.gif">
</logic:equal>
<logic:equal property="sortOrder" value="desc">
<IMG align="bottom" id="toggleImage"
border="0" src="../../images/descending.gif">
</logic:equal>
</logic:equal>
</logic:notEmpty>
</logic:notEmpty>
Project</A></TD>
<TD width="15%" valign="bottom"><A href="JavaScript:fnSort('status')" class="linkStyleNormalWhite">
<logic:notEmpty name="ProjectForm" property="sortColumn" scope="request">
<logic:notEmpty name="ProjectForm" property="sortOrder" scope="request">
<logic:equal name="ProjectForm" property="sortColumn" value="status" scope="request">
<logic:equal name="ProjectForm" property="sortOrder" value="asc" scope="request">
<IMG align="bottom" id="toggleImage"
border="0" src="../../images/ascending.gif">
</logic:equal>
<logic:equal property="sortOrder" value="desc">
<IMG align="bottom" id="toggleImage"
border="0" src="../../images/descending.gif">
</logic:equal>
</logic:equal>
</logic:notEmpty>
</logic:notEmpty>
Status</A></TD>
<TD width="20%" valign="bottom">Creation Date</TD>
<TD valign="bottom">Created By</TD>

</TR>
<% int i=0;
String className="";
String linkClass=""; %>
<logic:iterate id="ProjectData" name="projectList">
<% i++;
if(i%2==1)
{
className="row2";
linkClass="linkStyleNormalWhite";
}
else
{
className="row1";
linkClass="linkStyleNormalBlack";
}
%>

<TR class="<%= className %>">
<TD><html:multibox property="selectedProjects" ><bean:write name="ProjectData" property="name" /></html:multibox></TD>
<TD ><A href="javascript:fnEditDefinedProject('<bean:write name="ProjectData" property="name" />')"
class="<%= linkClass %>"><bean:write name="ProjectData" property="name" /></A></TD>
<TD ><bean:write name="ProjectData" property="status" /></TD>
<TD ><bean:write name="ProjectData" property="lastUpdatedOn" /></TD>
<TD ><bean:write name="ProjectData" property="lastUpdatedByNbid" /></TD>
</TR>
</logic:iterate>
<TR>
<TD colspan="5" align="center" class="regularbold" >Select Action&nbsp;&nbsp;<select name="actionMenu">
<option value="Delete Projects">Delete Projects</option>
<option value="Manage Models">Manage Models</option>
</select> <input type="button" name="Ok" value="Ok"
onclick="javascript:fnAction()"></TD>
</TR>
</TBODY>
</TABLE>

<html:hidden property="editProjectName" value=""/>
<html:hidden property="sortOrder" value="asc" />
<html:hidden property="sortColumn" value="name" />
<html:hidden property="method" value=""/>
</html:form>
</BODY>

</html:html>

CAN SOMEONE HELP PLEASE AS IT IS URGENT

glanoush
10-13-2004, 07:07 AM
Just change the property attribute from all your logical test to name attribute.

It will work.

Glanoush. ;)

liorean
10-13-2004, 11:30 AM
Moving over to the server side forums.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum