Skip to content

Instantly share code, notes, and snippets.

@raunakhajela
Created January 11, 2018 07:09
Show Gist options
  • Save raunakhajela/3148865a34dec80c3e4be18843a0b228 to your computer and use it in GitHub Desktop.
Save raunakhajela/3148865a34dec80c3e4be18843a0b228 to your computer and use it in GitHub Desktop.
JSP: Call Java Class from JSP
<%@ page import="com.jspDemo.jsp.*, java.util.ArrayList" %>
<html>
<body>
Let's have some fun": <%= FunUtils.makeItLower("Hello JSP Classes") %>
</body>
</html>
/*To create a package go to Java Resources/src right click and click new and choose "Package" and provide your package name*/
/*To create your class right click on your created package, click New and choose "Class"*/
package com.jspDemo.jsp;
public class FunUtils {
public static String makeItLower(String data){
return data.toLowerCase();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment