The moose likes JSP and the fly likes Can I get a VBScript generated value in my JSP code? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JSP
Reply Bookmark "Can I get a VBScript generated value in my JSP code?" Watch "Can I get a VBScript generated value in my JSP code?" New topic
Author

Can I get a VBScript generated value in my JSP code?

Mark Lau
Ranch Hand

Joined: Dec 15, 2001
Posts: 120
Say, I have a VBScript code like this in my JSP file:

<HTML>
<HEAD>
<TITLE>A VBScript Test</TITLE>
<SCRIPT language="VBScript">
<!--
' Declare a string.
Dim strN

' Build the strN.
strN = "A string of no meaning"
-->
</SCRIPT>
</HEAD>

Can I get the value of the string strN outside the VBScript code? Following the above code, I tried this:

<body>
<H3>See if we can get strN defined in the VBScript code</h3>
<h5>The string is: <%= strN %></h5>
</body>
</HTML>

It did not work. The compiler says that strN is not defined, and this is true in the JSP part of this file.

So, how can I get the value of strN outside the VBScript code please?

Thanks a lot!
Yuriy Fuksenko
Ranch Hand

Joined: Feb 02, 2001
Posts: 411
Only on a next turn
Your java running on a server, VBScript - in a browser.
The order is, dependless of their order in a text,
java first, vb second. So, if you generated value with VB, you need to submit it to a server - with a form, for example, and this is where it will be used.
So you could either reload a page, or You can use a frame (or iframe), wich will be invisible, to submit a request with your value to a certain servler or jsp. This servlet or jsp could produce vbscript (or javascript), that will change content of your page.
 
IntelliJ Java IDE
 
subject: Can I get a VBScript generated value in my JSP code?
 
Threads others viewed
servlet init parameters for jsp
edit and submit in servlets
JavaBean problem Tomcat 5.5
Setting dynamic parameter values?
Passing values to param value dynamically in jsp
developer file tools