File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Servlets and the fly likes Http Status Error 405 : get Method Not Supported. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "Http Status Error 405 : get Method Not Supported." Watch "Http Status Error 405 : get Method Not Supported." New topic
Author

Http Status Error 405 : get Method Not Supported.

Pranit Sonawane
Ranch Hand

Joined: Jul 29, 2011
Posts: 155

Hi all i tried everything but still not able to solve. Please Help

*********************UserHome.java**************************


*************************End UserHome.java**********************************

*************************DailyTransactions.java**********************************


*************************End DailyTransaction.java**********************************

When I Click on any button on the UserHome.java file then it gives me 405 error. Please Help Me.
Matthew Brown
Bartender

Joined: Apr 06, 2010
Posts: 4385
    
    8

Try adding @Override to the doGet() method, and your compiler will give you a clue. Hint - you're not overriding anything in DailyTransactions.

By the way...why on earth are you writing HTML like that? Talk about a maintainability nightmare - that's what JSPs are for.
Pranit Sonawane
Ranch Hand

Joined: Jul 29, 2011
Posts: 155

Matthew Brown wrote:
By the way...why on earth are you writing HTML like that? Talk about a maintainability nightmare - that's what JSPs are for.


I've been advised to not to use JSP - Servlet combination. So I've stopped using it.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18564
    
    8

Pranit Sonawane wrote:I've been advised to not to use JSP - Servlet combination. So I've stopped using it.


Well, in my opinion that was bad advice.

But on the other hand your code is just full of bad practices, so it isn't surprising that you believed that was good advice and accepted it. (I don't mean to be critical, because the bad practices I see in your code are the same ones that I see in every other beginner's code here too -- I've given up on pointing these things out and I just hope that people outgrow them before they start writing real software.)

So anyway, the standard version of "best architecture" for today is to have your links point to servlets (as yours do). The servlet should check the input data, do any validations necessary and update the application's state as necessary. Finally it should put the data needed for the output into the request context (or into the session if it needs to persist beyond the current request) and forward to a JSP, which will take the data from the request context and render it into HTML.
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 61187
    
  66

Pranit Sonawane wrote:I've been advised to not to use JSP - Servlet combination. So I've stopped using it.

Seriously? By whom? Not good advice as Paul has pointed out.

Please see this article for more info.
Pranit Sonawane
Ranch Hand

Joined: Jul 29, 2011
Posts: 155

Hmm. Thanks a lot Paul & Bear, your advises have always been so helpful. I read the article as suggested by Bear and will be following the standard code practices as suggested by Paul. Thanks again to both of you for your guidance.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Http Status Error 405 : get Method Not Supported.