PDA

View Full Version : folder structure to be used for an application with extjs and java?



shruthi123
7 Aug 2014, 4:39 AM
Hi all

I have created a Java Project wherein I am using ExtJS4 for the web pages and I should be using Java for the programming logic. Right now,I am able to display the web pages. However, I do not have any java files and my current folder structure is:

ext_java_proj

src
jre system library
apache tomcat v7.0
build
WebContent

com

controller
model
store
view

BorderLayout.js


ext_js

resources
src
ext_all.js

index.html


49872

Can someone tell me if I should place my java files in src folder or I should place it within the WebContent>com folder. And which is the best practice if it is a relatively big project with lot of java files and js files.

Thanks in advance.

Gary Schlosberg
7 Aug 2014, 11:06 AM
I've never used the two together, but hoping someone from the community will be able to offer more. Have you considered Sencha GXT?
http://www.sencha.com/products/gxt/

shruthi123
7 Aug 2014, 11:59 PM
Thanks I will consider using it next time.. However, I need to use ExtJS4 only for this project.

basav
15 Sep 2014, 11:39 PM
How does your client code interacts with the server code(Java) ?

shruthi123
16 Sep 2014, 10:50 PM
i am passing the data through a servlet

basav
17 Sep 2014, 12:58 AM
Ok. Better to place all java files under src folder. Generally all client related files are placed under WebContent folder. One more thing, I don't see app.js & app folder in your directory structure. Better to add them, so that it will be easily for others to understand your project structure.

shruthi123
17 Sep 2014, 1:24 AM
Thanks.. :) I have modified the structure already. I have app.js in the WebContent folder. Also,the 'com' folder in the WebContent should actually be 'app' right? And yeah java classes and servlets I have placed in 'src' folder.

Well, I would like to know if you are aware of any better approach to communicate to server side code other than servlets..?

basav
17 Sep 2014, 2:05 AM
1. Yes, com should be 'app'.
2. I prefer Spring MVC REST over servlets.

Take a look at this for more options - http://www.sencha.com/forum/showthread.php?43322-Most-Popular-Server-Side-Languages-(Please-Vote)