You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Norris Shelton <no...@yahoo.com> on 2005/01/28 00:49:35 UTC

Problem using logic:equal and logic:notEqual

I'm trying to determine which block of HTML to output.  This is
on a page that will be included by many different forms.  

<logic:equal property="stateSelection" value="SELSTATE">
     <span id="selectBox" style="display:block;">
</logic:equal>
<logic:notEqual property="stateSelection" value="SELSTATE">
     <span id="selectBox" style="display:none;">
</logic:notEqual>


Anybody have a suggestion?


Here is the beginning of the exception:
javax.servlet.jsp.JspException: No selector attribute
(cookie/header/name/parameter) was specified
18:23:07,500 ERROR [Engine] StandardWrapperValve[jsp]:
Servlet.service() for servlet jsp threw exception
	at
org.apache.struts.taglib.logic.CompareTagBase.condition(CompareTagBase.java:205)
	at
org.apache.struts.taglib.logic.EqualTag.condition(EqualTag.java:46)
	at
org.apache.struts.taglib.logic.ConditionalTagBase.doStartTag(ConditionalTagBase.java:174)
	at
org.apache.jsp.tag.web.location_tag._jspx_meth_logic_equal_0(location_tag.java:216)
javax.servlet.jsp.JspException: No selector attribute
(cookie/header/name/parameter) was specified

=====

Norris Shelton
Software Engineer
Sun Certified Java 1.1 Programmer
Appriss, Inc.
ICQ# 26487421
AIM NorrisEShelton
YIM norrisshelton



	
		
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - You care about security. So do we. 
http://promotions.yahoo.com/new_mail

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Problem using logic:equal and logic:notEqual

Posted by Norris Shelton <no...@yahoo.com>.
I was missing name.  I was a little leary, because the form name
would depend on which form I was included on at the time.  I
changed the file to a tag file and sent the form name as a
parameter.  This worked perfectly:

<logic:equal name="${formName}" property="stateSelection"
value="SELSTATE">
     <span id="selectBox" style="display:block;">
</logic:equal>
<logic:notEqual name="${formName}" property="stateSelection"
value="SELSTATE">
     <span id="selectBox" style="display:none;">
</logic:notEqual>

Thx for your help.

--- Wendy Smoak <ja...@wendysmoak.com> wrote:

> From: "Norris Shelton" <no...@yahoo.com>
> > I'm trying to determine which block of HTML to output.  This
> is
> > on a page that will be included by many different forms.
> >
> > <logic:equal property="stateSelection" value="SELSTATE">
> >      <span id="selectBox" style="display:block;">
> > </logic:equal>
> > <logic:notEqual property="stateSelection" value="SELSTATE">
> >      <span id="selectBox" style="display:none;">
> > </logic:notEqual>
> >
> > javax.servlet.jsp.JspException: No selector attribute
> > (cookie/header/name/parameter) was specified
> 
> http://struts.apache.org/userGuide/struts-logic.html#equal
> 
> Your logic:equal tag is missing an attribute, either cookie,
> header, name,
> or parameter.  Given that you're using 'property', you need to
> tell it the
> 'name' of the bean that has this property.  (Logic tags do not
> default to an
> enclosing <html:form> bean the way the html tags do.)
> 
> How about
>    <span id="selectBox" style="display:<c:out
> value="${selstate}"/>">
> 
> -- 
> Wendy Smoak
> 
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 


=====

Norris Shelton
Software Engineer
Sun Certified Java 1.1 Programmer
Appriss, Inc.
ICQ# 26487421
AIM NorrisEShelton
YIM norrisshelton



		
__________________________________ 
Do you Yahoo!? 
Yahoo! Mail - Helps protect you from nasty viruses. 
http://promotions.yahoo.com/new_mail

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org


Re: Problem using logic:equal and logic:notEqual

Posted by Wendy Smoak <ja...@wendysmoak.com>.
From: "Norris Shelton" <no...@yahoo.com>
> I'm trying to determine which block of HTML to output.  This is
> on a page that will be included by many different forms.
>
> <logic:equal property="stateSelection" value="SELSTATE">
>      <span id="selectBox" style="display:block;">
> </logic:equal>
> <logic:notEqual property="stateSelection" value="SELSTATE">
>      <span id="selectBox" style="display:none;">
> </logic:notEqual>
>
> javax.servlet.jsp.JspException: No selector attribute
> (cookie/header/name/parameter) was specified

http://struts.apache.org/userGuide/struts-logic.html#equal

Your logic:equal tag is missing an attribute, either cookie, header, name,
or parameter.  Given that you're using 'property', you need to tell it the
'name' of the bean that has this property.  (Logic tags do not default to an
enclosing <html:form> bean the way the html tags do.)

How about
   <span id="selectBox" style="display:<c:out value="${selstate}"/>">

-- 
Wendy Smoak


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
For additional commands, e-mail: user-help@struts.apache.org