Win a copy of Pro Spring MVC with WebFlux: Web Development in Spring Framework 5 and Spring Boot 2 this week in the Spring forum!
  • 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
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh

Been troubleshooting for 3 days: Servlet doesn't work

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am new to JSP/Servlet scene but I have been in I.T field for good couple of years.
For the end of me - I cannot run HELLO WORLD servlet on Tomcat 7

I been suspecting that its illconfigured web.xml file - hence I have tried many HELLO WORLD servlet and they don't work either

Although builtin example works.

For code + exact error details - lets just say this one is exactly describing my issue but it is not working: http://www.daniweb.com/forums/thread186788.html

I can compile it successfully and I can open it through tomcat.

I have tried importing WAR files - doesn't work
Created new files - doesn't work
Copied other people's project - doesn't work


Any help is appreciated.

Note - this is local development environment. A lot of time it is not connected to internet either. Security is not a concern.
 
Ranch Hand
Posts: 60
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

If the address in your browser is some thing like this http://localhost:8084/myservlet. This url would like this if you are using Netbeans IDE.

Then changing the code in your jsp from <FORM action="/myServlet" method="GET"> to

<FORM action="[YOUR PROJECT NAME]/myServlet" method="GET">

will help you call your servlet

Binu Narayanan
 
Rancher
Posts: 1337
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"it doesn't work" is not a helpful problem description - see ItDoesntWorkIsUseless and TellTheDetails.

You could also check out how the examples in the "servlets-examples" web app work that comes with Tomcat.
 
Moe Cosby
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
^ LOL

As I mentioned in my original post (see the link for details of code + error) - My problem is EXACTLY the same.

but my solution is not.

@Binu - I will try that and report back on Monday.
 
Sheriff
Posts: 67537
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"Prince Ms", please check your private messages for an important administrative matter. Thanks.
 
Ranch Hand
Posts: 672
4
Eclipse IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In that link, they also tell that the problem is solved.. Can, you please tell the exact details of your problem.. I wonder why can't you tell your problem with your code here, instead of showing us the link.. this also helps to get more responses to your question..
 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you tried by dropping the "/" in the Form action? I think this will work...
 
Ranch Hand
Posts: 754
Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If you want, in my signature there is a tutorial for hello world with servlet.

It might help you.

 
Moe Cosby
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks everyone. Mark this as resolved.

Removed all tomcat(s). Reinstalled tomcat 7. Checked all paths. Recreated all files from scratch in notepad (no copy paste). Working now.


[Although Servlet are more powerful - I prefer Microsoft ASP, you end up spending more time in developing solution than learning / troubleshooting :s ]
 
Too many men are afraid of being fools - Henry Ford. Foolish tiny ad:
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic