Solved

Need a very simple .war file (java servlet)

Posted on 2006-07-18
13
1,049 Views
Last Modified: 2013-11-24
Hi,

I need a very simple .war file (java servlet) that I will be able to upload to my server.
It's not important what it does, even printing "hello world" is good enough.
P.S.  I read some instructions on how to create one, but it didn't work... so all I need is a simple ready file. From that point I'll manage.

Thanks,
0
Comment
Question by:slavikn
13 Comments
 
LVL 35

Accepted Solution

by:
girionis earned 32 total points
ID: 17128948
Hi slavikn

the simplest you can find: http://access1.sun.com/techarticles/simple.WAR.html

Cheers
0
 
LVL 24

Assisted Solution

by:Tomas Helgi Johannsson
Tomas Helgi Johannsson earned 31 total points
ID: 17128974
  Hi!
What IDE environment do you use ?
I recommend NetBeans http://www.netbeans.org
This environment creates war file for you automatically.

Regards,
  Tomas Helgi
0
 
LVL 8

Assisted Solution

by:kaliyugkaarjun
kaliyugkaarjun earned 31 total points
ID: 17129118
0
 
LVL 30

Assisted Solution

by:mayankeagle
mayankeagle earned 31 total points
ID: 17129123
0
 
LVL 1

Author Comment

by:slavikn
ID: 17138580
I created a .war file, run it on the server, but it still doesn't seem to work:
http://www.organizermp3.com/servlet/hello
Any clues?
0
Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 
LVL 30

Expert Comment

by:mayankeagle
ID: 17138861
What does your web.xml look like? What is the URL pattern of the servlet? If its /hello and the context-root is /, then use http://url:port/hello

Which server/ version are you using? Tomcat used to support /servlet for directly loading servlets (it was mostly used in testing) but I guess Tomcat 5 has removed that feature so you need to use the correct URL pattern for the servlet.
0
 
LVL 1

Author Comment

by:slavikn
ID: 17139039
web.xml:

<web-app xmlns="http://java.sun.com/xml/ns/j2ee" version="2.4"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http:/java.sun.com/dtd/web-app_2_3.dtd">
  <servlet>
    <servlet-name>hello</servlet-name>
    <servlet-class>test.HelloServlet</servlet-class>
  </servlet>

  <servlet-mapping>
    <servlet-name>hello</servlet-name>
    <url-pattern>/hello</url-pattern>
  </servlet-mapping>
</web-app>

##########################################################

I don't know what tomcat version they run. What's the other alternative of running this servlet?
0
 
LVL 30

Expert Comment

by:mayankeagle
ID: 17143881
0
 
LVL 30

Expert Comment

by:mayankeagle
ID: 17143882
What is the web app's context root, hope it is /
0
 
LVL 1

Author Comment

by:slavikn
ID: 17144273
0
 
LVL 30

Expert Comment

by:mayankeagle
ID: 17144281
Then the context root should be something else. Basically it has to be:

http://server-address:port/web-app-context-root/servlet-url-pattern
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
countHi2 challenge 7 44
word0 challenge 4 53
HashMap Vs TreeMap 12 49
listing all functions in JavaScript 19 112
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now