Search code examples
javajspnetbeans

invoke a java project from jsp button click event


I have created a simple java project to draw the bar chart taking certain values from text file and named it as ChartAdvancedBar.java, now i need to invoke it when I press a button in JSP file.

I have added this java project within the libraries of my web project. How can I import this java project to one of my JSP files?

I have added a line:

<%@page import="ChartAdvancedBar.*"%>

But it is giving an error that ChartAdvancedBar doesn't found.


Solution

  • Try

    <jsp:useBean id="give id here like an object" class="Fully qualified name of class file">
    

    tag then access method

    Make sure it should be compiled before using this.