Solved

Need a very simple .war file (java servlet)

Posted on 2006-07-18
13
1,082 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 25

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
Industry Leaders: 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!

 
LVL 30

Assisted Solution

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

RHCE - Red Hat OpenStack Prep Course

This course will provide in-depth training so that students who currently hold the EX200 & EX210 certifications can sit for the EX310 exam. Students will learn how to deploy & manage a full Red Hat environment with Ceph block storage, & integrate Ceph into other OpenStack service

Question has a verified solution.

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

In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
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:
Suggested Courses

617 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