struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Christoph Nenning <Christoph.Nenn...@lex-com.net>
Subject Websphere specific config
Date Tue, 10 Sep 2013 12:47:01 GMT
Dear List,


to make struts2 work in Websphere, one has to set Websphere specific 
properties, you may want to add that to the wiki:

https://struts.apache.org/release/2.3.x/docs/websphere.html



The properties are:
com.ibm.ws.webcontainer.assumefiltersuccessonsecurityerror = true
com.ibm.ws.webcontainer.invokefilterscompatibility = true

At least that is necessary when using StrutsPrepareAndExecuteFilter.


In Websphre admin console one has to add those properties here:

Servers > Application servers > {server name} > Web container > Custom 
Properties 



A wsadmin jython script to set those properties could look like this:





def findObjectName(objectId):
        index = objectId.find('(')
        return objectId[0 : index]


node = AdminNodeManagement.listNodes()[0]
server = AdminConfig.list('Server')

nodeName = findObjectName(node)
serverName = findObjectName(server)

webContainer = AdminConfig.list('WebContainer', node)
webContainerDetails = AdminConfig.show(webContainer)

if 
webContainerDetails.find("com.ibm.ws.webcontainer.assumefiltersuccessonsecurityerror") 
== -1:
        print "creating prop: 
com.ibm.ws.webcontainer.assumefiltersuccessonsecurityerror"
        AdminServerManagement.configureCustomProperty(nodeName, 
serverName, "WebContainer", 
"com.ibm.ws.webcontainer.assumefiltersuccessonsecurityerror", "true")
if 
webContainerDetails.find("com.ibm.ws.webcontainer.invokefilterscompatibility") 
== -1:
        print "creating prop: 
com.ibm.ws.webcontainer.invokefilterscompatibility"
        AdminServerManagement.configureCustomProperty(nodeName, 
serverName, "WebContainer", 
"com.ibm.ws.webcontainer.invokefilterscompatibility", "true")




Regards,
Christoph

This Email was scanned by Sophos Anti Virus

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message