File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Servlets and the fly likes request into servet thru browser Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "request into servet thru browser" Watch "request into servet thru browser" New topic

request into servet thru browser

sabu ekm

Joined: Jan 15, 2005
Posts: 19
i am working in jboss 3.2.3, srtuts.
im using an applet in my home page which requests into
a servlet, retrives some data and display it in the
requesting applet.

The problem is, while requesting iam getting
an error message "requested resource is not available".

i have witten entries in web.xml for my servlet.

the entry is given below


i tried all these URL s and got the same error.


there is no need to use the port number bcase im using port 80
- which is the default port.

and also pls tell me details abt <load-on-startup>.

thanks in advance.
plese help me because im just a beginner in servlet programming.
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

You will also need to map your servlet in web.xml

In this case, you would hit the servlet with: http://localhost:8080/simple-mvc

'load-on-startup' tells the server to load that servlet when it starts up.
It's often helpful, if the servlet has a lot of initialization to do when it's first loaded, to do all this when the app starts instead of waiting until the first time someone hits it with a browser. The number in the body
allows you to control the order in which your servlets are loaded.

Before context listeners, it was also used often for application initialization.

Originally posted by sabu:
there is no need to use the port number bcase im using port 80
- which is the default port.

Have you configured your server to use Port 80?

Tocmat, which I believe, it what JBoss is using as it's servlet container ships configured to use port 8080.

[ January 15, 2005: Message edited by: Ben Souther ]

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
David O'Meara

Joined: Mar 06, 2001
Posts: 13459

Welcome to the JavaRanch!

We're pretty light on rules, but one we take very seriously is one about display names. You can read about it here but basically we require your display name to be two words: your first name, a space, then your last name. Fictitious names are not allowed.

Please edit your profile and fix your display name, since accounts with invalid display names get deleted, often without warning

sabu ekm

Joined: Jan 15, 2005
Posts: 19
hellow Ben,
Thanks for your advise. i changed web.xml and got the result very well. but still iam having 1 problem. eventhough iam getting the correct result in browser, in the console of jboss iam getting an exception while iam starting my local jboss.


The content of
element type "web-app" must match "(icon?,display-name?,description?,distributab
org.xml.sax.SAXParseException: The content of element type "web-app" must match

but iam sure that there is no syntax error in web.xml.
but the only problem is iam getting this error while starting jboss.
if u know any solution pls help me to solve it

the program is running wonderfully and i would like to thank you once again
Ben Souther

Joined: Dec 11, 2004
Posts: 13410

The mesage either means that there is a syntax error in web.xml or if your depending on the version of your servlet container, the order of the elements in web.xml is wrong. The error message lists the order that the elements need to be listed.

Starting with Servlet Spec 2.4 you can use an arbitrary order for sub-elements of web-app.

If I had to guess....
You have:

Change to:
I agree. Here's the link:
subject: request into servet thru browser
It's not a secret anymore!