wood burning stoves 2.0*
The moose likes Web Component Certification (SCWCD/OCPJWCD) and the fly likes Unable to use El in custom tags Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Certification » Web Component Certification (SCWCD/OCPJWCD)
Bookmark "Unable to use El in custom tags" Watch "Unable to use El in custom tags" New topic
Author

Unable to use El in custom tags

Mohit G Gupta
Ranch Hand

Joined: May 18, 2010
Posts: 634

I am unable to see the evaluated El in the output even though the body-content in tld is declared as scriptless.

WHy is After body appears after the EL expressions in the browser output ?

After body is in doEndTag() and i suppose doEndtag must run after the tag body evaluation .


ClassicTagTest1


TLD


JSP



Browser OutPut:
MOvies NOW
dostarttag
After body
${movie}
${movie}
${movie}


OCPJP 6.0 93%
OCPJWCD 5.0 98%
Frits Walraven
Creator of Enthuware JWS+ V6
Bartender

Joined: Apr 07, 2010
Posts: 1696
    
  25

does you web.xml start like this?



Regards,
Frits
Mohit G Gupta
Ranch Hand

Joined: May 18, 2010
Posts: 634

i have the following in Web.xml
Stoian Azarov
Ranch Hand

Joined: Jun 01, 2011
Posts: 113
After tag appears before body evaluation because you are creating a table in HTML and After tag label is between <tr></tr> elements. Check the source code of your page:

You are supposed to put any text inside <td></td> elements, otherwise the text might appear in very strange place.
From the code of you example it is visible that doEndTag() runs after the body.

I tried your example and it works for me - the body is evaluated - of course I am using GlassFish 3.1.1

Mohit G Gupta
Ranch Hand

Joined: May 18, 2010
Posts: 634

I am using tomcat 5.5 and eclipse helios
Frits Walraven
Creator of Enthuware JWS+ V6
Bartender

Joined: Apr 07, 2010
Posts: 1696
    
  25

I am using tomcat 5.5 and eclipse helios

hmm, it was working on my tomcat server (v 5.5)

Try removing this line from your jsp:
Mohit G Gupta
Ranch Hand

Joined: May 18, 2010
Posts: 634

i tried removing the line from jsp and the code worked,but why was it affecting the output ?

please help
Frits Walraven
Creator of Enthuware JWS+ V6
Bartender

Joined: Apr 07, 2010
Posts: 1696
    
  25

I am not sure what caused it to work as those lines are perfectly ok.

I think that your output was being cached by your browser (and that output was cached when you still had a mistake in your code). Sometimes hitting CNTRL-F5 will do the trick to make sure that you are looking at right output. It seems that changing the first line of your jsp made your browser to resubmit instead of getting your page from the cache.

Regards,
Frits
 
jQuery in Action, 2nd edition
 
subject: Unable to use El in custom tags