struts-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vijay Srivastava (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (WW-4847) request parameter are not converted to object in action class
Date Thu, 31 Aug 2017 13:46:00 GMT

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

Vijay Srivastava commented on WW-4847:
--------------------------------------

FujiLoginRequest is POJO 

public class FujiLoginRequest extends CloudRequest{

	private List<String> repositoryPath = new ArrayList<String>();
	
	public void setRepositoryPath(List<String> repositoryPath) {
		this.repositoryPath = repositoryPath;
	}
	
	public List<String> getRepositoryPath() {
		return repositoryPath;
	}
	
	
}

Btw, As I mentioned seems like "request" is a reserved in struts2. I changed the variable
in action class fujiRequest and passed the parameters as below then it worked.

 /vzCloud/fuji/fujiLogin.action?*fujiRequest*.repositoryPath[0]=VZWEB:/VZMOBILE/1.jpg

> request parameter are not converted to object in action class
> -------------------------------------------------------------
>
>                 Key: WW-4847
>                 URL: https://issues.apache.org/jira/browse/WW-4847
>             Project: Struts 2
>          Issue Type: Bug
>          Components: Core, Core Actions
>    Affects Versions: 2.5.12
>            Reporter: Vijay Srivastava
>            Priority: Blocker
>
> hi, 
> We are migrating to struts 2.5.12 and 
> we have a request URLs similar to /vzCloud/fuji/fujiLogin.action?request.repositoryPath[0]=VZWEB:/VZMOBILE/1.jpg
 this has a request param request.repositoryPath[0]=VZWEB:/VZMOBILE/1.jpg I am expecting that
the setRequest method will be called to set the request object in the action class. However
I am seeing that the request object is null. Can you please advise.
> ---Action class--------------
> public class FujiLoginAction extends BaseAction implements  InitializingBean, RequestAware{
> 	private String redirectURL ;
> 	
> 	private FujiIntegrationDelegate delegate;
> 	
> 	private FujiLoginResponse fujiLoginResponse ;
> 	
> 	private FujiLoginRequest request ;
> 	public void setRequest(FujiLoginRequest request) {
> 		this.request = request;
> 	}
> }
> ------------------------------struts config
> <struts>
> 	<package name="fuji" namespace="/fuji" extends="cloud, json-default">
> 		<action name="fujiLogin" method="authenticate" class="fujiLoginAction">
> 			<interceptor-ref name="cloudStack" />
> 			<result name="success" type="json">
> 					<param name="contentType">application/json</param>
> 			 		<param name="noCache">true</param>
> 			 		<param name="excludeProperties">errorCode,messageCode,processTime,bulkStatus</param>
> 					<param name="excludeNullProperties">true</param>
> 					<param name="root">fujiLoginResponse</param> 
> 		            <param name="location">/cloud/json/customJson.jsp</param>
> 			</result>
> 		</action>
> 		
>   	</package>
> </struts>
> Thanks



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message