jQuery in Action, 2nd edition*
The moose likes Servlets and the fly likes servlet not running from html file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "servlet not running from html file" Watch "servlet not running from html file" New topic
Author

servlet not running from html file

Vishwanath Krishnamurthi
Ranch Hand

Joined: Jun 04, 2007
Posts: 331
Hi,

I'm starting with servlets in java and tried deploying the servlet class file in its package com\examples\web
I have a under html file and an also xml file for address mapping. The html file is opening properly in the browser but when I submit it, it looks like no action is being taken... Can you please tell me what I should be looking at?

Thanks,
Vishwanath K


Blog
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42264
    
  64
What's the URL being shown in the browser when you open that HTML file? Does it start with "file:" or "http:"? If the former, then that's not going to work. You need to get the page from the server, not the file system. If the latter, can you see the request getting through to the server (by looking at the server logs)?


Ping & DNS - my free Android networking tools app
Vishwanath Krishnamurthi
Ranch Hand

Joined: Jun 04, 2007
Posts: 331
Hi,

It is http. It is http://localhost:8080/ApplicationOne/form.html

The problem is, clicking the submit button takes no action at all, as if it wasn't clicked at all. Not even an error msg!!

My servlet class is deployed here in
D:\tomcat\webapps\ApplicationOne\WEB-INF\classes\com\examples\web

My html code looks like


I tried opening the web.xml file using xml editor and it did not show any error. It looks like:
It is put under D:\tomcat\webapps\ApplicationOne\WEB-INF



Confused

Vishwa.
Vishwanath Krishnamurthi
Ranch Hand

Joined: Jun 04, 2007
Posts: 331
Oops.. I just found the typo in my html file.
I had typed "form" as "from"

Thanks,
Vishwa
Seetharaman Venkatasamy
Ranch Hand

Joined: Jan 28, 2008
Posts: 5575

Vishwanath Murthi wrote:Oops.. I just found the typo in my html file.
I had typed "form" as "from"


Good Catch
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: servlet not running from html file