Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > struts 2 & SF Display tag issues

Reply
Thread Tools

struts 2 & SF Display tag issues

 
 
KN
Guest
Posts: n/a
 
      03-07-2008

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...reference.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.ExpressionEval uationManager - 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
how do u invoke Tag b's Tag Handler from within Tag a's tag Handler? shruds Java 1 01-27-2006 03:00 AM
Is it safe to point to Internet for locating struts DTD files in struts TLDs and XML files? Katie Wright Java 8 01-07-2005 03:37 PM
Struts Installation - missing struts.tld??? Jason Us Java 0 10-03-2003 11:36 PM
Struts redirect logic tag issues Damien Eversmann Java 0 07-09-2003 06:36 PM
struts tag inside a tag kishan bisht Java 1 07-08-2003 11:04 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57