0

I'm in an internship and i'm learning jsp, i still get lost sometimes, my boss asked me to create a simple log file that would register the information that pass by my form: I have a login form that redirect you to another form, nothing complex.

Basically, i need to, each time a user clicks on login (the button), the log file(txt) would add his nickname and password to the file with the time, my boss told it's not hard but i have no idea where to start.

P.S: The Login and other jsp files i have them and they are working fine i just need to add the code for the log file that i'm supposed to create. Please help guys.

Apostolos
  • 10,033
  • 5
  • 24
  • 39
DrayneZ
  • 41
  • 6
  • 1
    Use a logging framework, e.g. [Logback](http://logback.qos.ch/), [Log4J](http://logging.apache.org/log4j/2.x/), or the built-in Java logging. Also, don't write Java code in JSPs. Write Java code in Servlets, or in action handlers if you're using a framework. – Andreas Jul 29 '16 at 15:01
  • Hello, i"m sorry i didn't fully understand how i can achieve that ? i'm just taking my first steps in jee :/ this may sound stupid but should i just create a servlet then what ? i should not that i'm using tomcat as server – DrayneZ Jul 29 '16 at 15:07
  • See [How to avoid Java code in JSP files?](http://stackoverflow.com/q/3177733/5221149) – Andreas Jul 29 '16 at 15:12
  • i'll definitely read this once i'm home, thank you a lot dude ! Can i pm you later if i need more help ? – DrayneZ Jul 29 '16 at 16:51

0 Answers0