• 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
  • paul wheaton
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
  • Paul Clapham
  • Liutauras Vilda
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

jsp custom tag issues

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

I am writing a simple jsp custom tag which prints elapsed time, start time. My code looks like

TimerDemo.jsp code






web.xml code








examscam-taglib.tld code






In the jsp getting error like duplicate prefix exam scam. I am not able to run and see the output. Any ideas, suggestion, links, resources highly appreciated. Thanks in advance
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
...Look carefully and take the error message into account.

Better organization would probably have made this error very obvious, very quickly. Compare with the following.Easier to spot?
 
Mathew Lee
Ranch Hand
Posts: 238
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

I modified the jsp as below




when i run jsp now getting error like

JSP Processing Error
HTTP Error Code: 500


Error Message:JSPG0227E: Exception caught while translating /TimerDemo.jsp: /TimerDemo.jsp(21,4) --> JSPG0009E: Unable to load tag handler class com.examscan.servlet.tags.TimerTag

Root Cause:com.ibm.ws.jsp.translator.JspTranslationException: JSPG0227E: Exception caught while translating /TimerDemo.jsp: /TimerDemo.jsp(21,4) --> JSPG0009E: Unable to load tag handler class com.examscan.servlet.tags.TimerTag at com.ibm.ws.jsp.translator.visitor.validator.ValidateVisitor.visitCustomTagStart(ValidateVisitor.java:394) at com.ibm.ws.jsp.translator.visitor.JspVisitor.processJspElement(JspVisitor.java:267) at com.ibm.ws.jsp.translator.visitor.JspVisitor.processChildren(JspVisitor.java:309) at com.ibm.ws.jsp.translator.visitor.JspVisitor.processJspElement(JspVisitor.java:139) at com.ibm.ws.jsp.translator.visitor.JspVisitor.visit(JspVisitor.java:121) at com.ibm.ws.jsp.translator.JspTranslator.processVisitors(JspTranslator.java:121) at com.ibm.ws.jsp.translator.utils.JspTranslatorUtil.translateJsp(JspTranslatorUtil.java:181) at com.ibm.ws.jsp.translator.utils.JspTranslatorUtil.translateJspAndCompile(JspTranslatorUtil.java:83) at com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionServletWrapper.translateJsp(AbstractJSPExtensionServletWrapper.java:349) at com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionServletWrapper._checkForTranslation(AbstractJSPExtensionServletWrapper.java:317) at com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionServletWrapper.checkForTranslation(AbstractJSPExtensionServletWrapper.java:226) at com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionServletWrapper.handleRequest(AbstractJSPExtensionServletWrapper.java:131) at com.ibm.ws.jsp.webcontainerext.AbstractJSPExtensionProcessor.handleRequest(AbstractJSPExtensionProcessor.java:270) at com.ibm.ws.webcontainer.webapp.WebApp.handleRequest(WebApp.java:3129) at com.ibm.ws.webcontainer.webapp.WebGroup.handleRequest(WebGroup.java:238) at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:811) at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1433) at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:93) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:465) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:394) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.ready(HttpInboundLink.java:274) at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.sendToDiscriminators(NewConnectionInitialReadCallback.java:214) at com.ibm.ws.tcp.channel.impl.NewConnectionInitialReadCallback.complete(NewConnectionInitialReadCallback.java:113) at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:152) at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:213) at com.ibm.io.async.AbstractAsyncFuture.fireCompletionActions(AbstractAsyncFuture.java:195) at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136) at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:194) at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:741) at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:863) at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1510)

as in attachment.




I modified my tld file also as shown below






In the jsp other error coming for id like defined locally never used .
My TimerServlet is empty. Not sure if i need to incorporate anything in there.
Please advise.

Please advise
 
David Newton
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You need to incorporate com.examscan.servlet.tags.TimerTag, which the container cannot find.
 
Mathew Lee
Ranch Hand
Posts: 238
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Where and how shall i incorporate. Please advise
 
Mathew Lee
Ranch Hand
Posts: 238
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
wonderful it worked fine now.

There was a typo in tagclass tag instead of 'examscam' i typed as 'examscan'.

When i modified the tld file like



it resolved the issue. Thank you very much.
 
Mathew Lee
Ranch Hand
Posts: 238
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Now everything works fine. I have to change within tld file tagclass name as 'examscam' instead of 'examscan'.


But i still see
warning in jsp page like local variable timer never used like that as in attachment. Not sure whether i really care about it. Please advise
TimerDemoJsp2.JPG
[Thumbnail for TimerDemoJsp2.JPG]
warning message
 
Sheriff
Posts: 67753
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
What is it lately with people getting all freaked out about IDE warnings?

Ignore it, fix it, or turn it off.
 
Mathew Lee
Ranch Hand
Posts: 238
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Bear,

Thank you for your response.

Regards,
Praveen
 
Shiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic