Popular Posts

STRUTS action-mapping properties



Action-mappings elements associate a URL with a controller command. The syntax of the value attribute of the nested set-property element: a comma-separated list of storeID : propertyValue

URL: The URL name.

Store ID: The store reference number for this URI or 0 to mean any store.

HTTPS: The value of 1 indicates that the request was expected to be received on a secure channel (HTTPS) and a redirect to the SSL port is done if it is received on an insecure channel (HTTP).

The HTTPS setting for an ajax request does not take effect. The scheme that is used by the parent page takes effect. E.g., AjaxOrderItemAdd(Even if HTTPS setting is there, it goes as HTTP) on a Product display page (HTTP)

E.g.,  In the below example, SampleCmd can be accessed over an in secure channel for any store other than 10161

<action-mappings type="com.ibm.commerce.struts.ECActionMapping">         
<action path="/SampleCmd"  parameter="com.xxx.xxx.xxx.xxx.SampleCmd" type="com.ibm.commerce.struts.BaseAction">
                                        <set-property property="https" value="0:0,10161:1" />
                    </action>
</action-mappings>
 
Authenticate: The value of 1 indicates that user logon is required for this URI. Only non-guest, non-generic users (registered users) are allowed to access pages with Authenticate=1. If the user is requesting the page as an authenticated user, such as a registered user, then the request will continue. If the user is not authenticated, then it redirects the user to LogonForm, where they must authenticate before the initial request continues.

E.g., In the below example, SampleCmd requires user to be logged in for the store 10161
<action-mappings type="com.ibm.commerce.struts.ECActionMapping">
<action path="/SampleCmd"  parameter="com.xxx.xxx.xxx.xxx.SampleCmd" type="com.ibm.commerce.struts.BaseAction">
                                         <set-property property="authenticate" value="10161:1" />
                    </action>
</action-mappings>
 
Credentials Accepted: When the authenticate property is set 1, the request requires an authenticated user, which means partial credentials. Partial credentials are provided when persistent sessions are enabled for a store and the user has selected "Remember Me". This creates a persistent cookie (WC_PERSISTENT) keeping their user ID. Upon return to the store in a new browser session, the detection of the persistent cookie allows WebSphere Commerce to partially authenticate the remembered user. If the authenticate property is set to 1, it requires authentication, but you can add an additional property called "credentialsAccepted". This indicates whether or not partial credentials are accepted. A partially authenticated user is a "Remembered" user.

Setting the value to "P" means partial credentials are accepted. Partially authenticated users are those users that are logged off, but in a remembered user state. That is, when rememberMe is set to true for the Logoff command. Any other value (or the absence of the property means that partial credentials are not accepted. The user must be fully authenticated (or logged in within the browser session) to access a view or command.

E.g.,
<action-mappings type="com.ibm.commerce.struts.ECActionMapping">         
<action path="/SampleCmd"  parameter="com.xxx.xxx.xxx.xxx.SampleCmd" type="com.ibm.commerce.struts.BaseAction">
                           <set-property property="credentialsAccepted" value="10161:P" />
                    </action>
</action-mappings>

2 comments: