Mike Gibbs

Greenhorn
+ Follow
since Oct 31, 2011
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Mike Gibbs

Sean Clark wrote:Ok got it, should be / and not /*.

I just created a test app with your settings (apart from the sitemesh filter which I commented out and the listener which I did the same as it expects an applicationContext.xml file).

Sean



Tried / and not /*, and commented out the sitemesh, restarted the server too. I'm using Tomcat 7, using the Tomcat installaion in Eclipse.

Edit:
Can you upload your test app for me to test please?
13 years ago

Sean Clark wrote:Hey,

The URL pattern for the servlet is still wrong, it should go from the context root (test-app) so it should be /*.

Sean



Still doesn't work.
13 years ago

Sean Clark wrote:Hey,

That shouldn't matter, that's why you have created a viewResolver in your spring configuration and why you have used the <mvc:view-controller /> annotation.
There is however another problem in your configuration that is probably the issue, you have not created Spring's servlet in the web.xml you posted. Therefore Spring will never be initialised.

Sean



Hey,

I appreciate your help, I updated my code in the first post.

<mvc:view-controller /> - I use this tag because I used this on placement this summer, and I thought I'd use it again, but I can't seem to set up the application properly with Tomcat, before, I was using Google App Engine.

If I go to my index.jsp by going to http://localhost:8080/test-app/ I get a 404 (Going to http://localhost:8080/ gets me the Tomcat management page).
13 years ago

Sean Clark wrote:Hey,

You should try...
http://localhost:8080/test-app/index it won't find an index.jsp file if you are only pointing at the root...

Sean



That doesn't work either.
13 years ago
I'm trying to move all my jsps into a folder under WebContents/WEB-INF/view but I keep getting a 404. Going to http://localhost:8080/test-app/ doesn't find my index.jsp under the view folder, but is ok in the WebContent folder. Why might this be?

Folder structure:


dispatcher-servlet.xml



web.xml

13 years ago
I managed to get it working this morning, not sure what was wrong but I just created a new app today.
I tried to run the app on Tomcat in Eclipse but keep getting this error "The requested resource (/Ecommerce/) is not available." - what might be wrong? In the tomcat directory "wtpwebapps" - I don't see any jsp files and I dont why this is. And there is an actual jsp file in the project. I can attach the project if anyone wants to try.

HelloWorldController.java



web.xml


dispatcher-servlet.xml