Win a copy of Spring Boot in Practice this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

Custom tag not being recognized

 
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have the following JSP with two custom tags, one of which is being recognized, the other of which is not. Here is the JSP, followed by the TLD. In the JSP, the tag in line 21 is the one that's working, and the tag in line 24 is the one with the problem. Any ideas?



 
Sheriff
Posts: 67651
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Any errors in the logs?

What's being rendered into the HTML being sent to the browser?
 
Frank Serkland
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bear Bibeault wrote:Any errors in the logs?



No errors in the logs, but Eclipse is highlighting it and saying, "Unknown tag(mytag: myPollResults)".

Bear Bibeault wrote:What's being rendered into the HTML being sent to the browser?



The HTML being rendered for that line is simply this:



For what it's worth, here is the code for my tag. It is supposed to print out some HTML.
 
Bear Bibeault
Sheriff
Posts: 67651
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And you are sure that the other tag is rendering properly?
 
Frank Serkland
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Bear Bibeault wrote:And you are sure that the other tag is rendering properly?



Well, there's no HTML statements being output, but I'm no longer sure if the other tag is working. Here is what I have for it. It's supposed to return a cookie to the JSP.

 
Frank Serkland
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Frank Serkland wrote:Well, there's no HTML statements being output, but I'm no longer sure if the other tag is working.



I have now verified using different browsers that the first tag is not being called when a cookie is present, but it is called when there is no cookie. I put a System.out.println() statement in it, and when I ran the JSP, that statement did not print out. The tag is in a place where it is supposed to be called regardless of whether the cookie it's supposed to find is present or not. This is all in spite of the fact that I wrote this tag to detect the presence of the cookies. Any ideas out there about why the tag isn't working?
 
Bartender
Posts: 4109
72
Hibernate Fedora Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Frank Serkland wrote:I put a System.out.println() statement in it, and when I ran the JSP, that statement did not print out...


Is it not printed in your server logs or the page being rendered?
 
Frank Serkland
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Vijitha Kumara wrote:

Frank Serkland wrote:I put a System.out.println() statement in it, and when I ran the JSP, that statement did not print out...


Is it not printed in your server logs or the page being rendered?



It's not printed in the server logs.
 
Frank Serkland
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Frank Serkland wrote:

Vijitha Kumara wrote:

Frank Serkland wrote:I put a System.out.println() statement in it, and when I ran the JSP, that statement did not print out...


Is it not printed in your server logs or the page being rendered?



It's not printed in the server logs.



Okay, the System.out.println() statement is always being printed now, for whatever reason. I didn't do anything to the code, but I won't complain.

Back to the original question. I will re-paste the code here for everyone's convenience. Below is my JSP. When the cookie is not present, I get the poll question, which is correct. When the cookie is present, the JSP is not calling the tag in line 24 because it doesn't recognize it, and that's not correct. Instead, nothing is rendered in the browser. The HTML code for what's rendered in the browser is exactly what appears below in line 24. Any ideas?



This is my TLD.
 
Frank Serkland
Ranch Hand
Posts: 113
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Frank Serkland wrote:Back to the original question.



I have solved this issue by giving up on a second tag and simply doing a database call in the first tag and returning them from there.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic