struts 2 & SF Display tag issues

Discussion in 'Java' started by KN, Mar 7, 2008.

  1. KN

    KN Guest

    Am quite confused over a number of struts-related issues concerning a
    problem I've been working on & would appreciate any help/comments.
    Am very new to struts - so please forgive any misconceptions/errors
    on my part.


    Some prerequisites


    - am developing with struts 2

    - Am using the display tag from sourceforge
    http://displaytag.sourceforge.net/11/displaytag/tagreference.html

    - Am using Tomcat 5.0.28 (a JSP 2.0 container)



    I have a struts action that places a number of objects into the
    ActionContext, I am also accessing various properties of this Action
    using OGNL and some standard JSP EL constructs.



    - my problem is - I want to use an EL expressing in the display tag -
    JSP code snipped below - but don't really understand
    the implications
    <!-- BEGIN CODE -->
    <!--------------------------------------------------------->
    <!-- NOTE: using the el variant od the display tag -->
    <%@ taglib uri="http://displaytag.sf.net/el" prefix="display" %>

    <s:iterator id="current" value="sessionDisplayers" >

    <s:set name="id" value="#current" scope="page" />
    <display:table name="${id}"
    id="${id}"
    class="scrollTable"
    pagesize="18"
    decorator="com.mycompany.MyDecorator"
    requestURI=""
    style="width:65%">


    <display:column property="myRepository.name"
    sortProperty="myRepository.name"
    sortable="true"
    headerClass="sortable"
    class="standardStyle"
    titleKey="displayTag.repository.device"/>


    <!--------------------------------------------------------->
    <!-- END CODE -->


    - as you can see - I use a struts iteration tag to access a property
    (getSessionDisplayers) on my action - and instantiate a variable
    'current'
    I then set an attribute (id) in the page context - and use this from
    within my display tag - so that the same markup can be reused.

    - now the real problem - I am having to use the el related classes for
    this;

    <%@ taglib uri="http://displaytag.sf.net/el" prefix="display" %>

    in contrast to;

    <%@ taglib uri="http://displaytag.sf.net" prefix="display" %>

    However there are a number of issues/questions here

    the EL tag libs require the use of
    org.apache.taglibs.standard.support.ExpressionEvaluationManager - this
    class is contained within the
    standard-1.0.6.jar - which (I think) is a struts-1.x library (remember
    this is a struts-2 application) - I know there's no problem
    introducing
    this dependency (nothing seems to break, no namespace clashes etc... -
    is it ok for me to do this ??).

    Secondly - I assumed that in a JSP 2.0/2.1 container - EL expression
    evaluation was handled by the container - that's why pre-JSP 2.0 you
    see 2 variants
    or the core libraries - one for 'normal' behaviour, and one for tags
    that utilise runtime/EL expressions - hence tlds like

    http://java.sun.com/jstl-el/core

    .... for handling EL expressions within tags


    http://java.sun.com/jsp/jstl/core

    .... for translation time only stuff

    But in JSP 2.x EL evaluation is handled by the container - not the
    taglib - so in a JSP 2.x authored/hosted app. you don't need to
    reference/utilise an 'el' variant
    of the core taglibs if you want to use request-time expressions within
    your code.

    - so am confused - I'm using struts 2 with a JSP 2.0 container so
    surely the container should handle EL expressions, or is there a
    struts 2.x version of
    ExpressionEvaluationManager - or is the standard-1.0.6.jar ok to use
    within a struts 2.x application.


    Thanks in advance
     
    KN, Mar 7, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. kishan bisht

    struts tag inside a tag

    kishan bisht, Jul 8, 2003, in forum: Java
    Replies:
    1
    Views:
    1,517
    Wendy S
    Jul 9, 2003
  2. Damien Eversmann

    Struts redirect logic tag issues

    Damien Eversmann, Jul 9, 2003, in forum: Java
    Replies:
    0
    Views:
    2,775
    Damien Eversmann
    Jul 9, 2003
  3. Katie Wright
    Replies:
    8
    Views:
    4,378
    Andrea Desole
    Jan 7, 2005
  4. Jason Us
    Replies:
    0
    Views:
    1,027
    Jason Us
    Oct 4, 2003
  5. shruds
    Replies:
    1
    Views:
    963
    John C. Bollinger
    Jan 27, 2006
Loading...

Share This Page