Glassfish:使用非根上下文部署的Web应用程序解释相对于domain1 / docroot的请求

时间:2008-09-26 17:07:49

标签: spring-mvc glassfish

webapp使用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>

请求http://localhost:8080/application-context-folder/index.jsp  应解析为application-context-folder / index.jsp并解析为domain1 / docroot / application-context-folder。

是设计还是我需要更改应用程序或配置中的内容?

@Edit:输入错误,请求的网址为http://localhost:8080/application-context-folder/index.jsp, not http://localhost:8080/index.jsp

1 个答案:

答案 0 :(得分:3)

使用重定向到您的应用程序上下文。将index.html文件放在域的docroot文件夹中。文件可能如下所示:

<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>