Note that there are some explanatory texts on larger screens.

plurals
  1. POIntegrating spring services with old jsp web application
    primarykey
    data
    text
    <p>I am new to Spring framework and would appreciate your guidance on a problem I am stuck with. I am working on development of web services based on Spring framework, which I have already developed separately on my local wrkspace, and now I am trying to integrate it with my existing web application which is basically using old jsps and no particular frameworks. My application is hosted on tomcat, and its original web.xml is:</p> <pre><code>&lt;!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd"&gt; &lt;web-app&gt; &lt;display-name&gt;BOBCAT&lt;/display-name&gt; &lt;description&gt; BOBCAT &lt;/description&gt; &lt;servlet&gt; &lt;servlet-name&gt;DFPServlet&lt;/servlet-name&gt; &lt;servlet-class&gt;uk.co.blackwell.dfp.DFPServlet&lt;/servlet-class&gt; &lt;init-param&gt; &lt;param-name&gt;properties&lt;/param-name&gt; &lt;param-value&gt;/opt/bobcat/dev2/apprunner/webapps/bobcat/WEB-INF/classes/uk/co/blackwell/dfp/dfpprops.xml&lt;/param-value&gt; &lt;/init-param&gt; &lt;/servlet&gt; &lt;servlet-mapping&gt; &lt;servlet-name&gt;DFPServlet&lt;/servlet-name&gt; &lt;url-pattern&gt;*.dfp&lt;/url-pattern&gt; &lt;/servlet-mapping&gt; &lt;!-- Cannot redirect to static apache-served pages --&gt; &lt;!-- File not found (404), unauthorized/forbidden (403, 401) --&gt; &lt;error-page&gt; &lt;error-code&gt;401&lt;/error-code&gt; &lt;location&gt;/not_found.jsp&lt;/location&gt; &lt;/error-page&gt; &lt;error-page&gt; &lt;error-code&gt;403&lt;/error-code&gt; &lt;location&gt;/not_found.jsp&lt;/location&gt; &lt;/error-page&gt; &lt;error-page&gt; &lt;error-code&gt;404&lt;/error-code&gt; &lt;location&gt;/not_found.jsp&lt;/location&gt; &lt;/error-page&gt; &lt;/web-app&gt; </code></pre> <p>the new web.xml which I wanted to integrate within this old one is:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"&gt; &lt;context-param&gt; &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt; &lt;param-value&gt;/WEB-INF/dispatcher-servlet.xml&lt;/param-value&gt; &lt;/context-param&gt; &lt;listener&gt; &lt;listener-class&gt;org.springframework.web.context.ContextLoaderListener&lt;/listener-class&gt; &lt;/listener&gt; &lt;servlet&gt; &lt;servlet-name&gt;dispatcher&lt;/servlet-name&gt; &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;/servlet-class&gt; &lt;load-on-startup&gt;2&lt;/load-on-startup&gt; &lt;/servlet&gt; &lt;servlet-mapping&gt; &lt;servlet-name&gt;dispatcher&lt;/servlet-name&gt; &lt;url-pattern&gt;/&lt;/url-pattern&gt; &lt;/servlet-mapping&gt; &lt;session-config&gt; &lt;session-timeout&gt; 30 &lt;/session-timeout&gt; &lt;/session-config&gt; &lt;welcome-file-list&gt; &lt;welcome-file&gt;/&lt;/welcome-file&gt; &lt;/welcome-file-list&gt; &lt;servlet&gt; &lt;servlet-name&gt;restful&lt;/servlet-name&gt; &lt;servlet-class&gt;org.springframework.web.servlet.DispatcherServlet&lt;/servlet-class&gt; &lt;init-param&gt; &lt;param-name&gt;contextConfigLocation&lt;/param-name&gt; &lt;param-value&gt;/WEB-INF/spring/appServlet/restful-context.xml&lt;/param-value&gt; &lt;/init-param&gt; &lt;load-on-startup&gt;1&lt;/load-on-startup&gt; &lt;/servlet&gt; &lt;servlet-mapping&gt; &lt;servlet-name&gt;dispatcher&lt;/servlet-name&gt; &lt;url-pattern&gt;/&lt;/url-pattern&gt; &lt;/servlet-mapping&gt; &lt;servlet-mapping&gt; &lt;servlet-name&gt;restful&lt;/servlet-name&gt; &lt;url-pattern&gt;/restful/*&lt;/url-pattern&gt; &lt;/servlet-mapping&gt; &lt;/web-app&gt; </code></pre> <p>I think I might be doing something terribly wrong in defining new web.xml itself, as when I put the chunks from the spring version to old version, it gives me 404 not found error for all the requests. I have tried consulting a lot of online resources but most of them are either supportive for new spring apps from scratch or are incomplete in some senses. Any help or efforts would be deeply appreciated.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload