Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Unable to use El in custom tags

 
Mohit G Gupta
Ranch Hand
Posts: 634
Chrome Eclipse IDE Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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}
 
Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper
Pie
Posts: 2167
57
Android Chrome Eclipse IDE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
does you web.xml start like this?



Regards,
Frits
 
Mohit G Gupta
Ranch Hand
Posts: 634
Chrome Eclipse IDE Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have the following in Web.xml
 
Stoian Azarov
Ranch Hand
Posts: 113
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 634
Chrome Eclipse IDE Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using tomcat 5.5 and eclipse helios
 
Frits Walraven
Creator of Enthuware JWS+ V6
Saloon Keeper
Pie
Posts: 2167
57
Android Chrome Eclipse IDE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 634
Chrome Eclipse IDE Java
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Saloon Keeper
Pie
Posts: 2167
57
Android Chrome Eclipse IDE
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic