This week's book giveaway is in the Spring forum.
We're giving away four copies of Spring Boot in Practice and have Somnath Musib on-line!
See this thread for details.
Win a copy of Spring Boot in Practice 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
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

Need help with web.xml file

 
Ranch Hand
Posts: 106
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I want to create an web.xml page
I frequently access a servlet page with this command:
response.sendRedirect("http://localhost:8080/myJSPs/servlet/portalftp.ServletFaillogin");
Is it possible to avoid typing this tedious line by using the web.xml file?
Here is what I have tried:

so thus the code now becomes:
response.sendRedirect("http://localhost:8080/myJSPs/servlet/faillog");
2nd question:
I have put the web.xml file at this location:
C:\tomcat\jakarta-tomcat-3.3.1\webapps\myJSPs-XML\WEB-INF
The file ServletFaillogin.java and rest of Java pages are at:
C:\tomcat\jakarta-tomcat-3.3.1\webapps\myJSPs-XML\WEB-INF\classes\portalftp
and all my HTML and JSP pages are at:
C:\tomcat\jakarta-tomcat-3.3.1\webapps\myJSPs-XML\jsp\portal-project
 
Ranch Hand
Posts: 2676
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
With the servlet-mapping tag in place, you shouldn't need /servlet in your url. It also appears that you have a problem with your context. Your webapp folder is called myJSPs-XML, but you are typing myJSPs in your URL. Unless you have changed your context in the Tomcat configuration file, that shouldn't work.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic