tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carlos Cajina" <cecaj...@hotmail.com>
Subject [BSF Taglib]
Date Fri, 11 Feb 2005 21:09:19 GMT
Hi. I've just started using BSF hoping that this taglib (and the technology under the hood)
could help me integrate portions of Java and JavaScript code within my JSP pages. My first
attempt was to be able to assign an HTML control value to a Java variable (i.e. something
like <%= String htmlCtrlValue = document.all.<someSelectControl>.value; %>), but
I haven't been successful at it...

Here's what I've done:

1. Declared the taglib in my web.xml file adding the necessary *.jar and *.tld to their proper
locations.
2. Include <%@ taglib uri="http://jakarta.apache.org/taglibs/bsf-1.0" prefix="bsf" %>
in my JSP
3. Added bsf.jar to my classpath.
4. Added rhino1_5R3 (js.jar) to the classpath

So far I keep getting this error:

2005-02-11 20:51:28,296 INFO  [STDOUT] org.apache.bsf.BSFException: JavaScript Error: Internal
Error: java.lang.ClassCastException
2005-02-11 20:51:28,296 ERROR [STDERR] JavaScript Error: Internal Error: java.lang.ClassCastException:

2005-02-11 20:51:28,296 ERROR [STDERR] java.lang.ClassCastException
2005-02-11 20:51:28,312 ERROR [STDERR]  at org.mozilla.javascript.optimizer.Codegen.compile(Unknown
Source)
2005-02-11 20:51:28,312 ERROR [STDERR]  at org.mozilla.javascript.Context.compile(Unknown
Source)
2005-02-11 20:51:28,312 ERROR [STDERR]  at org.mozilla.javascript.Context.compile(Unknown
Source)
2005-02-11 20:51:28,312 ERROR [STDERR]  at org.mozilla.javascript.Context.compileReader(Unknown
Source)
2005-02-11 20:51:28,312 ERROR [STDERR]  at org.mozilla.javascript.Context.evaluateReader(Unknown
Source)
2005-02-11 20:51:28,312 ERROR [STDERR]  at org.mozilla.javascript.Context.evaluateString(Unknown
Source)
2005-02-11 20:51:28,312 ERROR [STDERR]  at org.apache.bsf.engines.javascript.JavaScriptEngine.eval(Unknown
Source)
2005-02-11 20:51:28,312 ERROR [STDERR]  at org.apache.bsf.util.BSFEngineImpl.exec(Unknown
Source)
2005-02-11 20:51:28,312 ERROR [STDERR]  at org.apache.taglibs.bsf.scriptlet$1.run(scriptlet.java:99)
2005-02-11 20:51:28,312 ERROR [STDERR]  at java.security.AccessController.doPrivileged(Native
Method)
2005-02-11 20:51:28,312 ERROR [STDERR]  at org.apache.taglibs.bsf.scriptlet.doEndTag(scriptlet.java:92)
2005-02-11 20:51:28,312 ERROR [STDERR]  at org.apache.jsp.registro_content_jsp._jspx_meth_bsf_scriptlet_0(registro_content_jsp.java:1222)
2005-02-11 20:51:28,312 ERROR [STDERR]  at org.apache.jsp.registro_content_jsp._jspx_meth_html_form_0(registro_content_jsp.java:219)
2005-02-11 20:51:28,312 ERROR [STDERR]  at org.apache.jsp.registro_content_jsp._jspService(registro_content_jsp.java:103)
2005-02-11 20:51:28,312 ERROR [STDERR]  at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
2005-02-11 20:51:28,312 ERROR [STDERR]  at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
2005-02-11 20:51:28,312 ERROR [STDERR]  at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210)
2005-02-11 20:51:28,312 ERROR [STDERR]  at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
2005-02-11 20:51:28,312 ERROR [STDERR]  at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
2005-02-11 20:51:28,312 ERROR [STDERR]  at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
2005-02-11 20:51:28,312 ERROR [STDERR]  at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
2005-02-11 20:51:28,312 ERROR [STDERR]  at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:575)
2005-02-11 20:51:28,312 ERROR [STDERR]  at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:498)
2005-02-11 20:51:28,312 ERROR [STDERR]  at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:822)
2005-02-11 20:51:28,312 ERROR [STDERR]  at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:398)
2005-02-11 20:51:28,312 ERROR [STDERR]  at org.apache.struts.taglib.template.GetTag.doStartTag(GetTag.java:201)
2005-02-11 20:51:28,312 ERROR [STDERR]  at org.apache.jsp.template_jsp._jspx_meth_template_get_3(template_jsp.java:251)
2005-02-11 20:51:28,312 ERROR [STDERR]  at org.apache.jsp.template_jsp._jspService(template_jsp.java:135)
2005-02-11 20:51:28,312 ERROR [STDERR]  at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
2005-02-11 20:51:28,328 ERROR [STDERR]  at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
2005-02-11 20:51:28,328 ERROR [STDERR]  at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210)
2005-02-11 20:51:28,328 ERROR [STDERR]  at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
2005-02-11 20:51:28,328 ERROR [STDERR]  at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
2005-02-11 20:51:28,328 ERROR [STDERR]  at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
2005-02-11 20:51:28,328 ERROR [STDERR]  at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
2005-02-11 20:51:28,328 ERROR [STDERR]  at org.apache.catalina.core.ApplicationDispatcher.doInclude(ApplicationDispatcher.java:575)
2005-02-11 20:51:28,328 ERROR [STDERR]  at org.apache.catalina.core.ApplicationDispatcher.include(ApplicationDispatcher.java:498)
2005-02-11 20:51:28,328 ERROR [STDERR]  at org.apache.jasper.runtime.JspRuntimeLibrary.include(JspRuntimeLibrary.java:822)
2005-02-11 20:51:28,328 ERROR [STDERR]  at org.apache.jasper.runtime.PageContextImpl.include(PageContextImpl.java:398)
2005-02-11 20:51:28,328 ERROR [STDERR]  at org.apache.struts.taglib.template.InsertTag.doEndTag(InsertTag.java:158)
2005-02-11 20:51:28,328 ERROR [STDERR]  at org.apache.jsp.registro_jsp._jspx_meth_template_insert_0(registro_jsp.java:106)
2005-02-11 20:51:28,328 ERROR [STDERR]  at org.apache.jsp.registro_jsp._jspService(registro_jsp.java:59)
2005-02-11 20:51:28,328 ERROR [STDERR]  at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:137)
2005-02-11 20:51:28,328 ERROR [STDERR]  at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
2005-02-11 20:51:28,328 ERROR [STDERR]  at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:210)
2005-02-11 20:51:28,328 ERROR [STDERR]  at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:295)
2005-02-11 20:51:28,328 ERROR [STDERR]  at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:241)
2005-02-11 20:51:28,328 ERROR [STDERR]  at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
2005-02-11 20:51:28,328 ERROR [STDERR]  at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:684)
2005-02-11 20:51:28,328 ERROR [STDERR]  at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:432)
2005-02-11 20:51:28,328 ERROR [STDERR]  at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:356)
2005-02-11 20:51:28,328 ERROR [STDERR]  at org.apache.struts.action.RequestProcessor.doForward(RequestProcessor.java:1069)
2005-02-11 20:51:28,328 ERROR [STDERR]  at org.apache.struts.action.RequestProcessor.internalModuleRelativeForward(RequestProcessor.java:1012)
2005-02-11 20:51:28,328 ERROR [STDERR]  at org.apache.struts.action.RequestProcessor.processForward(RequestProcessorjava:582)
2005-02-11 20:51:28,328 ERROR [STDERR]  at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:260)
2005-02-11 20:51:28,328 ERROR [STDERR]  at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
2005-02-11 20:51:28,328 ERROR [STDERR]  at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:507)
2005-02-11 20:51:28,328 ERROR [STDERR]  at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
2005-02-11 20:51:28,328 ERROR [STDERR]  at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
2005-02-11 20:51:28,328 ERROR [STDERR]  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)
2005-02-11 20:51:28,328 ERROR [STDERR]  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
2005-02-11 20:51:28,328 ERROR [STDERR]  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValvejava:256)
2005-02-11 20:51:28,328 ERROR [STDERR]  at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
2005-02-11 20:51:28,328 ERROR [STDERR]  at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
2005-02-11 20:51:28,328 ERROR [STDERR]  at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
2005-02-11 20:51:28,328 ERROR [STDERR]  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValvejava:191)
2005-02-11 20:51:28,328 ERROR [STDERR]  at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
2005-02-11 20:51:28,328 ERROR [STDERR]  at org.jboss.web.tomcat.security.JBossSecurityMgrRealm.invoke(JBossSecurityMgrRealm.java:220)
2005-02-11 20:51:28,328 ERROR [STDERR]  at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
2005-02-11 20:51:28,328 ERROR [STDERR]  at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:494)
2005-02-11 20:51:28,328 ERROR [STDERR]  at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
2005-02-11 20:51:28,328 ERROR [STDERR]  at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)
2005-02-11 20:51:28,328 ERROR [STDERR]  at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
2005-02-11 20:51:28,328 ERROR [STDERR]  at org.jboss.web.tomcat.tc4.statistics.ContainerStatsValve.invoke(ContainerStatsValve.java:76)
2005-02-11 20:51:28,328 ERROR [STDERR]  at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
2005-02-11 20:51:28,328 ERROR [STDERR]  at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
2005-02-11 20:51:28,328 ERROR [STDERR]  at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
2005-02-11 20:51:28,328 ERROR [STDERR]  at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2417)
2005-02-11 20:51:28,328 ERROR [STDERR]  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)
2005-02-11 20:51:28,328 ERROR [STDERR]  at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
2005-02-11 20:51:28,328 ERROR [STDERR]  at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:171)
2005-02-11 20:51:28,328 ERROR [STDERR]  at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
2005-02-11 20:51:28,328 ERROR [STDERR]  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:172)
2005-02-11 20:51:28,328 ERROR [STDERR]  at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
2005-02-11 20:51:28,328 ERROR [STDERR]  at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:65)
2005-02-11 20:51:28,328 ERROR [STDERR]  at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
2005-02-11 20:51:28,328 ERROR [STDERR]  at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:577)
2005-02-11 20:51:28,328 ERROR [STDERR]  at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:641)
2005-02-11 20:51:28,328 ERROR [STDERR]  at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
2005-02-11 20:51:28,328 ERROR [STDERR]  at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
2005-02-11 20:51:28,328 ERROR [STDERR]  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)
2005-02-11 20:51:28,328 ERROR [STDERR]  at org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.invokeNext(StandardPipeline.java:643)
2005-02-11 20:51:28,328 ERROR [STDERR]  at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:480)
2005-02-11 20:51:28,328 ERROR [STDERR]  at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:995)
2005-02-11 20:51:28,328 ERROR [STDERR]  at org.apache.coyote.tomcat4.CoyoteAdapter.service(CoyoteAdapter.java:197)
2005-02-11 20:51:28,328 ERROR [STDERR]  at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:781)
2005-02-11 20:51:28,328 ERROR [STDERR]  at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:549)
2005-02-11 20:51:28,328 ERROR [STDERR]  at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:605)
2005-02-11 20:51:28,328 ERROR [STDERR]  at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:677)
2005-02-11 20:51:28,328 ERROR [STDERR]  at java.lang.Thread.run(Thread.java:534)

when my JSP reaches the following test code:

<bsf:scriptlet language="javascript">
    out.println ("Test successfull...")
</bsf:scriptlet>

I really don't have a clue what to try next or whether I'm missing something, and that's why
I'll appreciate ANY suggestion ;^)

Best regards,

Carlos
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message