User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JSP section within the Web Development category of DaniWeb, a massive community of 391,935 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,740 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JSP advertiser: Lunarpages JSP Web Hosting
Views: 891 | Replies: 2
Reply
Join Date: Feb 2008
Posts: 2
Reputation: gheibia is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
gheibia gheibia is offline Offline
Newbie Poster

JSP and Servlet using Tomcat

  #1  
Feb 11th, 2008
Hi,

I'm quite new to Jsp.
The web server is Tomcat 6 and I have a Jsp page that uses a servlet as following code shows.

<form name='uploadSO' method='post' encType='multipart/form-data' action='UploadUnConfirmedSOServlet' >
<table width .....


The Jsp page is located under a folder called "Shipper" under my application's root directory:
So it's something like this:

c:\Tomcat 6.0\webapps\myapp\shipper\myfile.jsp

The servlet (UploadUnConfirmedSOServlet) is located somewhere under the WEB-INF folder as following shows:
c:\Tomcat 6.0\webapps\myapp\WEB-INF\classes\myco\myapp\shipper\servlet

when I submit the form in the Jsp page, I get the error "The requested resource (/myapp/shipper/UploadUnConfirmedSOServlet) is not available".

I have also configuered the web.xml which is located under the WEB-INF folder and added the following sections:

<servlet>
<servlet-name>UploadUnConfirmedSOServlet</servlet-name>
<servlet-class>myco.myapp.shipper.servlet.UploadUnConfirmedSOServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>UploadUnConfirmedSOServlet</servlet-name>
<url-pattern>UploadUnConfirmedSOServlet</url-pattern>
</servlet-mapping>


I appreciate any help on this.
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jun 2006
Location: India
Posts: 6,775
Reputation: ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold ~s.o.s~ is a splendid one to behold 
Rep Power: 23
Solved Threads: 330
Moderator
Featured Poster
~s.o.s~'s Avatar
~s.o.s~ ~s.o.s~ is offline Offline
Rebellion Revamped

Re: JSP and Servlet using Tomcat

  #2  
Feb 11th, 2008
This is because you have specified a relative URL and with you currently in the "shipper" context, it's trying to find "UploadUnconfirmedSOServlet" in that context. What you can do here is either make use of absolute URL's or adjust your relative URL to suit your needs. Something like:

<form name='uploadSO' method='post' action='../UploadUnConfirmedSOServlet'>
<!-- making use of relative URL -->
</form>

<form name='uploadSO' method='post' action='/myapp/UploadUnConfirmedSOServlet'>
<!-- making use of absolute URL -->
</form>
"I don't accept change. I don't deserve to live."

"Working a real job is a win if you're lazy, greedy, or unmotivated. If you're average, you fit right in. And if you're above average, the basic terms of employment and premise of the arrangement is against your interests."
Reply With Quote  
Join Date: Feb 2008
Posts: 2
Reputation: gheibia is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
gheibia gheibia is offline Offline
Newbie Poster

Re: JSP and Servlet using Tomcat

  #3  
Feb 11th, 2008
Thanks ~s.o.s~... I'll give it a try...
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

DaniWeb JSP Marketplace
Thread Tools Display Modes

Similar Threads
Other Threads in the JSP Forum

All times are GMT -4. The time now is 8:36 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC