Note that there are some explanatory texts on larger screens.

plurals
  1. POSpring Framework Page Direction
    text
    copied!<p>Background: I'm relatively new to Java/Spring and inherited a project built on them. We're moving to AWS Elastic Beanstalk which changed the location of the main page for JSON requests from:</p> <pre><code>www.mywebsite.com/myApp/myAppJsonService </code></pre> <p>to:</p> <pre><code>www.mywebsite.com/myAppJsonService </code></pre> <p>That worked fine- all the functions that come out the JSON requests (most of them) are working perfectly. I have another page that takes a teacher's uploaded quiz via HTML form submit and parses the data. The form used to point to:</p> <pre><code>www.mywebsite.com/myApp/controllers/importQuiz </code></pre> <p>so I changed it to:</p> <pre><code>www.mywebsite.com/controllers/importQuiz </code></pre> <p>The web.xml file has:</p> <pre><code>&lt;servlet&gt; &lt;servlet-name&gt;SpringDispatcher&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;classpath:context/Controllers.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;SpringDispatcher&lt;/servlet-name&gt; &lt;url-pattern&gt;/controllers/*&lt;/url-pattern&gt; &lt;/servlet-mapping&gt; </code></pre> <p>And the corresponding Controllers.xml code:</p> <pre><code>&lt;bean id="importExamController" class="com.myapp.controllers.ImportExamController"&gt; &lt;property name="commandClass" value="com.myapp.objects.spring.FileUploadBean"/&gt; &lt;property name="myappManager" ref="myappManager"/&gt; &lt;/bean&gt; &lt;bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"&gt; &lt;property name="mappings"&gt; &lt;props&gt; &lt;prop key="/importExam"&gt;importExamController&lt;/prop&gt; &lt;prop key="/heartbeat"&gt;heartBeatController&lt;/prop&gt; &lt;/props&gt; &lt;/property&gt; &lt;/bean&gt; </code></pre> <p>The way I read it, regardless of the preceding "myapp" in the URL, it should find "/controllers/" in the URL, look to the Controllers.xml file and find the "/importExam" and direct it to the "importExamController". That's not happening. Clearly, there is a fault in my logic, and I can't seem to find it. Any help would be very much appreciated.</p> <p>EDIT:</p> <p>Doing some digging through the logs, I found:</p> <pre><code>INFO: WSSERVLET14: JAX-WS servlet initializing Aug 27, 2011 7:21:06 PM com.sun.xml.ws.transport.http.servlet.WSServletDelegate doGet SEVERE: caught throwable ClientAbortException: java.net.SocketException: Broken pipe at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:373) at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.java:327) at org.apache.catalina.connector.OutputBuffer.writeBytes(OutputBuffer.java:396) at org.apache.catalina.connector.OutputBuffer.write(OutputBuffer.java:385) </code></pre> <p>and it goes on for a while. To me it looks like that is confirming the idea that the data is trying to be sent to something that is incorrectly mapped. Let me know if this might mean something else or if it's just irrelevant.</p>
 

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