• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

running a simple servlet (.war needed? )

 
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

do i need to create a .war file for a simple servlet which is to receive querries, handle them and then return xml data back to the client side application (flex/action script)?

i am not displaying anything, all i want is for the data to be received - serverside, processed, and sent back to the client....to the best of my understanding i wouldnt need a .jsp page for this, right ?

so what -for example- comes into my .war file if i want to implement my servlet ?

best regards

-W
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No, war files are just a format for packaging an entire application into a single file.

Most (as far as I am aware) containers allow you work with a file structure.
 
Wolfgang Obi
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Ben!

for the scenario i described, is a .jsp page of any use to me ?

-W.
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A servlet would be a better choice of tools.
JSPs are best used for formatting and marking up the response to a request.
 
Wolfgang Obi
Ranch Hand
Posts: 134
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
oh, okay...

and could you maybe explain (or point to a resource which describes -) how to create a .war file ?

cheers

-W
 
Ben Souther
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A war file is nothing more than a jar file (which is nothing more than a zip file) with a particular directory structure.

If you have a copy of Tomcat running on your machine the following exercise can be done in under 5 minutes.

With Tomcat running:
  • Download SimpleServlet.war from our CodeBarn to your tomcat/webapps directory.
  • Let Tomcat deploy this application (you will see a new directory named "SimplServlet" created in the webapps directory).
  • Test this app by pointing your browser to http://localhost:8080/SimpleServlet
  • Open a command window and CD to tomcat/webapps/SimpleServlet
  • At the command line type: jar cvf c:\temp\NewSimpleServlet.war *

  • This assumes that you already have a c:\temp directoryYou will now have a war file named NewSimpleServlet in your c:\temp directory
    [ June 23, 2008: Message edited by: Ben Souther ]
     
    reply
      Bookmark Topic Watch Topic
    • New Topic