• 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

request into servet thru browser

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hellow,
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

<servlet>
<servlet-name>checkEventServlet</servlet-name>
<servlet-class>com.mitoiis.servletextension.CheckEventServlet</servlet-class>
<load-on-startup>0</load-on-startup>
</servlet>


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

http://localhost/checkEventServlet
http://localhost/servletextension.checkEventServlet
http://localhost/servletextension.CheckEventServlet


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.
 
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
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.

Tomcat
[ January 15, 2005: Message edited by: Ben Souther ]
 
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"sabu",
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

thanks,
Dave
 
sabu ekm
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
le?,context-param*,filter*,filter-mapping*,listener*,servlet*,servlet-mapping*,s
ession-config?,mime-mapping*,welcome-file-list?,error-page*,taglib*,resource-env
-ref*,resource-ref*,security-constraint*,login-config?,security-role*,env-entry*
,ejb-ref*,ejb-local-ref*)".
org.xml.sax.SAXParseException: The content of element type "web-app" must match
"(icon?,display-name?,description?,distributable?,context-param*,filter*,filter-
mapping*,listener*,servlet*,servlet-mapping*,session-config?,mime-mapping*,welco
me-file-list?,error-page*,taglib*,resource-env-ref*,resource-ref*,security-const
raint*,login-config?,security-role*,env-entry*,ejb-ref*,ejb-local-ref*)".
************



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
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
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:
SERVLET
MAPPING
SERVLET
MAPPING

Change to:
SERVLET
SERVLET
MAPPING
MAPPING
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic