Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
Mark Lau
Ranch Hand
Posts: 120
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 413
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!