• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Is it useful to deploy by a .war file?

 
Ranch Hand
Posts: 50
Eclipse IDE PHP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello guys,
I'm a novice and I don't have big experience about the .war deploy, and I would like to know whether to deploy a web project by .war file is the better solution or no.

If my project is small, I'll not have problems to deploy everything again, but if my project has a medium size, I'll need to re-deploy everything (e.g. a lot of pictures) only why I need to fix a line of code.
Maybe I can re-deploy only the single file, but in this case the .war is useful only the first time I deploy my web application.

And if I have some text files created from my application, when I deploy the .war file are they deleted?

Where do I wrong in my reasoning?

Thanks
KK
 
MyExamCloud Support
Posts: 264
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Karim Kiswarday,

Since JSP, Servlet and JSF components are used to concentrate solely on presentation logic, it makes sense to put them into a separate module (as WAR file). The web related artifacts (Facelets, backing beans, servlet class files, JSP files, supporting class files, GIF and HTML files, and a web application deployment descriptor) go into a Web Archive (WAR) file which represents the Web module.

By automated build task like ANT, we can easily deploy the application by single command. Java EE 6 improved lot to simplify EJB deployment as well. You no need to create seperate JAR file for EJBs, just copy .class into WAR file.

[WAR] The deployment process expands the EAR/WAR file into a temporary directory and (conceptually), the compressed EAR/WAR file is considered to be the application.
[Expanded directory] You can expand the EAR/WAR file manually, and then deploy the expanded directory structure, which becomes your working directory.

Why WAR/EAR deployment?

Application isolation
Separate class loaders
Problems encountered by one application have no effect on other applications

Choosing the option (WAR or Expanded directory) is depends on your project complexity. But it is always better to use WAR deployment to to test your production issues.

Thanks

 
I will open the floodgates of his own worst nightmare! All in a tiny ad:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic