Glassfish: a web application deployed using a non-root context interprets queries regarding domain1 / docroot

Webapp uses Spring MVC.

<bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping"> <property name="urlMap"> <map> <entry key="/*" value-ref="defaultHandler"/> </map> </property> <property name="order" value="2"/> </bean> <bean name="defaultHandler" class="org.springframework.web.servlet.mvc.UrlFilenameViewController"/> <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver"> <property name="viewClass" value="org.springframework.web.servlet.view.JstlView"/> <property name="prefix" value="/"/> <property name="suffix" value=""/> </bean> 

So requests like http://localhost:8080/application-context-folder/index.jsp must be allowed to application-context-folder / index.jsp, and they are allowed in 1 / docroot / application-context-folder.

Is it by design or do I need to change something in the application or configuration?

@Edit: there was a typo requested URL http://localhost:8080/application-context-folder/index.jsp, not http://localhost:8080/index.jsp

+6
spring-mvc glassfish
source share
1 answer

Use call forwarding in the application context. Place the index.html file in the docroot folder of your domain. A file might look something like this:

 <html> <head> <title>Your application title</title> <frameset> <frame src="http://localhost:8080/[application_context]"> </frameset> </head> <body> Redirecting to <a href="http://localhost:8080/[application_context]">Some title</a>... </body> 

+3
source share

All Articles