You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by temp temp <mi...@yahoo.com> on 2006/03/10 17:27:41 UTC

using tag

I am using struts 1.1    
  
  I using logic equal tag  to check whether a page context attribute value  equals to some value .
  
  
  here is my code
  
      <bean:define id="test" value="0"/>
      <logic:equal name="test" value="0">
         <bean:define id="test1" value="2" />
      </logic:equal>
  
      <logic:equal name="test" value="1">
         <bean:define id="test1" value="3" />
      </logic:equal>
  
  So  only one logic equal will be true but not both .    But when I call this jsp   in the browser I get  
  
  jsp exception  
  
  
  OracleJSP: oracle.jsp.parse.JspParseException: Line # 220, 
  <bean:define id="test1" value="3" />
  Error: Tag attempted to define a bean which already exists: test1
  
  Why should I get this error when only one condition is true?
  Thanks & Regards
  sairam 
  
  
		
---------------------------------
 Yahoo! Mail
 Use Photomail to share photos without annoying attachments.

Re: using tag

Posted by Laurie Harper <la...@holoweb.net>.
To understand why this is a problem, look at the source of the Java 
servlet that's generated. Remember that the JSP is translated statically 
into Java, and then the resulting Java is compiled and run.

Try this instead:

   <bean:define id="test1">
     <logic:equal name="test" value="0">2</logic:equal>
     <logic:equal name="test" value="1">3</logic:equal>
   </bean:define>

L.

temp temp wrote:
> Can somebody help me with this?
> 
> Michael Jouravlev <jm...@gmail.com> wrote:  On 3/10/06, Michael Jouravlev  wrote:
>> On 3/10/06, temp temp  wrote:
>>> I am using struts 1.1
>>>
>>>   I using logic equal tag  to check whether a page context attribute value  equals to some value .
>>>
>>>
>>>   here is my code
>>>
>>>       
>>>       
>>>          
>>>       
>>>
>>>       
>>>          
>>>       
>>>
>>>   So  only one logic equal will be true but not both .    But when I call this jsp   in the browser I get
>>>
>>>   jsp exception
>>>
>>>
>>>   OracleJSP: oracle.jsp.parse.JspParseException: Line # 220,
>>>   
>>>   Error: Tag attempted to define a bean which already exists: test1
>>>
>>>   Why should I get this error when only one condition is true?
>> What about the very first line of your code?
>>
> Oops, I take that back. It is a different bean.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
> 
> 
> 
> 		
> ---------------------------------
> Yahoo! Mail
> Bring photos to life! New PhotoMail  makes sharing a breeze. 


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


Re: using tag

Posted by Tamas Szabo <sz...@gmail.com>.
On 3/11/06, temp temp <mi...@yahoo.com> wrote:
>
> Can somebody help me with this?


Well, if I have a problem I usually remove all the stuff that works so I can
isolate the problem.
That way you would have only the code you posted in the JSP (the error would
not be at line 220) so you could post the whole JSP.

And then we could see if you defined the logic taglib at the beginning of
the file as you defined the bean.
This is just a wild guess of course (because we just see a small piece of
the code), but maybe if the <logic> taglibs are not defined then they become
just html code so the bean test1 ends up in being defined twice.

By the way I love this guessing game :-D, please tell me if this was the
problem...


Tamas




Michael Jouravlev <jm...@gmail.com> wrote:  On 3/10/06, Michael
> Jouravlev  wrote:
> > On 3/10/06, temp temp  wrote:
> > > I am using struts 1.1
> > >
> > >   I using logic equal tag  to check whether a page context attribute
> value  equals to some value .
> > >
> > >
> > >   here is my code
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >   So  only one logic equal will be true but not both .    But when I
> call this jsp   in the browser I get
> > >
> > >   jsp exception
> > >
> > >
> > >   OracleJSP: oracle.jsp.parse.JspParseException: Line # 220,
> > >
> > >   Error: Tag attempted to define a bean which already exists: test1
> > >
> > >   Why should I get this error when only one condition is true?
> >
> > What about the very first line of your code?
> >
> Oops, I take that back. It is a different bean.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>
>
> ---------------------------------
> Yahoo! Mail
> Bring photos to life! New PhotoMail  makes sharing a breeze.
>

Re: using tag

Posted by temp temp <mi...@yahoo.com>.
Can somebody help me with this?

Michael Jouravlev <jm...@gmail.com> wrote:  On 3/10/06, Michael Jouravlev  wrote:
> On 3/10/06, temp temp  wrote:
> > I am using struts 1.1
> >
> >   I using logic equal tag  to check whether a page context attribute value  equals to some value .
> >
> >
> >   here is my code
> >
> >       
> >       
> >          
> >       
> >
> >       
> >          
> >       
> >
> >   So  only one logic equal will be true but not both .    But when I call this jsp   in the browser I get
> >
> >   jsp exception
> >
> >
> >   OracleJSP: oracle.jsp.parse.JspParseException: Line # 220,
> >   
> >   Error: Tag attempted to define a bean which already exists: test1
> >
> >   Why should I get this error when only one condition is true?
>
> What about the very first line of your code?
>
Oops, I take that back. It is a different bean.

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



		
---------------------------------
Yahoo! Mail
Bring photos to life! New PhotoMail  makes sharing a breeze. 

Re: using tag

Posted by Michael Jouravlev <jm...@gmail.com>.
On 3/10/06, Michael Jouravlev <jm...@gmail.com> wrote:
> On 3/10/06, temp temp <mi...@yahoo.com> wrote:
> > I am using struts 1.1
> >
> >   I using logic equal tag  to check whether a page context attribute value  equals to some value .
> >
> >
> >   here is my code
> >
> >       <bean:define id="test" value="0"/>
> >       <logic:equal name="test" value="0">
> >          <bean:define id="test1" value="2" />
> >       </logic:equal>
> >
> >       <logic:equal name="test" value="1">
> >          <bean:define id="test1" value="3" />
> >       </logic:equal>
> >
> >   So  only one logic equal will be true but not both .    But when I call this jsp   in the browser I get
> >
> >   jsp exception
> >
> >
> >   OracleJSP: oracle.jsp.parse.JspParseException: Line # 220,
> >   <bean:define id="test1" value="3" />
> >   Error: Tag attempted to define a bean which already exists: test1
> >
> >   Why should I get this error when only one condition is true?
>
> What about the very first line of your code?
>
Oops, I take that back. It is a different bean.

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


Re: using tag

Posted by Michael Jouravlev <jm...@gmail.com>.
On 3/10/06, temp temp <mi...@yahoo.com> wrote:
> I am using struts 1.1
>
>   I using logic equal tag  to check whether a page context attribute value  equals to some value .
>
>
>   here is my code
>
>       <bean:define id="test" value="0"/>
>       <logic:equal name="test" value="0">
>          <bean:define id="test1" value="2" />
>       </logic:equal>
>
>       <logic:equal name="test" value="1">
>          <bean:define id="test1" value="3" />
>       </logic:equal>
>
>   So  only one logic equal will be true but not both .    But when I call this jsp   in the browser I get
>
>   jsp exception
>
>
>   OracleJSP: oracle.jsp.parse.JspParseException: Line # 220,
>   <bean:define id="test1" value="3" />
>   Error: Tag attempted to define a bean which already exists: test1
>
>   Why should I get this error when only one condition is true?

What about the very first line of your code?

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