Re: [BSF Taglib]

2005-02-17 Thread Kris Schneider
In your first example:

%= String htmlCtrlValue = document.all.someSelectControl.value; %

You seem to be confusing server-side and client-side processing. The JSP
scripting expression (%= %) will execute on the server, so it doesn't have
any connection to the browser's DOM. As for the second example:

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

Make sure the JAR files for BSF and Rhino are in WEB-INF/lib and not added
explicitly to the server's classpath. 

Quoting Carlos Cajina [EMAIL PROTECTED]:

 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

8 snip 8

 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

-- 
Kris Schneider mailto:[EMAIL PROTECTED]
D.O.Tech   http://www.dotech.com/

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



[BSF Taglib]

2005-02-11 Thread Carlos Cajina
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