Override Existing Webscript

cancel
Showing results for 
Search instead for 
Did you mean: 
sanjaybandhniya
Intermediate

Override Existing Webscript

I am trying to override LoginPost.java.

I am following below approach.I am using sdk2 for development.

I have created xxx-context.xml  within /alfresco/extension folder with bean(if this approach is not proper hten let me know proper approach for overriding existing webscript).

 <bean id="webscript.org.alfresco.repository.login.post" class="org.alfresco.repo.web.scripts.bean.LoginPost" parent="webscript">
<property name="authenticationService" ref="AuthenticationService" />
<property name="eventPublisher" ref="eventPublisher" />
</bean> 

It is working fine within sdk but as I am deploying amps to community then its not working.

I have found issue that it is not taking my customized webscript instead it is taking exsiting loginpost.

I have rename the name of my project  jar within alfresco-community\tomcat\webapps\alfresco\WEB-INF\lib\    to aaa.jar then its working means jar file is loaded alphabetical order.

How to solve this issue.

Help will be appreciated.

Jeff Potts

Francesco Corti

Please comment on this.

2 Replies
fcorti
Alfresco Employee

Re: Override Existing Webscript

Hi Sanjay,

Which Alfresco version are you using?
And which version of SDK?

sanjaybandhniya
Intermediate

Re: Override Existing Webscript

I have solve it by doing this way.

/alfresco/extension/custom-web-context.xml

<bean id="webscript.org.alfresco.repository.login.post" class="org.alfresco.repo.web.scripts.bean.CustomLoginPost" parent="webscript">
<property name="authenticationService" ref="AuthenticationService" />
</bean>