0

I am creating a project with Java, JavaScript, html, css and a MySQL database. I am not using any built tool like ant or maven. I am getting a lot of problems during interacting with my JavaScript and servlet, jdbc and other files. Can anybody please tell me what is the best way of organizing java web project? Please don't tell me to use Ant or Maven or any other built tool. I found a Answer for that, can anybody tell me that where to put my file structure in such organization.My current code is like that:

  - aarya(project name)   
        |
         - WEB-INF
                 |
        |         -web.xml
        -src
           |
          -pkg
           |
            -coreServlet.java
            -main.java
        |
        -html
            |
            - core.html
        |
        - css
             |
             -core.css

        |
        -javascript
                  |
                   -core.js
        |
        - lib
        |
        -index.html

I am facing a lot of problem in java and html and JavaScript interaction,please tell me best way of organizing.Please give any elaborative link or detail answer.

Community
  • 1
  • 1
Anshul
  • 9,312
  • 11
  • 57
  • 74
  • 5
    You say that you have a lot of problems, but you don't say what any of them are! – Lee Taylor Apr 10 '13 at 20:51
  • I am facing problem like if I want to some value from HTML file in my servlet than how can I make that ? – Anshul Apr 10 '13 at 20:53
  • 3
    how *are* you building it? The answer to your question is dependent on how it's built. – Rick Mangi Apr 10 '13 at 20:55
  • @SotiriosDelimanolis, can you please give full structure ? – Anshul Apr 10 '13 at 20:56
  • @RickMangi How it could be built dependent can you please tell me, I am sorry if it is a silly question, I am new in this . – Anshul Apr 10 '13 at 21:00
  • http://docs.oracle.com/cd/E14571_01/web.1111/e13712/configurewebapp.htm#i161609 – NullPointerException Apr 10 '13 at 21:00
  • @SotiriosDelimanolis: no, they shouldn't be under WEB-INF. Everything under WEB-INF is not available from the outside, so storing publicly available resources like html, css and js files there is not a good idea. – JB Nizet Apr 10 '13 at 21:02
  • @TechDon: your problem description is much too vague. Show us some code. Explain what you want this code to do. And explain what it actually does. "it doesn't work" or "I'm facing problems" aren't helpful problem descriptions. – JB Nizet Apr 10 '13 at 21:04
  • @SotiriosDelimanolis: to the browsers which must download these HTML, CSS and JS files to, well, display something. – JB Nizet Apr 10 '13 at 21:05
  • @JBNizet Sorry, you are absolutely correct. I was thinking WEB-INF as some web app super folder. – Sotirios Delimanolis Apr 10 '13 at 21:07

1 Answers1

2

The structure of project doesn't matter that much. It is the structute of web archive (war) that matter for a web-server.

You should build and archive you war file as per the standards

Here is the link that explains the structure of a web application

NullPointerException
  • 3,732
  • 5
  • 28
  • 62