Win a copy of Zero to AI - A non-technical, hype-free guide to prospering in the AI era this week in the Artificial Intelligence and Machine Learning 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
  • Liutauras Vilda
  • Paul Clapham
  • Bear Bibeault
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • salvin francis
  • Scott Selikoff
  • fred rosenberger

Servlet Mapping not working

 
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to use servlet mapping for the jsp form and I cannot get it working, nor can I figure out why. It is a requirement to use the form action tag exactly as-is

JSP



web.xml



Servlet Name: EnrollmentAdmin.java stored in the edu.vt.cs5244 package
 
Marshal
Posts: 67463
173
Mac Mac OS X IntelliJ IDE jQuery Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
First of all, why are you using the package structure for the mapping? Bad idea and a possible security issue.

Secondly, your URL as specified in the form action does not match the mapping.

And finally, you should be prefixing the action URL with the web app's context path.
 
Ron Ingram
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks. The form action is a requirement to use it exactly as-is.. so I cannot change it to a better practice.

The url in the web.xml mapping must begin with "/". When I match it exactly with the form action "servlet/edu.vt.cs5244.EnrollmentAdmin", netbeans throws an error as shown below:



 
Ron Ingram
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It appears my issue is not the mapping after all but an error in the servlet..

Thanks again..
 
You can't expect to wield supreme executive power just because
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic