This week's book giveaways are in the Cloud and AI/ML forums.
We're giving away four copies each of Cloud Native Patterns and Natural Language Processing and have the authors on-line!
See this thread and this one for details.
Win a copy of Cloud Native PatternsE this week in the Cloud forum
or Natural Language Processing in the AI/ML 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

tomcat return an error +mvc

 
Ranch Hand
Posts: 114
Hibernate Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi friends I am developing simple mvc using request dispatcher ,here what i am going to do is I am developing Inventory Management system using mvc and jsp as view servlet as controller and beans as model,I have written a few class file and got the following error
Error

these are my codes
Database.java

cashierDetails.java

cashierServlet.java

web.xml

cashierRegistration.sjp


any idea ..
 
Marshal
Posts: 67273
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

HTTP Status 404 - /testing-cashier/cashierDetails


Where is cashierDetails mapped?
 
Bear Bibeault
Marshal
Posts: 67273
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
P.S. Generating HTML in a servlet? This is no longer 1997. Why are you not using a JSP for the view?
 
Vas Miriyala
Ranch Hand
Posts: 114
Hibernate Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks for your replyy cashierDetails contains methods to insert user entered parameters like username,password into user table and it will insert user_id into cashier table
 
Bear Bibeault
Marshal
Posts: 67273
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You didn't answer my mapping question.
 
Vas Miriyala
Ranch Hand
Posts: 114
Hibernate Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
in my servler file i have create new object for cashierDetails and i called some methods like AddcashierUser and Addcashier(correct me if i am wrong)
 
Bear Bibeault
Marshal
Posts: 67273
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You keep answering every question except the one I am asking.

Where is the mapping?
 
Vas Miriyala
Ranch Hand
Posts: 114
Hibernate Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
may be i can say sorry before asking this ..i am not getting what you are asking for? mapped means ?
 
Bear Bibeault
Marshal
Posts: 67273
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A servlet must be mapped before it can be addressed. You already have one mapping in your deployment descriptor -- any servlet you wish to directly address must have a mapping.
 
Vas Miriyala
Ranch Hand
Posts: 114
Hibernate Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
okay,but cashierDetails is not a servlet? right,
 
Bear Bibeault
Marshal
Posts: 67273
170
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Then why would you be trying to address it via URL?

You've provided a lot of code, but not any detail on what you are trying to accomplish or how.
 
Vas Miriyala
Ranch Hand
Posts: 114
Hibernate Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
actually servlet is calling that class and methods( i have written in cashierServlet) here what i am trying to do is i want to insert into a data into a table named user(tables are already created in mysql) and cashier_details by using entered parameters( like username,password), in servlet i am using request.getParameter("username") and request.gerParameter("password") by using this i am calling AddcashierUser and Addcashier from cashierDetails class(i have written mysql statements to insert data into user and cashier_details tables) todo mysql quiries
 
Ranch Hand
Posts: 126
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


How does this compile?
 
Vas Miriyala
Ranch Hand
Posts: 114
Hibernate Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
oh...by default given by IDE,'s ,i commented that lines then also its not working
 
Vas Miriyala
Ranch Hand
Posts: 114
Hibernate Spring Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i did some modification to my codes and got the error which says
Error

here is the source-code for cashierDetails.java

hee is code for cashierServlet.java
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!