• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

UrlRewriting+servlets -Error

 
Vas Miriyala
Ranch Hand
Posts: 114
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am developing a java servlet program using url-rewriting and i have created three servlets and after entering first number by using FirstNumber.java servlet then when i press Next button it came up with messagw which says "The Requested resource is not available"
here is the code
FirstNumber.java


SecondNumber.java


Sum.java

web.xml
 
Chinmaya Chowdary
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Srinivas.

In FirstNumber.java there is
"action=\"http://localhost:8080/urlrewriting/SecondNumber\">"


Here 'urlrewriting' is package. We should not call like this.

Use relative path in FirstNumber.java and modify SecondNumber.java like
 
Vas Miriyala
Ranch Hand
Posts: 114
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for your reply and let me go through and i will let you know what happen
 
Vas Miriyala
Ranch Hand
Posts: 114
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
after changing got lot of errors
code after modifications
FirstNumber.jaba



Errors
 
Vas Miriyala
Ranch Hand
Posts: 114
Hibernate Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
program is compiled after changing the necessary quotations and got problem which browser returns HTTP Status 405 - HTTP method GET is not supported by this URL
 
Chinmaya Chowdary
Ranch Hand
Posts: 434
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Srinivas.

Modify FirstNumber.java as,


and SecondNumber.java as,
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic