我在使用条纹动作豆时遇到了麻烦。
在浏览器上引入第一个http://localhost:9080/profesionales-sanitarios-war/medicos/publico/accesoInterno会导致 302 状态代码并重定向到 AccesoActionBean
我第二次在浏览器上引入http://localhost:9080/profesionales-sanitarios-war/medicos/publico/accesoInterno时,它返回一个 200 状态码,并且在访问 AccesoInternoActionBean 时工作正常。
它发生在 localhost 和服务器(开发、预生产和生产)中。
AccesoActionBean.java:
@UrlBinding( "/medicos/publico/acceso" + "/{tipoAcceso}/{destino}" )
public class AccesoActionBean extends MedicosBaseActionBean {
[...]
@DontValidate
@DefaultHandler
public Resolution init() {
setSessionField( SESION_CONTADOR_ACCESOS, contadorAccesos );
if( tipoAcceso != null && "popup".equalsIgnoreCase( tipoAcceso ) ) {
return new ForwardResolution( "/WEB-INF/pages/acceso/loginForm.jsp" );
} else {
return new ForwardResolution( NavegacionConst.JSP_ACCESO );
}
}
[...]
}
AccesoInternoActionBean.java:
@UrlBinding( "/medicos/publico/accesoInterno" )
public class AccesoInternoActionBean extends MedicosBaseActionBean {
[...]
@DontValidate
@DefaultHandler
public Resolution init() {
setSessionField( SESION_CONTADOR, contadorAccesos );
return new ForwardResolution( NavegacionConst.JSP_ACCESO_INTERNO );
}
[...]
}
ActionBeans 似乎编码正确,它们类似于其他从第一次重定向到正确的操作 bean。我已经搜索过,我已经调试过,但我找不到答案。我认为这个问题可能来自一些配置文件,比如这个 web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<display-name>${project.build.finalName}</display-name>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<listener>
<listener-class>es.sanitas.medicos.stripes.listeners.StartupListener</listener-class>
</listener>
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>classpath:es/sanitas/medicos/applicationContext-profesionales.xml</param-value>
</context-param>
<context-param>
<param-name>oracle.adf.jsp.provider.5</param-name>
<param-value>oracle.stellent.wcm.javaee.shared.jsp.IdcJspProvider</param-value>
</context-param>
<context-param>
<description>Url del Servidor de Contenidos</description>
<param-name>manageSite</param-name>
<param-value>http://caliban01:8888/</param-value>
</context-param>
<filter>
<display-name>Stripes Filter</display-name>
<filter-name>StripesFilter</filter-name>
<filter-class>net.sourceforge.stripes.controller.StripesFilter
</filter-class>
<init-param>
<param-name>Extension.Packages</param-name>
<param-value>
es.sanitas.stripes.integrations.spring,
net.sourceforge.stripes.integration.spring,
es.sanitas.stripes.i18n
</param-value>
</init-param>
<init-param>
<param-name>ActionResolver.Packages</param-name>
<param-value>
es.sanitas.medicos.stripes.actionbeans,
es.sanitas.medicos.blua.stripes.actionbeans,
es.sanitas.stripes.actionbeans.captcha,
es.sanitas.medicopersonalprofesionales.stripes
</param-value>
</init-param>
<init-param>
<param-name>ExceptionHandler.Class</param-name>
<param-value>es.sanitas.medicos.stripes.handlers.MedicosExceptionHandler</param-value>
</init-param>
<init-param>
<param-name>Interceptor.Classes</param-name>
<param-value>
es.sanitas.medicos.stripes.interceptors.IsLoggedInterceptor,
es.sanitas.stripes.interceptors.AuditBaseInterceptor
</param-value>
</init-param>
<init-param>
<param-name>LocalePicker.Locales</param-name>
<param-value>es_ES:UTF-8,ca_ES:UTF-8,en:UTF-8</param-value>
</init-param>
<init-param>
<param-name>ResourceBundles.BaseNames</param-name>
<param-value>
es.sanitas.medicos.stripesErrors,
es.sanitas.medicos.stripesMessages
</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>StripesFilter</filter-name>
<servlet-name>StripesDispatcher</servlet-name>
<dispatcher>FORWARD</dispatcher>
<dispatcher>INCLUDE</dispatcher>
<dispatcher>REQUEST</dispatcher>
<dispatcher>ERROR</dispatcher>
</filter-mapping>
<servlet>
<servlet-name>StripesDispatcher</servlet-name>
<servlet-class>net.sourceforge.stripes.controller.DispatcherServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>StripesDispatcher</servlet-name>
<url-pattern>/captcha/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>StripesDispatcher</servlet-name>
<url-pattern>/medicos/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>StripesDispatcher</servlet-name>
<url-pattern>/medicopersonalprofesionales/*</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>/startProfesionalesSanitarios.jspx</welcome-file>
</welcome-file-list>
<mime-mapping>
<extension>js</extension>
<mime-type>application/x-javascript</mime-type>
</mime-mapping>
<mime-mapping>
<extension>css</extension>
<mime-type>text/css</mime-type>
</mime-mapping>
<jsp-config>
<jsp-property-group>
<url-pattern>*.jsp</url-pattern>
<scripting-invalid>true</scripting-invalid>
</jsp-property-group>
<jsp-property-group>
<url-pattern>*.jspf</url-pattern>
<scripting-invalid>true</scripting-invalid>
</jsp-property-group>
<jsp-property-group>
<url-pattern>*.jspx</url-pattern>
<scripting-invalid>false</scripting-invalid>
<is-xml>true</is-xml>
</jsp-property-group>
<jsp-property-group>
<url-pattern>*.tagx</url-pattern>
<scripting-invalid>true</scripting-invalid>
</jsp-property-group>
</jsp-config>
<error-page>
<error-code>500</error-code>
<location>/medicos/error</location>
</error-page>
<error-page>
<error-code>404</error-code>
<location>/medicos/inicio</location>
</error-page>
</web-app>
我一直在寻找解决方案,但我找不到任何解决方案
如果我的写作不完全正确,我想道歉,因为我的母语不是英语。