Re: Struts-EL problem with struts-el-1.3.0-dev

2005-07-28 Thread Jeff Beal
On 7/28/05, Marco Mistroni <[EMAIL PROTECTED]> wrote:
> 
> Hello Wendy,
> I missed one point of your statement..
> 
> >> 
> 
> >Even if you're going to use an expression, the 'name' attribute should
> >still
> >evaluate to the _name_ of the bean, not the bean itself.
> >   http://struts.apache.org/userGuide/struts-logic.html#present
> 
> what do you mean? If I store the bean under the attribute name 'result',
> why
> the above EL is wrong?

What you want is:


This will check for a bean stored under the name 'results' in session scope.

${sessionScope.results} evaluates to the bean itself.  The logic tag
receives *that bean* where before it received a String.  I believe
that the logic tag would then convert that bean to a String and look
for an object stored under that name, instead.

Instead of dealing with all of this, just try the following JSTL:



-- Jeff

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Struts-EL problem with struts-el-1.3.0-dev

2005-07-28 Thread Marco Mistroni

Hello Wendy,
I missed one point of your statement..

>> 

>Even if you're going to use an expression, the 'name' attribute should
>still
>evaluate to the _name_ of the bean, not the bean itself.
>   http://struts.apache.org/userGuide/struts-logic.html#present

what do you mean? If I store the bean under the attribute name 'result',
why
the above EL is wrong?

>Then the  tag would be:
>   <%@ taglib uri="http://struts.apache.org/tags-logic-el";
prefix="logic"%>
>   

>No EL required for that one.  But do use the JSTL tags instead whenever
>possible. :)

I use EL to replace   
where Constants.RESULT  has value 'results'

Where does the above declaration differ from the EL?

What does  ${sessionScope.result} represent in this case?



can you show me a quick sample on a simple  use of EL ?
if I store objects in session/request/applicationScope, why can't I use

struts-el with EL to retrieve them?


Thanx in advance for your time and regards
Marco mistroni




[BTW, in a Servlet 2.3 container, you do not need all those 
tags in 
web.xml.  If you use the correct URI, the tlds will be located in the
.jar 
files in WEB-INF/lib.]

-- 
Wendy Smoak



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Struts-EL problem with struts-el-1.3.0-dev

2005-07-28 Thread Wendy Smoak

From: "Marco Mistroni" <[EMAIL PROTECTED]>


Yes I actually reverted to using c:if, and it worked
Just fine

I wanted just to report the situation to see if I was
Using the taglib incorrectly...






Even if you're going to use an expression, the 'name' attribute should still
evaluate to the _name_ of the bean, not the bean itself.
  http://struts.apache.org/userGuide/struts-logic.html#present

If this works:


   // this displays the loop data



Then the  tag would be:
  <%@ taglib uri="http://struts.apache.org/tags-logic-el"; prefix="logic" %>
  

No EL required for that one.  But do use the JSTL tags instead whenever
possible. :)

[BTW, in a Servlet 2.3 container, you do not need all those  tags in 
web.xml.  If you use the correct URI, the tlds will be located in the .jar 
files in WEB-INF/lib.]


--
Wendy Smoak



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: Struts-EL problem with struts-el-1.3.0-dev

2005-07-28 Thread Marco Mistroni
Hello Joe,
Yes I actually reverted to using c:if, and it worked
Just fine

I wanted just to report the situation to see if I was 
Using the taglib incorrectly...


Thanx again and regards
marco


-Original Message-
From: Joe Germuska [mailto:[EMAIL PROTECTED] 
Sent: 28 July 2005 12:15
To: Marco Mistroni; 'Struts Users Mailing List'
Subject: Re: Struts-EL problem with struts-el-1.3.0-dev

At 11:08 AM +0100 7/28/05, Marco Mistroni wrote:
>anyone could give me some hints on what's wrong?
>Do you think the fact that I have both  struts-taglib and struts-el in
>my
>Lib directory could cause problems?

No, because el actually depends on taglib -- you have to have taglib to
use el.

If you're also using JSTL, I would always advise using  
whereever it works -- not that this shouldn't be fixed if it turns 
out to be a bug.

Joe


>Hello all,
>I have an app which is using struts 1.3.. I wanted to 'replace'
>existing struts tag with struts-el tag.
>So I downloaded struts-el-1.3.0-dev and put it into my jar, (along with
>struts-taglib-1.3.0-dev)
>
>I have declared taglibs in web.xml, and I wrote a simple page which
uses
>Struts-el inside a logic:tag
>
>And, to my surprise, it did't work 
>Basically I have an attribute of type collection in my HttpSession, and
>I was trying to access it from the page using
>
>
>
>
>for doublechecking, I wrote a scriptlet code that was trying to get the
>'results' attribute from the session, to see that if it was actually
>there..
>and it was there
>
>Even the c:forEAch loop that uses JSTL to get that attribute works
>fine..
>
>for providing as much info as I can, here is my web.xml
>
>** WEB.XML (TAGLIBS ONLY) *
>
>   
> /WEB-INF/struts-bean.tld
> /WEB-INF/struts-bean.tld
>   
>
>   
> /WEB-INF/struts-html.tld
> /WEB-INF/struts-html.tld
>   
>
>   
> /WEB-INF/struts-logic.tld
> /WEB-INF/struts-logic.tld
>   
>
>   
> /WEB-INF/struts-nested.tld
> /WEB-INF/struts-nested.tld
>   
>
>   
> /WEB-INF/struts-tiles.tld
> /WEB-INF/struts-tiles.tld
>   
>
>
>   
> /WEB-INF/struts-bean-el.tld
> /WEB-INF/struts-bean-el.tld
>   
>
>   
> /WEB-INF/struts-html-el.tld
> /WEB-INF/struts-html-el.tld
>   
>
>   
> /WEB-INF/struts-logic-el.tld
> /WEB-INF/struts-logic-el.tld
>   
>
>   
> /WEB-INF/struts-tiles-el.tld
> /WEB-INF/struts-tiles-el.tld
> 
>***
>
>and here is my JSP (only relevant part)***
>
><%@ taglib prefix='c' uri='http://java.sun.com/jstl/core' %>
><%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt"; %>
><%@ taglib uri="/WEB-INF/struts-html-el.tld" prefix="html" %>
><%@ taglib uri="/WEB-INF/struts-bean-el.tld" prefix="bean" %>
><%@ taglib uri="/WEB-INF/struts-logic-el.tld" prefix="logic"%>
>
><% if(session.getAttribute("results") != null) {
>   java.util.Collection coll =
>(java.util.Collection)session.getAttribute("RESULTS");
>   System.out.println(" in session there are " + coll.size() +
>" elements!!!"); // this print successfully
> }
>%>
>
>
>
> name="${sessionScope.results}">hellovalue="${statusMsg}"/>
> 
>   
>
>
> 
> // this displays the loop data
>
>
>***
>
>
>other than that, in my \lib directory I have both
>struts-taglib-1.3.0-dev and struts-el-1.3.0-dev,
>and I am running my code on Jboss 3.2.5
>
>
>Thanks in advance and regards
>   marco
>
>
>
>
>
>
>
>-
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]


-- 
Joe Germuska
[EMAIL PROTECTED]  
http://blog.germuska.com
"Narrow minds are weapons made for mass destruction"  -The Ex

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Re: Struts-EL problem with struts-el-1.3.0-dev

2005-07-28 Thread Joe Germuska

At 11:08 AM +0100 7/28/05, Marco Mistroni wrote:

anyone could give me some hints on what's wrong?
Do you think the fact that I have both  struts-taglib and struts-el in
my
Lib directory could cause problems?


No, because el actually depends on taglib -- you have to have taglib to use el.

If you're also using JSTL, I would always advise using  
whereever it works -- not that this shouldn't be fixed if it turns 
out to be a bug.


Joe



Hello all,
 I have an app which is using struts 1.3.. I wanted to 'replace'
existing struts tag with struts-el tag.
So I downloaded struts-el-1.3.0-dev and put it into my jar, (along with
struts-taglib-1.3.0-dev)

I have declared taglibs in web.xml, and I wrote a simple page which uses
Struts-el inside a logic:tag

And, to my surprise, it did't work 
Basically I have an attribute of type collection in my HttpSession, and

I was trying to access it from the page using




for doublechecking, I wrote a scriptlet code that was trying to get the
'results' attribute from the session, to see that if it was actually
there..
and it was there

Even the c:forEAch loop that uses JSTL to get that attribute works
fine..

for providing as much info as I can, here is my web.xml

** WEB.XML (TAGLIBS ONLY) *
   
  
/WEB-INF/struts-bean.tld
/WEB-INF/struts-bean.tld
  

  
/WEB-INF/struts-html.tld
/WEB-INF/struts-html.tld
  

  
/WEB-INF/struts-logic.tld
/WEB-INF/struts-logic.tld
  

  
/WEB-INF/struts-nested.tld
/WEB-INF/struts-nested.tld
  

  
/WEB-INF/struts-tiles.tld
/WEB-INF/struts-tiles.tld
  

   
  
/WEB-INF/struts-bean-el.tld
/WEB-INF/struts-bean-el.tld
  

  
/WEB-INF/struts-html-el.tld
/WEB-INF/struts-html-el.tld
  

  
/WEB-INF/struts-logic-el.tld
/WEB-INF/struts-logic-el.tld
  

  
/WEB-INF/struts-tiles-el.tld
/WEB-INF/struts-tiles-el.tld

***


and here is my JSP (only relevant part)***

<%@ taglib prefix='c' uri='http://java.sun.com/jstl/core' %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt"; %>
<%@ taglib uri="/WEB-INF/struts-html-el.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean-el.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-logic-el.tld" prefix="logic"%>

<% if(session.getAttribute("results") != null) {
java.util.Collection coll =
(java.util.Collection)session.getAttribute("RESULTS");
System.out.println(" in session there are " + coll.size() +
" elements!!!"); // this print successfully
}
%>



hello

  


 
    // this displays the loop data



***


other than that, in my \lib directory I have both
struts-taglib-1.3.0-dev and struts-el-1.3.0-dev,
and I am running my code on Jboss 3.2.5


Thanks in advance and regards
marco







-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



--
Joe Germuska
[EMAIL PROTECTED]  
http://blog.germuska.com
"Narrow minds are weapons made for mass destruction"  -The Ex


-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Struts-EL problem with struts-el-1.3.0-dev

2005-07-28 Thread Marco Mistroni
Hello all,
 I have an app which is using struts 1.3.. I wanted to 'replace'
existing struts tag with struts-el tag.
So I downloaded struts-el-1.3.0-dev and put it into my jar, (along with
struts-taglib-1.3.0-dev)

I have declared taglibs in web.xml, and I wrote a simple page which uses
Struts-el inside a logic:tag

And, to my surprise, it did't work  
Basically I have an attribute of type collection in my HttpSession, and
I was trying to access it from the page using




for doublechecking, I wrote a scriptlet code that was trying to get the
'results' attribute from the session, to see that if it was actually
there..
and it was there

Even the c:forEAch loop that uses JSTL to get that attribute works
fine..

for providing as much info as I can, here is my web.xml

** WEB.XML (TAGLIBS ONLY) *
   
  
/WEB-INF/struts-bean.tld
/WEB-INF/struts-bean.tld
  

  
/WEB-INF/struts-html.tld
/WEB-INF/struts-html.tld
  

  
/WEB-INF/struts-logic.tld
/WEB-INF/struts-logic.tld
  

  
/WEB-INF/struts-nested.tld
/WEB-INF/struts-nested.tld
  

  
/WEB-INF/struts-tiles.tld
/WEB-INF/struts-tiles.tld
  

   
  
/WEB-INF/struts-bean-el.tld
/WEB-INF/struts-bean-el.tld
  

  
/WEB-INF/struts-html-el.tld
/WEB-INF/struts-html-el.tld
  

  
/WEB-INF/struts-logic-el.tld
/WEB-INF/struts-logic-el.tld
  

  
/WEB-INF/struts-tiles-el.tld
/WEB-INF/struts-tiles-el.tld
 
***

and here is my JSP (only relevant part)***

<%@ taglib prefix='c' uri='http://java.sun.com/jstl/core' %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt"; %> 
<%@ taglib uri="/WEB-INF/struts-html-el.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean-el.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-logic-el.tld" prefix="logic"%>

<% if(session.getAttribute("results") != null) {
java.util.Collection coll =
(java.util.Collection)session.getAttribute("RESULTS");
System.out.println(" in session there are " + coll.size() +
" elements!!!"); // this print successfully
}
%>



hello

  
  

  
    // this displays the loop data


***


other than that, in my \lib directory I have both
struts-taglib-1.3.0-dev and struts-el-1.3.0-dev,
and I am running my code on Jboss 3.2.5

anyone could give me some hints on what's wrong?
Do you think the fact that I have both  struts-taglib and struts-el in
my
Lib directory could cause problems?

Thanks in advance and regards
marco







-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]