File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Jsp and JScript!! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "Jsp and JScript!!" Watch "Jsp and JScript!!" New topic
Author

Jsp and JScript!!

vivek sivakumar
Ranch Hand

Joined: Aug 09, 2001
Posts: 187
Well is there a way to use Microsoft Java script(js) in a jsp page , i have a .js file which has a pop up functionality !! can i use this in jsp page !! this is very urgent kindly give in ur ideas.


SCJP, SCWD <br />A farmer learns more from a bad harvest than a good one.
June
Greenhorn

Joined: Aug 16, 2001
Posts: 24
Yes, You can use a .js file inside a jsp file since you can write html in a jsp file.
Just treat the jsp file like a normal html, and call the js file from html tags.
For example:
test.jsp
-------------------
<html>
<SCRIPT LANGUAGE="JavaScript" src="popup.js">\
</script>
.
.


JQ
vivek sivakumar
Ranch Hand

Joined: Aug 09, 2001
Posts: 187

// ------------------------------------------------------------------------
// This is my *.js file which gives the system
// values i want to call this from my jsp page then how can i do it!!!
var vbOKOnly = 0;
var vbOKCancel = 1;
var vbYesNo = 4;
var vbQuestion = 32;
var vbInformation = 64;
var vbCancel = 2;
var vbYes = 6;
var L_Welcome_MsgBox_Message_Text = "To be integrated into Web client";
var L_Welcome_MsgBox_Title_Text = "Windows Scripting Host Sample";
Welcome();
//////////////////////////////////////////////////////////////////////////////////
//
// WSH Network Object.
//
var WSHShell = WScript.CreateObject("WScript.Shell");
var WSHNetwork = WScript.CreateObject("WScript.Network")
var colDrives, SharePoint
function Ask(strAction){
// This function asks the user whether to perform a specific "Action"
// and sets a return code or quits script execution depending on the
// button that the user presses. This function is called at various
// points in the script below.
var intButton
intButton = WSHShell.Popup(strAction,
0,
L_Welcome_MsgBox_Title_Text,
vbQuestion + vbYesNo );
return intButton == vbYes;
}
//////////////////////////////////////////////////////////////////////////////////
//
// Show WSHNetwork object properties
//
//
WSHShell.Popup("UserDomain\t= " + WSHNetwork.UserDomain +
"\r\nUserName\t= " + WSHNetwork.UserName +
"\r\nComputerName\t= " + WSHNetwork.ComputerName,
0,
"WSHNetwork Properties",
vbInformation + vbOKOnly );
//////////////////////////////////////////////////////////////////////////////////
//
// WSHNetwork.EnumNetworkDrive
//
//
//Ask user whether to enumerate network drives
if (Ask("Do you want to enumerate connected network drives?")) {
//Enumerate network drives into a collection object of type WshCollection
var colDrives = WSHNetwork.EnumNetworkDrives();
//If no network drives were enumerated, then inform user, else display
//enumerated drives
if (colDrives.length == 0) {
WSHShell.Popup("There are no drives to enumerate.",
0,
L_Welcome_MsgBox_Title_Text,
vbInformation + vbOKOnly );
} else {
strMsg = "Current network drive connections: \r\n";
for (i = 0; i < colDrives.length; i += 2) {
strMsg = strMsg + "\r\n" + colDrives(i) + "\t" + colDrives(i + 1);
}

WSHShell.Popup(strMsg,
0,
L_Welcome_MsgBox_Title_Text,
vbInformation + vbOKOnly );
}
}
//////////////////////////////////////////////////////////////////////////////////
//
// Welcome
//
function Welcome() {
var WSHShell = WScript.CreateObject("WScript.Shell");
var intDoIt;
intDoIt = WSHShell.Popup(L_Welcome_MsgBox_Message_Text,
0,
L_Welcome_MsgBox_Title_Text,
vbOKCancel + vbInformation );
if (intDoIt == vbCancel) {
WScript.Quit();
}
}
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Jsp and JScript!!
 
Similar Threads
Javascript file loading
multiple js and jsp
validations using javascript
JS variable In JSP
Best practise to load javascript settings from server