You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@struts.apache.org by "upendar (JIRA)" <ji...@apache.org> on 2017/03/25 16:30:41 UTC

[jira] [Comment Edited] (WW-4774) Upgrding Struts 2.3.1 to 2.5.10.1 - Redirect issues HTTPS to HTTP

    [ https://issues.apache.org/jira/browse/WW-4774?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15941782#comment-15941782 ] 

upendar edited comment on WW-4774 at 3/25/17 4:30 PM:
------------------------------------------------------

Thank You for looking into the issue. 

 1. Logged in the the application built on struts 2 version 2.5.10.1
 2. it takes to dashboard page (main page)
 3. click on add user Button on the main page and then it prompts up popup window to input new user details to be created.
 4. click on submit button on the popup. The request is sent to rest api (running on other instance) and user is persisted in DB successfully then  popup gets closed and redirect to main dashboard page to show newly created user details . But the popup still remain showing up and not getting closed  even though the new user is created successfully
 5. Errors on chrome and IE developers tool. (Mixed content and  CORS)
6. We dont see any issues with struts 2.3.1. 

below code snippet will help you . The remote url is https 

@SuppressWarnings("serial")
@Namespace("/account")
@Results({
	@Result(name = Views.DASHBOARD, location = "/account/dashboard.tiles", type = TILES),
	@Result(name = Views.DASHBOARD_REDIRECT, location = "/account/viewdashboard", type = REDIRECT),
	@Result(name = Views.UPDATE_REDIRECT, location = "/account/updateForm", type = REDIRECT),
	@Result(name = Views.CREATE, location = "/account/create.tiles", type = Views.Types.TILES),
	@Result(name = Views.UPDATE, location = "/account/edit.tiles", type = Views.Types.TILES),
	@Result(name = Views.CREATE_USER, location = "/user/createUser.tiles", type = Views.Types.TILES)
})
public class AccountXXX extends AuthXXXome {

@Action("create")
	public String create() {
		try {
			account = restAPI.getUserCreation().create(targetAccount);
			accountId = account.getId();
			addActionMessage(getText("account.create.success"));

			return Views.DASHBOARD_REDIRECT;
		} catch (final RuntimeException e) {
			processException(e);
			return Views.CREATE;
		}
	}
}	
	





was (Author: devulapalli):
Thank You for looking into the issue. 

 1. Logged in the the application built on struts 2 version 2.5.10.1
 2. it takes to dashboard page (main page)
 3. click on add user Button on the main page and then it prompts up popup window to input new user details to be created.
 4. click on submit button on the popup. The request is sent to rest api (running on other instance) and user is persisted in DB successfully then  popup gets closed and redirect to main dashboard page to show newly created user details . But the popup still remain showing up and not getting closed  even though the new user is created successfully
 5. Errors on chrome and IE developers tool. (Mixed content and  CORS)
6. We dont see any issues with struts 2.3.1. 

below code snippet will help you . The remote url is https 

@SuppressWarnings("serial")
@Namespace("/account")
@Results({
	@Result(name = Views.DASHBOARD, location = "/account/dashboard.tiles", type = TILES),
	@Result(name = Views.DASHBOARD_REDIRECT, location = "/account/viewdashboard", type = REDIRECT),
	@Result(name = Views.UPDATE_REDIRECT, location = "/account/updateForm", type = REDIRECT),
	@Result(name = Views.CREATE, location = "/account/create.tiles", type = Views.Types.TILES),
	@Result(name = Views.UPDATE, location = "/account/edit.tiles", type = Views.Types.TILES),
	@Result(name = Views.CREATE_USER, location = "/user/createUser.tiles", type = Views.Types.TILES)
})
public class AccountHome extends BaseAuthenticatedHome {

@Action("create")
	public String create() {
		try {
			account = restAPI.getUserCreation().create(targetAccount);
			accountId = account.getId();
			addActionMessage(getText("account.create.success"));

			return Views.DASHBOARD_REDIRECT;
		} catch (final RuntimeException e) {
			processException(e);
			return Views.CREATE;
		}
	}
}	
	




> Upgrding Struts 2.3.1 to 2.5.10.1 - Redirect issues  HTTPS to HTTP
> ------------------------------------------------------------------
>
>                 Key: WW-4774
>                 URL: https://issues.apache.org/jira/browse/WW-4774
>             Project: Struts 2
>          Issue Type: Bug
>            Reporter: upendar
>            Priority: Critical
>
> We are upgrading Struts2 from 2.3.1 to 2.5.10.1 ; redirect  making https:// to http:// . The following errors in chrome and IE are seen while redirecting  from the popup to main window
> redirecting  popup (create user) --- main window (viewdashboard)  - the URL shows https:// to http://
> We are blocked completely due to this issue and need support ASAP. We also reviewed the apache server configurations and looks good. Please share the fix in detail.
> Error Issue in chrome :
> Mixed Content: The page at 'https://XXXXX/XX/XX/viewdashboard?clear&Id=1&uar=44' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://XXX/XX/XX/viewdashboard?uar=44&Id=1'. This request has been blocked; the content must be served over HTTPS.
> Issue in IE
> SEC7127: Redirect was blocked for CORS request.
> File: account
> SCRIPT7002: XMLHttpRequest: Network Error 0x2ef1, Could not complete the operation due to error 00002ef1.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)