Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Need a very simple .war file (java servlet)

Posted on 2006-07-18
13
Medium Priority
?
1,089 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 128 total points
ID: 17128948
Hi slavikn

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

Cheers
0
 
LVL 26

Assisted Solution

by:Tomas Helgi Johannsson
Tomas Helgi Johannsson earned 124 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 124 total points
ID: 17129118
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 30

Assisted Solution

by:Mayank S
Mayank S earned 124 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
 
LVL 30

Expert Comment

by:Mayank S
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:Mayank S
ID: 17143881
0
 
LVL 30

Expert Comment

by:Mayank S
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:Mayank S
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Lease-to-own eliminates the expenditure of hardware replacement and allows you to pay off the server over time. Usually, this is much cheaper than leasing servers. Think of lease-to-own as credit without interest.
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses

963 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