Page 2 of 2 FirstFirst 12
Results 21 to 23 of 23
Like Tree1Likes

Thread: Struts2 blues

  1. #21
    willemjav is offline Senior Member
    Join Date
    Dec 2007
    Location
    Spain
    Posts
    1,075
    Rep Power
    8

    Default Re: Struts2 blues

    Here is what I did to make it work:
    1) I created a new project called dynamic webproject in eclipse luna;
    2) once created I activated Maven and got the POM right!
    3) I (only) configured two files in a very basic manner: web.xml (at web content/WEB-INF) and struts.xml (at src/);
    4) I dis-activated JPA under project facets (right click on the project, go to properties etc.);
    5) and I really need to forcer the driver into it by:

    Java Code:
    try {
             Class.forName("com.mysql.jdbc.Driver");
     } catch (ClassNotFoundException ex) {
              System.out.println("driver problems " );
     }


    What does Class.forname method do?
    Do you understand why?
    Last edited by willemjav; 07-17-2014 at 08:24 AM.

  2. #22
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    12,006
    Rep Power
    20

    Default Re: Struts2 blues

    You're still flailing.
    That call the Class.forName is utterly pointless as (unless you are using really old Java) the MySQL driver is a class 4 driver, so is self-registering.
    Please do not ask for code as refusal often offends.

    ** This space for rent **

  3. #23
    willemjav is offline Senior Member
    Join Date
    Dec 2007
    Location
    Spain
    Posts
    1,075
    Rep Power
    8

    Default Re: Struts2 blues

    Flailing (I had to look that one up) or not it was the only way for my to make it run after three days of "failing...."!!! (one for each day flailing)
    And yes it might be a "bad-practice" but why did it work for me?
    I know it is all happening because of my ignorance, but please help me to understand it.
    Last edited by willemjav; 07-17-2014 at 08:56 AM.

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Newbie connection blues
    By byterbit in forum JDBC
    Replies: 9
    Last Post: 12-09-2011, 10:07 PM
  2. Replies: 0
    Last Post: 10-30-2011, 03:38 PM
  3. struts2 tag
    By aaruviswa in forum Web Frameworks
    Replies: 1
    Last Post: 03-17-2011, 10:34 AM
  4. struts2
    By catchme33 in forum Web Frameworks
    Replies: 4
    Last Post: 03-25-2009, 10:35 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •