• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Unable to direct to page after login

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can anyone offer me assistance?

I have a servlet "Login.java" that is directed to different url depending on the login domain.

The login jsp is in "Tomcat 5.5\webapps\FYP" folder and the directed pages are in the "Tomcat 5.5\webapps\FYP\WEB-INF\classes" folder.

When i try to login using tomcat as the server, I get the following error.
"HTTP method GET is not supported by this URL.
description The specified HTTP method is not allowed for the requested resource (HTTP method GET is not supported by this URL)."

The servlet code is as follow:


I have tried changing the "doGet" to "doPost" and service but the error merely change from "GET" to "POST". I have also tried removing the /FYP/ but it doesnt work either.

Can anyone offer me some assistance? Your assistance is very much appreciated.

Thanks.

[BSouther: Added UBB CODE tags]
[ January 05, 2007: Message edited by: Ben Souther ]
 
Ranch Hand
Posts: 1514
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Don't override the service method. Use GET or POST.
 
aristal wang
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've tried get and post but it displays the error

HTTP Status 405 - HTTP method GET is not supported by this URL...

Can there be any other thing that might have gone wrong?

pls help...
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I don't see either doGet or doPost - how is the service method invoked?

Please use CODE tags around code of any length. It becomes much easier to read that way.
 
aristal wang
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sorry the doPost and doGet are replaced by service in the code. I've tried doPost doGet earlier but it doesnt work.


Please help!!!
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The service method shown above does not override the one in HttpServlet, because it has a different signature. Thus it will not be called unless you do so explicitly somewhere. The default service/doGet/doPost methods that are being called just return the "doGet/doPost not allowed" errors that you are seeing.
[ January 05, 2007: Message edited by: Ulf Dittmer ]
 
Ranch Hand
Posts: 763
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
just copy and paste the folloing code in your servlet.... and than see the console...

 
aristal wang
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm sorry but which part of the code shld i put it into?
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You'd put it into the servlet, on the same level as the "service" method.
 
The problems of the world fade way as you eat a piece of pie. This tiny ad has never known problems:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic