Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Structure of a web application  RSS feed

 
Preeti Arora
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I have a webapplication whose directory structure is in conformance with j2ee standards.i.e



Now I want to add a security module in it.Do I have to make seperate web.xml for it?


Can you please explain what are the steps to add a new web module in it.What will be the directory structure now?
Thanks.

[BPSouther: Added code tags]
[ August 23, 2007: Message edited by: Ben Souther ]
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First, you'll have to tell us what you mean by 'module'.
I'm not familiar with that term in a servlet app.

Also, there is no such thing as 'web-inf' in a JEE app.
It's always 'WEB-INF'.
This might sound like nit-picking but I always point it out when I see it.
The misspelling of this directory name has caused a lot of headaches for beginners to Servlet programming.
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Preeti Arora:
I have a webapplication whose directory structure is in conformance with j2ee standards.i.e


You can use the same web.xml present in WEB-INF directory.You can put security related tags in the same web.xml.

Why do you want to put one web application within another ?
I am not sure but you can bundle more than 1 web application in an EAR.
 
Preeti Arora
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can there be seperate modules in a web application?
Like admin module,security module,report module bundled in a single web application.
Why I am calling them module because each has different functionality but they are part of a same application.They will share same layout,images,javascript of a main application.
So how will you make a directory structure of such web-application.
What is the correct approach?Shall I make different applications for each of them?
Thanks for reply.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser Redhat VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is nothing in the servlet spec about plugable modules within a web app.

As Rahul mentioned, you can package multiple web applications (war files) within an ear file (Enterprise Archive). but these web applications will not be integrated (separate sessions, context objects, etc...)

In any case a single web application can only have one WEB-INF directory and one web.xml file.

There is a link to the servlet spec in my signature.
If you haven't already, its' worth taking the time to download and read it.
It doesn't take long and isn't a tough read.
 
Preeti Arora
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for replies.

I got it.All I need to do is to make different folders for each module but they will be packaged in a same web-app.
I am going through the servlet specification now.
Thanks again.
 
amit punekar
Ranch Hand
Posts: 544
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
One way I can think of properly arranging all the modules in a webapp is using STRUTS. In struts you can have different modules as you mentioned configured as init parameter for Controller servlet.
regards
Amit
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!