core icon indicating copy to clipboard operation
core copied to clipboard

Are the custom spring example paths correct?

Open sheltonn opened this issue 12 years ago • 4 comments

Activator.java has

``java httpService.registerServlet( "/spring", dispatcherServlet, null, null ); //... CMSFilter.addExclude( "/app/spring" );``

example-servlet.xml has

``xml <bean id="viewResolver" class="com.dotmarketing.osgi.custom.spring.CustomViewResolver"> <property name="prefix" value="/application/spring/"/> <property name="suffix" value=".html"/> </bean>``

My controller has

``java @RequestMapping ("/examplecontroller")``

This leads me to believe that my URL needs to be http://localhost:8000/app/spring/examplecontroller

The view would need to be located in Site and Folders as /application/spring/helloworld.html

It's contents are

$message

I don't see any errors in catalina.out or dotcms.log, but I get a 404

sheltonn avatar Mar 03 '14 18:03 sheltonn

I'm not sure if this makes a difference, but I have multiple hosts set as default. demo.dotcms.com and a host that we created both have it. I checked and both appear to have a view created in the correct place and they both have $message.

sheltonn avatar Mar 03 '14 19:03 sheltonn

I went through and all of the hosts are stopped, except shared and our desired host.

sheltonn avatar Mar 03 '14 19:03 sheltonn

@sheltonn I don't think this is a bug or anything so I am going to close it. I bet you are trying to hit the method mapped to /

I bet you are using the wrong URL try http://localhost:8000/app/spring/examplecontroller/ NOT http://localhost:8000/app/spring/examplecontroller

notice the missing /

jtesser avatar Mar 03 '14 20:03 jtesser

Thank you. That was it exactly.

sheltonn avatar Mar 03 '14 20:03 sheltonn