0

Zk + Spring Security redirect to strange page after login

asked 2011-01-07 07:35:24 +0800

lucasirc gravatar image lucasirc
3

updated 2011-01-07 08:07:19 +0800

Hi, i´m using Zk + spring security, and when i access the page login.zul, when i submit login and password and the security authenticate the user, after this the zk redirect me to page "http://127.0.0.1:8080/cold/zkau/web/a5f28083/js/zul.lang.wpd", as it should me send to /index.zul

http://127.0.0.1:8080/cold/zkau/web/a5f28083/js/zul.lang.wpd:

(function(){if(zk._p=zkpi('zul.lang'))try{
msgzk={};msgzk.NOT_FOUND="Não encontrado: ";msgzk.UNSUPPORTED="Ainda não suportado: ";msgzk.FAILED_TO_SEND="Falhou ao enviar requisição para o servidor.";msgzk.FAILED_TO_RESPONSE="O servidor falhou ao processar sua requisição.";msgzk.TRY_AGAIN="Tentar novamente?";msgzk.UNSUPPORTED_BROWSER="Navegador não suportado: ";msgzk.ILLEGAL_RESPONSE="Resposta desconhecida enviada pelo servidor. Por favor, recarregue e tente novamente.\n";msgzk.FAILED_TO_PROCESS="Falhou ao processar ";msgzk.GOTO_ERROR_FIELD="Ir para o campo errado";msgzk.PLEASE_WAIT="Processando...";msgzk.FILE_SIZE="Tamanho do arquivo: ";msgzk.KBYTES="KB";msgzk.FAILED_TO_LOAD="Falhou ao carregar ";msgzk.FAILED_TO_LOAD_DETAIL="Isto pode ser causado por um mau tráfego. Você pode recarregar esta página e tentar novamente.";msgzk.CAUSE="Causa: ";msgzk.LOADING="Processando";
zk.GROUPING=".";
zk.DECIMAL=",";
zk.PERCENT="%";
zk.MINUS="-";
zk.PER_MILL="‰";
zk.DOW_1ST=1;
zk.ERA="AD";
zk.YDELTA=0;
zk.SDOW=['Seg','Ter','Qua','Qui','Sex','Sáb','Dom'];
zk.S2DOW=zk.SDOW;
zk.FDOW=['Segunda-feira','Terça-feira','Quarta-feira','Quinta-feira','Sexta-feira','Sábado','Domingo'];
zk.SMON=['Jan','Fev','Mar','Abr','Mai','Jun','Jul','Ago','Set','Out','Nov','Dez'];
zk.S2MON=zk.SMON;
zk.FMON=['Janeiro','Fevereiro','Março','Abril','Maio','Junho','Julho','Agosto','Setembro','Outubro','Novembro','Dezembro'];
zk.APM=['AM','PM'];
msgzul={};msgzul.UNKNOWN_TYPE="Tipo de componente desconhecido: ";msgzul.DATE_REQUIRED="Você deve especificar uma data. Formato: ";msgzul.OUT_OF_RANGE="Fora de faixa. Deve estar entre";msgzul.NO_AUDIO_SUPPORT="Seu navegador não suporta áudio dinâmico";
zk.$default(msgzul, {
VALUE_NOT_MATCHED:'Você deve especificar um ou mais valores na lista de selecção.',
EMPTY_NOT_ALLOWED:'Em branco não permitido.\nMesmo somente espaços não são permitidos',
INTEGER_REQUIRED:'Você deve especificar um inteiro, em vez de {0}.',
NUMBER_REQUIRED:'Você deve especificar um número, em vez de {0}.',
DATE_REQUIRED:'Você deve especificar uma data, em vez de {0}.\nFormato: {1}.',
CANCEL:'Cancelar',
NO_POSITIVE_NEGATIVE_ZERO:'Permitido somente número positivo',
NO_POSITIVE_NEGATIVE:'Permitido somente zero',
NO_POSITIVE_ZERO:'Permitido somente número negativo',
NO_POSITIVE:'Permitido somente número não-positivo',
NO_NEGATIVE_ZERO:'Permitido somente número positivo',
NO_NEGATIVE:'Permitido somente número não-negativo',
NO_ZERO:'Permitido somente número diferente de zero',
NO_FUTURE_PAST_TODAY:'Permitido somente vazio',
NO_FUTURE_PAST:'Permitido somente zero',
NO_FUTURE_TODAY:'Permitido somente data passada',
NO_FUTURE:'Somente não permitida data futura',
NO_PAST_TODAY:'Permitido somente data futura',
NO_PAST:'Somente não permitido data passada',
NO_TODAY:'Somente hoje é permitido',
FIRST:'Primeiro',
LAST:'Último',
PREV:'Anterior',
NEXT:'Próximo',
GRID_GROUP:'Grupo',
GRID_OTHER:'Outro',
GRID_ASC:'Ordenar Ascendente',
GRID_DESC:'Ordenar Descendente',
GRID_COLUMNS:'Colunas',
OK:'OK',
CANCEL:'Cancelar',
YES:'Sim',
NO:'Não',
RETRY:'Tentar novamente',
ABORT:'Abortar',
IGNORE:'Ignorar',
RELOAD:'Reload',
UPLOAD_CANCEL:'Cancelar',
ILLEGAL_VALUE:'Valor ilegal'});
}finally{zk.setLoaded(zk._p.n);}})();

My web.xml

<?xml version="1.0" encoding="UTF-8"?>
	<!--
		<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web
		Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
	-->
<web-app version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee 
         http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">

	<display-name>TraceOn-Cold</display-name>
	<context-param>
		<param-name>contextConfigLocation</param-name>
		<param-value> 
	 		/WEB-INF/src/spring/cold-security.xml
	 </param-value>
	</context-param>
	<!-- Dispatcher Spring -->
	
	<servlet>
		<servlet-name>cold</servlet-name>
		<servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
		<load-on-startup>2</load-on-startup>
	</servlet>

	<servlet-mapping>
		<servlet-name>cold</servlet-name>
		<url-pattern>*.html</url-pattern>
	</servlet-mapping>
	
	<!-- End Dispatcher Spring -->
	<context-param>
		<param-name>loggerPropertiesFile</param-name>
		<param-value>/WEB-INF/log4j.properties</param-value>
	</context-param>

	<!-- Restlet -->
	<servlet>
		<servlet-name>restletservlet</servlet-name>
		<servlet-class>org.restlet.ext.spring.RestletFrameworkServlet</servlet-class>
	</servlet>

	<servlet-mapping>
		<servlet-name>restletservlet</servlet-name>
		<url-pattern>/rest/*</url-pattern>
	</servlet-mapping>

	<!-- End Restlet -->

	<!-- Start Spring Context Loader -->
	<listener>
		<listener-class>com.cold.main.security.ColdContextLoaderListenerImpl</listener-class>
	</listener>
	<listener>
		<listener-class>org.springframework.security.web.session.HttpSessionEventPublisher</listener-class>
	</listener>
	<listener>
		<listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
	</listener>
	<!-- Start Spring Context Loader -->



	<!-- Security Filter -->

	<filter>
		<filter-name>springSecurityFilterChain1</filter-name>
		<filter-class>org.springframework.web.filter.RequestContextFilter</filter-class>
	</filter>
	<filter>
		<filter-name>springSecurityFilterChain</filter-name>
		<filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
	</filter>
	<filter-mapping>
		<filter-name>springSecurityFilterChain</filter-name>
		<url-pattern>/*</url-pattern>
	</filter-mapping>

	<!-- End Security Filter -->


	<listener>
		<listener-class>org.zkoss.zk.ui.http.HttpSessionListener</listener-class>
	</listener>


	<servlet>
		<servlet-name>ApplicationContext</servlet-name>
		<servlet-class>com.mitahtech.iguassu.control.ServletApplicationContext</servlet-class>
		<init-param>
			<param-name>appParametersMap</param-name>
			<param-value>com.cold.main.control.ColdParametersMap</param-value>
		</init-param>
		<load-on-startup>1</load-on-startup>
	</servlet>

	<servlet>
		<servlet-name>zkLoader</servlet-name>
		<servlet-class>org.zkoss.zk.ui.http.DHtmlLayoutServlet</servlet-class>
		<!--
			Must. Specifies URI of the update engine (DHtmlUpdateServlet). It
			must be the same as <url-pattern> for the update engine.
		-->
		<init-param>
			<param-name>update-uri</param-name>
			<param-value>/zkau</param-value>
		</init-param>
		<load-on-startup>2</load-on-startup>
	</servlet>
	<servlet>
		<servlet-name>auEngine</servlet-name>
		<servlet-class>org.zkoss.zk.au.http.DHtmlUpdateServlet</servlet-class>
	</servlet>

	<servlet-mapping>
		<servlet-name>zkLoader</servlet-name>
		<url-pattern>*.zul</url-pattern>
	</servlet-mapping>
	<servlet-mapping>
		<servlet-name>zkLoader</servlet-name>
		<url-pattern>*.zhtml</url-pattern>
	</servlet-mapping>
	<servlet-mapping>
		<servlet-name>auEngine</servlet-name>
		<url-pattern>/zkau/*</url-pattern>
	</servlet-mapping>

	<session-config>
		<session-timeout>10000</session-timeout>
	</session-config>

	<welcome-file-list>
		<welcome-file>web/index.html</welcome-file>
		<welcome-file>index.jsp</welcome-file>
		<welcome-file>index.zul</welcome-file>
	</welcome-file-list>

</web-app>


thanks

delete flag offensive retag edit

2 Replies

Sort by » oldest newest

answered 2011-10-14 10:46:19 +0800

edutav gravatar image edutav
3

lucasirc, estou com um problema de login com spring security, podemos trocar e-mail?

link publish delete flag offensive edit

answered 2011-10-16 17:39:21 +0800

ashishd gravatar image ashishd flag of Taiwan
1972 6

Hi lucasirc,
can you create a simple sample to recreate this issue? When you submit login.zul page it is posted to spring security login servlet to authenticate the use and on successful authentication spring security redirects to whatever page you have configured (default is "/" hence index.zul). After successful authentication can you load index.zul page manually? As in type <your_domain_name/index.zul in your browser address bar and hit enter.

link publish delete flag offensive edit
Your reply
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow

RSS

Stats

Asked: 2011-01-07 07:35:24 +0800

Seen: 589 times

Last updated: Oct 16 '11

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More