Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

servlet not running from html file

 
Vishwanath Krishnamurthi
Ranch Hand
Posts: 331
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Ulf Dittmer
Rancher
Posts: 42968
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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)?
 
Vishwanath Krishnamurthi
Ranch Hand
Posts: 331
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 331
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oops.. I just found the typo in my html file.
I had typed "form" as "from"

Thanks,
Vishwa
 
Seetharaman Venkatasamy
Ranch Hand
Posts: 5575
Eclipse IDE Java Windows XP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Vishwanath Murthi wrote:Oops.. I just found the typo in my html file.
I had typed "form" as "from"


Good Catch
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic