Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Servlets
Search Coderanch
Advance search
Google search
Register / Login
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
Tim Cooke
Liutauras Vilda
Jeanne Boyarsky
paul wheaton
Sheriffs:
Ron McLeod
Devaka Cooray
Henry Wong
Saloon Keepers:
Tim Holloway
Stephan van Hulst
Carey Brown
Tim Moores
Mikalai Zaikin
Bartenders:
Frits Walraven
Forum:
Servlets
Are multiple http servlets possible ?
Alex Parvan
Ranch Hand
Posts: 115
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I tried having multiple http
servlets
but only the first one is loaded. When i try to use the second one, http.getResponseMessage() returns "Not Found". Is it possible to have multiple http servlets ?
"Quoting yourself is stupid" - Me
Sebastian Janisch
Ranch Hand
Posts: 1183
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
What do you mean by 'multiple servlets' ??
A web app consists of x-amount of servlets.
JDBCSupport
-
An easy to use, light-weight JDBC framework
-
Alex Parvan
Ranch Hand
Posts: 115
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
First servlet:
http://localhost:8080/SomePath/Servlet1
Second servlet:
http://localhost:8080/SomePath/Servlet2
SomePath are the same. Servlet 1 works, but Servlet 2 doesn't.
"Quoting yourself is stupid" - Me
Sebastian Janisch
Ranch Hand
Posts: 1183
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
What does your mapping in the web.xml look like ?
JDBCSupport
-
An easy to use, light-weight JDBC framework
-
Alex Parvan
Ranch Hand
Posts: 115
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
<?xml version="1.0" encoding="UTF-8"?> <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"> <listener> <listener-class>com.sun.xml.ws.transport.http.servlet.WSServletContextListener</listener-class> </listener> <servlet> <servlet-name>WebService</servlet-name> <servlet-class>com.sun.xml.ws.transport.http.servlet.WSServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet> <servlet-name>GetChartServlet</servlet-name> <servlet-class>webservicepack.GetChartServlet</servlet-class> </servlet> <servlet> <servlet-name>SetImageServlet</servlet-name> <servlet-class>webservicepack.SetImageServlet</servlet-class> </servlet> <servlet-mapping> <servlet-name>WebService</servlet-name> <url-pattern>/WebService</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>GetChartServlet</servlet-name> <url-pattern>/GetChartServlet</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>SetImageServlet</servlet-name> <url-pattern>/SetImageServlet</url-pattern> </servlet-mapping> <session-config> <session-timeout> 30 </session-timeout> </session-config> </web-app>
GetChartServlet works, SetImageServlet doesn't. WebService is a WS, that also works.
Thanks,
Alex
"Quoting yourself is stupid" - Me
Sebastian Janisch
Ranch Hand
Posts: 1183
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Are you sure the class exists ??
Did you debug and check if the doGet method gets invoked ?
JDBCSupport
-
An easy to use, light-weight JDBC framework
-
David Newton
Author
Posts: 12617
I like...
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
ItDoesntWorkIsUseless
. A webapp can have an arbitrary number of servlets. If it's not working, we'll need more details in order to be able to help.
Alex Parvan
Ranch Hand
Posts: 115
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Actually the servlet is working, i had errors in my client.
Sorry, i didn't meant to waste your time
"Quoting yourself is stupid" - Me
David Newton
Author
Posts: 12617
I like...
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Glad to hear you figured it out :)
Alex Parvan
Ranch Hand
Posts: 115
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I wonder what you said before you edited
"Quoting yourself is stupid" - Me
Sebastian Janisch
Ranch Hand
Posts: 1183
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
things that would be beeped out on tv :-)
JDBCSupport
-
An easy to use, light-weight JDBC framework
-
David Newton
Author
Posts: 12617
I like...
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
I had a misspelling ;)
Alex Parvan
Ranch Hand
Posts: 115
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
http = (HttpConnection) Connector.open("http://localhost:8080/SomePath/Servlet2"); os = http.openOutputStream(); http.setRequestMethod(HttpConnection.POST);
should've been
http = (HttpConnection) Connector.open("http://localhost:8080/SomePath/Servlet2"); http.setRequestMethod(HttpConnection.POST); os = http.openOutputStream();
Funny, such a mistake creates so much trouble. That's why i love programming.
Thanks again for your help.
"Quoting yourself is stupid" - Me
David Newton
Author
Posts: 12617
I like...
posted 14 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Glad you figured it out :)
We cannot change unless we survive, but we will not survive unless we change. Evolving tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Single mapping for multiple Servlets
Can we deploy multiple application on JBoss at the same time?
Uploading multiple image files
"Servlet2Applet Communication"
Fetching one table cell click and passing it to servlet
More...