This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> | |
<html> | |
<head> | |
<title>Sample Jaggery web application</title> | |
</head> | |
<body> | |
<%@ taglib uri="http://wso2.org/jaggery/bsftags" prefix="js" %> | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Sample Jaggery web application</title> | |
</head> | |
<body> | |
<%@ taglib uri="http://wso2.org/jaggery/bsftags" prefix="js" %> | |
<js:script> | |
var s = ""; | |
for(var i=0;i<9;i++){ | |
for(var j=0;j<=i;j++){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Sample Jaggery web application</title> | |
</head> | |
<body> | |
<%@ taglib uri="http://wso2.org/jaggery/bsftags" prefix="js" %> | |
<js:script> | |
var s = ""; | |
for(var i=0;i<9;i++){ | |
for(var j=0;j<=i;j++){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function doGet(request, response, session) { | |
var name = request.getParameter("myName"); | |
response.write("Hello " + name); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
├── controllers | |
│ ├── atom.jss | |
│ ├── email.jss | |
│ ├── file.jss | |
│ ├── fileupload.jss | |
│ ├── json.jss | |
│ ├── rdb.jss | |
│ ├── registry.jss | |
│ ├── request.jss | |
│ ├── response.jss |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function doGet(request, response, session) { | |
return { | |
name : "Jhon", | |
age : "25", | |
address : { | |
number : "23", | |
address1 : "Flower Rd", | |
address2 : "Colombo 07", | |
city : "Colombo" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function doGet(request, response, session) { | |
response.write("<html><body>"); | |
response.write("Method : " + request.method + "<br/>"); | |
response.write("Protocol : " + request.protocol + "<br/>"); | |
response.write("User-Agent : " + request.getHeader("User-Agent")); | |
response.write("</body></html>"); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
XMLHttpRequest API is same as which can be found in browser environment. | |
**/ | |
function doGet(request, response, session) { | |
var xhr = new XMLHttpRequest(); | |
xhr.open("GET", "http://www.google.lk"); | |
xhr.send(); | |
response.write(xhr.responseText); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function doGet(request, response, session) { | |
//LOCAL_REPOSITORY, SYSTEM_GOVERNANCE, SYSTEM_CONFIGURATION, USER_GOVERNANCE, USER_CONFIGURATION | |
var registry = new Registry("SYSTEM_CONFIGURATION"); | |
var resource = registry.newResource(); | |
resource.content = '<products><product name="Mashup Server"/><product name="Gadget Server"/></products>'; | |
resource.addProperty("url", "http://wso2.com"); | |
resource.addProperty("company", "WSO2 Inc."); | |
registry.put("wso2products.xml", resource); | |
//now we read the resource again |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function doGet(request, response, session) { | |
var db = new RDB("mysql", "localhost", "3306", "myDB", "root", "root"); | |
db.query("SELECT * FROM myTable", function(results) { | |
var path = "/tmp/"; | |
var file = new File(path + "rdbTest.txt"); | |
if(!file.exists) file.createFile(); | |
file.openForAppending(); | |
for(var i=0;i<results.length;i++) { | |
file.writeLine(results[i].myColumn); | |
} |
OlderNewer