i am new to java and jsp.. I have done a java code, i would like to add this java code into jsp Initially shown a web page to getting input from user once the user enter the information, it will call a java function
please let me know how to do this.. please..
public void createXmlTree(String name){
Writer output = null;
String addtext = "";
File file = new File("compare.txt");
output = new BufferedWriter(new FileWriter(file));
output.write(name);
output.close();
}
String name1;
name1 = request.getParameter("text1");
String name=name1;
try
{
if (!(name.equals(null))) {
createXmlTree(name);
out.println("Successfull");
}
}
catch(Exception e)
{
System.out.println(e);
}