Avatar billede fredand Forsker
07. januar 2006 - 22:43 Der er 7 kommentarer og
1 løsning

What do I need to be able to use JSP 2

Hello!

i found some interesting things about "Expression Language" with JSP 2.

If I am coorrect this 3 code snippets should be equal:
1)
<jsp:useBean  id="customer"  scope="session"  class="attentionizer.model.hibernate.Customer"  />
<jsp:getProperty  name="customer"  property="sFName"  />

2)
${sessionScope.customer.sFName}

3)
<%@ taglib uri="jstl/c" prefix="c" %>
<c:out value="${sessionScope.customer.sFName}"/>

But I do not get the JSP-page to evaluate the code:
${sessionScope.customer.sFName}

At first I just tried 1 and 2 but after some googling it looks like I need jstl-tag-libs, perhaps that one is needed to use expression language?

I found a very small jstl.jar and a c.tld at the download page at a struts turtorial:
http://www.reumann.net/struts/lesson1.do

But when I tried that one I get:
500 Internal Server Error
Error parsing JSP page /website/tiles/template.jsp

Class org.apache.taglibs.standard.tlv.JstlCoreTLV not found

Perhaps that jstl.jar is not the right one to use or do I need some more packages? How ever it does not contain org.apache.taglibs.standard.tlv.JstlCoreTLV

I use (as you perhaps know by now) orion 2.0.5. I have tried to see if this is server related, perhaps Orion does not support this. But I have not found anything.

Perhaps this is 2 question if I get it wrong when i say that I need jstl.jar to use expression language.

Then I should ask if you could help me to find out what I need to be able to use expression language. And the second question should be where may I download jstl-lib to be able to use for eg:
<%@ taglib uri="jstl/c" prefix="c" %>
<c:out value="Hello"/>

Best regards
Fredrik
Avatar billede arne_v Ekspert
08. januar 2006 - 10:04 #1
you can get an JSTL taglib here http://jakarta.apache.org/taglibs/index.html

you need both jstl.jar and standard.jar in WEB-INF/lib
Avatar billede arne_v Ekspert
08. januar 2006 - 10:06 #2
I believe that your number 2 code requires latest and greatest version of EL
(JSP 2.0 and not the older version coming with JSTL being used on JSP 1.2)
Avatar billede arne_v Ekspert
08. januar 2006 - 10:13 #3
And JSP 2.0 support should be provided by the app server.

What version of Orion are you using ?
Avatar billede fredand Forsker
09. januar 2006 - 09:06 #4
Hello!

Thanks for your reply.

I have now tried to download and add jstl.jar and standard.jar to my apps WEB-INF/lib. I also updated the c.tld file in my app.

I refer to the c.tld like
<taglib>
<taglib-uri>jstl/c</taglib-uri>
<taglib-location>/WEB-INF/c.tld</taglib-location>
</taglib>

But the JSP does not evaluate the expresession language-code, but I do not get any errors like before when I did not have standrad.jar in my lib-dir. So I guess I'm on the right way.

This JSP is referd to from a tiles do you think that matters?

Perhaps I need to set any flag some where to indicate that my JSP-pages uses "expression language"?

Best regards
Fredrik
Avatar billede fredand Forsker
09. januar 2006 - 09:13 #5
Opps, forgot to say that my orion is version 2.0.5
/Fredrik
Avatar billede fredand Forsker
30. december 2006 - 13:28 #6
Lets close this old one!
Please give svar so I can reward you!
Avatar billede arne_v Ekspert
31. december 2006 - 04:29 #7
no thanks - just reclaim the points yourself
Avatar billede fredand Forsker
31. december 2006 - 14:25 #8
Ok!

Happy new year!
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Kurser inden for grundlæggende programmering

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester