aspose file tools*
The moose likes Servlets and the fly likes Confuse about web architecture Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Confuse about web architecture " Watch "Confuse about web architecture " New topic
Author

Confuse about web architecture

anchit pancholi
Ranch Hand

Joined: Oct 14, 2010
Posts: 53
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

Joined: Jan 22, 2007
Posts: 196
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

Joined: Oct 14, 2010
Posts: 53
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

Joined: Jan 10, 2002
Posts: 61766
    
  67

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.

[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
Swetha Bhagavathula
Ranch Hand

Joined: Jan 04, 2011
Posts: 112

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.



[Thumbnail for Deployment Descriptor structure.png]


SCJP5
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Confuse about web architecture