Created
January 25, 2012 12:26
-
-
Save Madhuka/1676040 to your computer and use it in GitHub Desktop.
This is Hello World code in jaggery
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
<% | |
var name = request.getParameter('name'); | |
print('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
<html> | |
<body> | |
<% | |
print('Hello World'); | |
%> | |
</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
<% | |
print({"name":"jhon","address": {"number" : "231/5A", "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
<% | |
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); | |
} | |
file.close(); | |
}); | |
log("Database query executed.", "info"); | |
print("<html><body><h1>Done</h1></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
//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 | |
var res = registry.get("wso2products.xml"); | |
//html to show the result | |
var html ="<html><body> | |
<h2>Content</h2> | |
<h3 style='color : #800000'>{res.content.toXMLString()}</h3> | |
<h2>Properties</h2> | |
<h3 style='color : #800000'>{res.getProperty("url")}</h3> | |
<h3 style='color : #800000'>{res.getProperty("company")}</h3> | |
</body></html>" | |
print(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
<% | |
print("<html><body>"); | |
print("Method : " + request.method + "<br/>"); | |
print("Protocol : " + request.protocol + "<br/>"); | |
print("User-Agent : " + request.getHeader("User-Agent")); | |
print("</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
<% | |
var xhr = new XMLHttpRequest(); | |
xhr.open("GET", "http://www.google.lk"); | |
xhr.send(); | |
print(xhr.responseText); | |
%> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment