This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Confuse about web architecture

 
anchit pancholi
Ranch Hand
Posts: 53
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,

i am confuse about architecture of my application. i am creating a application named "customtag" this is a root folder and inside webapp of tomact.
i am trying to create some directory inside this like :-

customtag/tag1 and inside this web.xml and WEB-INF/classes
customtag/tag2 and inside this web.xml and WEB-INF/classes
customtag/tag3 and inside this web.xml and WEB-INF/classes

is this possible to make this king of architecture. i tried to make this and when i try to run servlet inside customtag/tag1/WEB-INF/classes/firestservlet.class
i configure firestservlet.class in tag1/web.xml file.

but i am getting 404 error
please give me some solution.


Thanks
Anchit
 
Piyush Mangal
Ranch Hand
Posts: 196
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your WEB-INF should be under your root folder that is customtag. You can achieve the desire mapping via servlet mapping in web.xml.
 
anchit pancholi
Ranch Hand
Posts: 53
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Piyush Mangal wrote:Your WEB-INF should be under your root folder that is customtag. You can achieve the desire mapping via servlet mapping in web.xml.


Thanks piyush for reply.

as we can't use WEB-INF inside sub folder of ROOT. like in root i have WEB-INF(that is correct ) but can we use in WEB-INF inside subfolder as well?

Thanks
Anchit
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64182
83
IntelliJ IDE Java jQuery Mac Mac OS X
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First of all, folder structure is not "architecture".

Be sure that when you say "root" you don't mean ROOT. ROOT is its own web app and you shouldn't change it at all.

Place the folder for your web app, known as the context root in Tomcat's webapps folder. In this place the WEB-INF folder. Both the web.xml and the classes folder must be inside WEB-INF.
 
Swetha Bhagavathula
Ranch Hand
Posts: 112
Java Oracle
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
anchit pancholi wrote:hi all,

i am confuse about architecture of my application. i am creating a application named "customtag" this is a root folder and inside webapp of tomact.
i am trying to create some directory inside this like :-

customtag/tag1 and inside this web.xml and WEB-INF/classes
customtag/tag2 and inside this web.xml and WEB-INF/classes
customtag/tag3 and inside this web.xml and WEB-INF/classes

is this possible to make this king of architecture. i tried to make this and when i try to run servlet inside customtag/tag1/WEB-INF/classes/firestservlet.class
i configure firestservlet.class in tag1/web.xml file.

but i am getting 404 error
please give me some solution.


Here test1 is url pattern .. i assigned , you can please assign your own..url pattern..
compilation.till classes folder ..
................\classes>javac FirstServlet.java.

deployment: <tomcat_home>\web-apps\cutomertag\tag1\WEB-INF\classes\FirstServlet.java
here .class file generated in classes folder if no packge is used.. and url in browser window..
http://localhost:8080/web_application_name/url_pattern
since WEB-INF is private folder for end-users.


please try this.hhope it works.. do the same Deployment Descriptor structure for other two web applications that is for tag2 ,tag3..i think it should work.

Deployment Descriptor structure.png
[Thumbnail for Deployment Descriptor structure.png]
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic