kisokos 0 Newbie Poster

Sorry for my poor English. What is the problem whit this code?

The error is in the browser: "The method frissit() in the type Xml_file is not applicable for the arguments (String, String, String)"

in the JSP file:

<%

  String szerzo = request.getParameter("szerzo");
  String cim = request.getParameter("cim");
  String ev = request.getParameter("ev");

  Xml_file xml_file = new Xml_file(this);
  xml_file.frissit(szerzo, cim, ev);
%>

The class file

package extra;

import javax.servlet.http.HttpServlet;
import java.io.*;

public class Xml_file
{
  String filePath;
  String tartalom;

  public Xml_file(HttpServlet servlet)
  {
    filePath = servlet.getServletContext().getRealPath("") + File.separator + "uj_konyvek.xml";
    System.out.println(filePath);
  }

  public void frissit(String szerzo, String cim, String ev)
  {
    beolvas(szerzo, cim, ev);
    ment();
  }

  private void beolvas(String szerzo, String cim, String ev)
  {
    try
    {
      String re;
      BufferedReader reader = new BufferedReader(new FileReader(filePath));
      String sor = reader.readLine();
      reader.close();
      //re = /</data>/i;
      //sor = sor.replace(re, "");
      tartalom = sor + szerzo + cim + ev; // illetve egyebek, de azt most kihagyom
    }
    catch (Exception ex) {}
  }

  private void ment()
  {
    try
    {
      BufferedWriter writer = new BufferedWriter(new FileWriter(filePath));
      writer.write(tartalom + "</data>");
      writer.close();
    }
    catch (IOException ex) {}
  }
}

Many thanks

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.