tomcat-taglibs-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kris Schneider <k...@dotech.com>
Subject Re: [BSF Taglib]
Date Thu, 17 Feb 2005 15:59:14 GMT
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 <cecajina@hotmail.com>:

> 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:kris@dotech.com>
D.O.Tech       <http://www.dotech.com/>

---------------------------------------------------------------------
To unsubscribe, e-mail: taglibs-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: taglibs-user-help@jakarta.apache.org


Mime
View raw message