File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Struts and the fly likes JSTL: problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "JSTL: problem" Watch "JSTL: problem" New topic
Author

JSTL: problem

Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5266
    
  13

i've got following code in my jsp:


when this page is generated, i get the following result:



why i get both times the constant value "${zoektype.waarde}" and not the dynamic value retrieved by calling zoektype.getWaarde() ???


SCJA, SCJP (1.4 | 5.0 | 6.0), SCJD
http://www.javaroe.be/
Junilu Lacar
Bartender

Joined: Feb 26, 2001
Posts: 4462
    
    6

Either

1. Use the EL-enabled Struts tag libraries

or

2. Use

<input type="radio" value="<cut value="${zoektype.waarde}" />" name="zoekType">
<cut value="${zoektype.label}"
[ October 20, 2004: Message edited by: Junilu Lacar ]

Junilu - [How to Ask Questions] [How to Answer Questions]
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5266
    
  13

what are the EL-enabled struts tag libraries ?
Junilu Lacar
Bartender

Joined: Feb 26, 2001
Posts: 4462
    
    6

See http://struts.apache.org/userGuide/building_view.html#struts-el
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5266
    
  13

i did see this, but i don't get a clue how to implement this. has anyone a good example of the use of these struts-el tags ?

Thanks
Junilu Lacar
Bartender

Joined: Feb 26, 2001
Posts: 4462
    
    6

To use the Struts-EL tags, you need to use the following files from the Struts distribution:

struts.jar
struts-el.jar
struts-*-el.tld

As explained in the contrib/struts-el/README.txt file, the struts.jar is still needed because the struts-el tag library classes are subclasses of the struts tag library classes.

There are a number of examples you can find for using these tags in the strutsel-exercise-taglib.war found in the current Struts distribution.
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5266
    
  13

Works fine.
Thanks!

Can you explain why it works with struts-el tags and not with the usual struts tags. And do you have to use struts or struts-el or doesn't it matter?
Junilu Lacar
Bartender

Joined: Feb 26, 2001
Posts: 4462
    
    6

The struts.jar is still required by the struts-el.jar because struts-el classes extend struts classes. The struts-el tag library classes have the added capability of knowing how to evaluate EL expressions, e.g. "${zoektype.waarde}". The regular struts tag library classes do not evaluate EL.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSTL: problem