2008-09-26 24 views
6

La webapp utilise Spring MVC.Glassfish: l'application Web déployée avec le contexte non-root interprète les requêtes relatives à domain1/docroot

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

en fait la demande comme http://localhost:8080/application-context-folder/index.jsp devrait résoudre à l'application contexte-dossier/index.jsp et ils résoudre à domain1/docroot/contexte d'application-dossier.

Est-ce que c'est par conception ou dois-je changer quelque chose dans l'application ou la configuration?

@EDIT: il y avait une faute de frappe, l'URL est http://localhost:8080/application-context-folder/index.jsp, not http://localhost:8080/index.jsp

+2

Pour http: // localhost: 8080/index.jsp pour travailler, l'application doit être dans le contexte de la racine. Sinon, http: // localhost: 8080/context/index.jsp –

Répondre

3

Utilisez rediriger vers votre contexte d'application. Placez un fichier index.html dans le dossier docroot de votre domaine. Le fichier peut ressembler à ceci:

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