Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6663231
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T02:28:35+00:00 2026-05-26T02:28:35+00:00

In my hello world program on tomcat i am not able to forward my

  • 0

In my hello world program on tomcat i am not able to forward my request from servlet to jsp page.Here are my locations:-

servlet location is webapps\hello\WEB-INF\classes\test

Location of jsp page(RequestObjectInJSP) is webapps\hello

My code to forward the request is

req.getRequestDispatcher("RequestObjectInJSP").forward(req, res);

But it gives the error The requested resource (/hello/RequestObjectInJSP) is not available.

Not sure what i am missing here?

Question2:- similarily if i try to forward the request from one servlet to another servlet(both lying under same folder) does not work .Below is the code snippet

req.getRequestDispatcher(“servlet2”).forward(req, res);

If i give the mapping of servlet2 in web.xml then it starts working.As per my understanding
if we forward the request from one servlet to another and both lying under webinf/classes folder it should work without giving the sevlet 2 mapping in web.xml. Right?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T02:28:36+00:00Added an answer on May 26, 2026 at 2:28 am

    Your JSP file is missing the JSP extension. Add it and fix the path accordingly.

    req.getRequestDispatcher("RequestObjectInJSP.jsp").forward(req, res);
    

    As to your 2nd question, yes definitely you need to map the servlet on an URL pattern in order to be able to forward to the URL(!!) of the given servlet.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The manual page for XML::Parser::Style::Objects is horrible. A simple hello world style program would
I want to compile a "Hello World" MS-DOS exe. Not a program that runs
Here's a Hello world program that uses WinAPI's WriteFile (compiled in Microsoft Visual C++
This is a fully functional WCF Hello World program. I.e. I am able to
Is there the equivalent of the Hello World program for GIS applications? I am
I am trying to develop my Hello World program in NHibernate. My codes are
I'm experimenting with internationalization by making a Hello World program that uses properties files
I'm working on a C-brain teaser: Write the standard Hello-World program, without semi-colons. My
I created a hello world java program and use lauch4j to convert executable jar
I want to compile a simple hello-world-style program using the Windows command line. cl

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.