PDA

View Full Version : Hosting Spring App


rfulcher
Apr 22nd, 2006, 11:27 AM
I am new to placing my spring apps on a hosted server and am having some issues. I usually have access to my tomcat and think I understand the structure on a hosted site. Basically the / directory is a context with it's own WEB-INF and when I upload a war file in there I get a directory with the name of the war and all my app files in it. No I develop my apps with a jsp directory in the web-inf where I place all my jsp files. I have one jsp file in the root of the context "index.jsp" that redirects to my "main.jsp" that is in the WEB-INF/jsp directory. Now on a regular tomcat on my laptop this works just fine. when the app is uploaded to the hosting server it will do the redirect but can't seem to find the main.jsp page. I have simulated this by placing a project inside a project on my local tomcat and it displays the same message. Can anyone give me a hint as to what this may be. I am stumped.

Thanks

katentim
Apr 23rd, 2006, 01:12 AM
I have one jsp file in the root of the context "index.jsp" that redirects to my "main.jsp" that is in the WEB-INF/jsp directory.
This should never work unless you are redirecting to a controller that dispatches to the main.jsp file.

If that is what you are doing, are you using c:redirect to ensure the context is included?

rfulcher
Apr 23rd, 2006, 08:55 PM
I am using this code in my jsp

<c:redirect url="main.htm" />

and this in my controller

return new ModelAndView("main");

My application is designed exactly like the ones in "Developing a Spring Framework MVC application step-by-step" by Thomas Risberg. Which is what I used to learn. Is there another way that I should be designing the application.

Thanks

katentim
Apr 23rd, 2006, 09:14 PM
and this in my controller...Is there another way that I should be designing the application
No, there must be something else going on...

rfulcher
Apr 23rd, 2006, 10:37 PM
Any ideas? I don't know what to do at this point.

Steve O
Apr 24th, 2006, 10:04 PM
One problem that I encountered deploying on a remote host was using the <c:redirect/> was that the server did not like my jsp page. The directory structure was similar to:

domain
--WEB-INF
--servletName
----WEB-INF
----ETC.

At the domain level, the jsp couldn't find my standard.jar. I just popped it into the first level WEB-INF folder (domain/WEB-INF) NOT the (domain/servletName/WEB-INF) and it redirects fine. There's probably an easier way, but this works for me.

Uploading the *.war file is simple, I just upload it to the main folder and it autodeploys...

Good luck,

Steve O

rfulcher
Apr 25th, 2006, 12:59 PM
Steve O,

I will give that a try. I have just switched over from godaddy to DailyRazon. I will give this a try tonight.

Thanks for the help.

Steve O
Apr 25th, 2006, 05:02 PM
I used to be with DailyRazor (fairly good host), I think you can use this method just fine with them!

Good luck,

Steve O

rfulcher
Apr 26th, 2006, 11:26 AM
After listing with DailyRazor everthing is working fine. Same code that was on godaddy is working without modification on DailyRazor.....

Thanks Steve O and katentim for you thoughts.