Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

"The requested ressource is not available"

 
Kevin Olome
Ranch Hand
Posts: 41
1
Android Firefox Browser Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello I can't get a single register form running.

My Servlet:


my HTML Page: (FormPag.html)



web.xml (I am using Tomcat 6 Server)


Where is my error? What did I do wrong?
 
Stephan van Hulst
Bartender
Posts: 6332
79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do you access your page? Do you go to http://localhost/FormPag.html ?

Does it try to browse to http://localhost/process afterwards?
 
Kevin Olome
Ranch Hand
Posts: 41
1
Android Firefox Browser Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello thanks for you answer.

I use the IDE: eclipse

And the eclipse browser goes to:

http://localhost:8080/CaHv6/FormPag.html

 
Stephan van Hulst
Bartender
Posts: 6332
79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm going to assume you have a context.xml in your WEB-INF folder that says /CaHv6 is your application's context path.

When you submit your form, does it try to browse to http://localhost:8080/CaHv6/process ?
 
Kevin Olome
Ranch Hand
Posts: 41
1
Android Firefox Browser Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
in web inf folder I only have a web.xml file.

But in servers -> tomcat 6 localhost config files I have a context.xml file



If I submit the form it goes to http://localhost:8080/process
I tryed to change it in web.xml file but somehow it don't work.
 
Stephan van Hulst
Bartender
Posts: 6332
79
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tomcat uses /CaHv6 as your application's context path, meaning that this path is seen as the root of your application, and any absolute paths used on the server-side will resolve to a URI starting with http://localhost:8080/CaHv6. That means that /process in your web.xml will refer to http://localhost:8080/CaHv6/process.

The problem is that the action you used in your form is also absolute, but the client-side doesn't know anything about context paths, so absolute paths will resolve to a URI starting with the site address. /process in your HTML will refer to http://localhost:8080/process.

The solution is to use either use relative paths in your HTML, or prefix your paths with your application's context path: action="process" or action="/CaHv6/process".
 
Kevin Olome
Ranch Hand
Posts: 41
1
Android Firefox Browser Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you very much. Now it works!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic