Jump to content

Recommended Posts

Posted

Username: rakesh73

server: Tommy

 

I have deployed a new war file using cPanel. I am facing two issues described below:

 

1. The servlet path is not available securely. The servlets are accessible on http:// On trying to access by https:// I get a 404 error. I was expecting the servlets to be available on a secure path just like jsp files. This could cause security issues for example if I try to send login information to a servlet, I should be sending over a secured path.

 

2. I set some relative paths for static resources like javascript and css files using httpServletRequest.getContextPath().

My application url is <my-domain>/blog, but the  httpServletRequest.getContextPath() returns a contextPath /rakesh73_blog

 

This makes setting the relative paths very difficult. The httpServletRequest.getContextPath() should return contextPath "/blog" as visible in the last part of the application url.<my-domain>/blog

 

 

Thanks

 

Posted

I've answered in your other topic and unsolved it for you. My response is copied below for reference:

 

For #1, we don't support HTTPS for Java by default because it uses a lot of resources and means your account would use up 2 Java slots instead of one if supported both HTTP and HTTPS. It can be enabled for you, but regular HTTP won't work anymore if you want us to do this.

 

For #2, this is a limitation of how we handle WAR files. It occurs because we deploy into a username prefixed folder. If we didn't, nobody else on the server would be able to have a WAR called "blog". We recommend naming your WAR file with the username_ in front of it (e.g username_blog) so the deployment path and the URL are the same. There is no fix other than to either rename the WAR, or develop your code to make the assumption that the username will appear in front when searching for its files.

 

Posted

Redeployed the war with <username>_blog.war. The url is <my-domain>/blog and the contextPath is /<username>_blog.war

 

 The app is still not able to find the files and submit forms. The login form needs to submit to /rakesh73_blog/login, but that page is not found as the url is <my-domain>/blog

 

I tried setting all relative paths to /blog, but then faced cookies issue so reverted the changes.

 

 

Please let me know if there is any thing that will solve the cookie issue and the contextPath issue.

Posted

I just discovered that after going to home page http://<my_domain> and then navigating to http://<my_domain>/rakesh73_blog I get the session to persist.

 

If I go to http://<my_domain>/rakesh73_blog disrectly, session does not hold across request.s. 

 

 

Please do not make the changes as described in above post. I need to do some more testing. I will post again If I need anything to change.

 

 

 

Thanks for your patience

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...