File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSP and the fly likes jsp custom tag issues Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "jsp custom tag issues" Watch "jsp custom tag issues" New topic
Author

jsp custom tag issues

Mathew Lee
Ranch Hand

Joined: Jun 08, 2009
Posts: 238
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
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

...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

Joined: Jun 08, 2009
Posts: 238
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
Rancher

Joined: Sep 29, 2008
Posts: 12617

You need to incorporate com.examscan.servlet.tags.TimerTag, which the container cannot find.
Mathew Lee
Ranch Hand

Joined: Jun 08, 2009
Posts: 238
Where and how shall i incorporate. Please advise
Mathew Lee
Ranch Hand

Joined: Jun 08, 2009
Posts: 238
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

Joined: Jun 08, 2009
Posts: 238
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



[Thumbnail for TimerDemoJsp2.JPG]

Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61221
    
  66

What is it lately with people getting all freaked out about IDE warnings?

Ignore it, fix it, or turn it off.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Mathew Lee
Ranch Hand

Joined: Jun 08, 2009
Posts: 238
Hi Bear,

Thank you for your response.

Regards,
Praveen
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: jsp custom tag issues