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

  • Home
  • SEARCH
  • 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 7523537
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T02:49:55+00:00 2026-05-30T02:49:55+00:00

I’m new to Spring. I worked through the sections of this tutorial that cover

  • 0

I’m new to Spring. I worked through the sections of this tutorial that cover web flow. My ultimate goal is to use Spring to implement new features in a legacy servlet webapp and then gradually replace the existing code making the servlet webapp into a Spring webabb.

So, to that end, I decided to go through the web flow part of the tutorial again, changing names to make my own first “hello world” screen with Spring within the development copy of the legacy servlet application.

My problem is that when I put the servlet mappings for Spring into my web.xml, I get 404s trying to get to my landing page.

  • I’m using WebLogic 9.2
  • I converted the directory tree of my webapp to mimic the layout that Spring webapps use
  • I copied spring.jar and spring-mvc.jar into my WEB-INF/lib

I made a simplified version of my web.xml, with just one legacy servlet in it ( for the landing page ) and Spring. It works with the Spring stuff commented out, but not otherwise. Here it is, my WEB-INF/web.xml for the “abc” webapp

<?xml version="1.0" encoding="UTF-8"?>
<web-app id="WebApp_ID" version="2.4"
  xmlns="http://java.sun.com/xml/ns/j2ee"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">


  <servlet>
    <servlet-name>LogIn</servlet-name>
    <servlet-class>
            com.utilities.LogIn
    </servlet-class>
  </servlet>

  <servlet-mapping>
    <servlet-name>LogIn</servlet-name>
    <url-pattern>/home</url-pattern>
  </servlet-mapping>


  <servlet>
    <servlet-name>abc</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
  </servlet>

  <servlet-mapping>
    <servlet-name>abc</servlet-name>
    <url-pattern>*.htm</url-pattern>
  </servlet-mapping>



  <!-- Welcome File List  -->
  <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
  </welcome-file-list>


</web-app>

This is my WEB-INF/abc-servlet.xml

<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
       http://www.springframework.org/schema/beans/spring-beans-2.5.xsd">

  <!-- the application context definition for the NSD webapp DispatcherServlet -->

  <beans name = "/hello.htm" class = "com.somecompany.web.HelloController"/>

</beans>

Here is the code for my elementary controller:

package com.somecompany.web;

import org.springframework.web.servlet.mvc.Controller;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import java.io.IOException;

import org.apache.log4j.Logger;

public class HelloController implements Controller {

    protected static final Logger logger = Logger.getLogger(HelloController.class);

    public ModelAndView handleRequest(HttpServletRequest request, HttpServletResponse response)
            throws ServletException, IOException {

        logger.info("Returning view for CBS Search ....");

        return new ModelAndView("hello.jsp");
    }

}// end class 

Again, my problem isn’t with the controller or the view (jsp)…yet. Right now, when I include the Spring servlet mappings in my web.xml, I can’t get to my landing page, I get a 404. When I yank the Spring servlet mappings, that problem goes away.

I’m a raw beginner with Spring, so I am not sure where to look.

  • 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-30T02:49:56+00:00Added an answer on May 30, 2026 at 2:49 am

    The issue is probably with the <url-pattern> in your web.xml. You cannot use “.jsp” as your mapped extension.

    There is some pretty detailed discussion about the low-level reasons in this thread… but the long and short of it is that the “*.jsp” file extension is special to the underlying Java servlet specification. You’re trying to make Spring hijack that. This is why the tutorial you linked to is using “*.htm” instead.

    Trying changing your <url-pattern> in web.xml to something else (such as *.htm), and see if you can pull up your test URL with that extension.

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

Sidebar

Related Questions

I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I want use html5's new tag to play a wav file (currently only supported
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
I've got a string that has curly quotes in it. I'd like to replace
this is what i have right now Drawing an RSS feed into the php,

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.