Search code examples
javavelocitystruts-1

Struts 1.x : substring 'script' is removed automatically on from submit


I am facing a crazy issue. On form submit if any word contains 'script' (Eg: De'script'ion) then that will b truncated, hence remaining with 'Deion' ('script' removed from 'Description'). Could not find the reason for it.. I am using Velocity Templates for UI and Struts 1.x

Form Bean

<form-bean name="newUserForm" dynamic="true" type="com.test.fe.webapp.form.NewUserForm">
    <form-property name="userId" type="java.lang.String" />
    <form-property name="role" type="java.lang.String" />
    <form-property name="selectedPartnersMultiSelect" type="java.lang.String[]" />
    <form-property name="isExistingUser" type="java.lang.String" />
</form-bean>

Solution

  • Found the root cause for this..

    Our application has applied a Filter to prevent Cross Site Scripting(XSS) attacks, hence this issue was occuring..

    Thanks