[
https://issues.apache.org/jira/browse/VELTOOLS-77?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12473261
]
Nathan Bubna commented on VELTOOLS-77:
--------------------------------------
I have mixed feelings on this. On the one hand, i'm not aware of the Struts
tags stripping markup for users. On the other, i don't use this tool myself
anymore and thus don't feel much inclined to veto features.
How's this for a compromise. Why don't you make a new patch that makes this a
configurable option for the validator tool? That way people can do
<tool>
<name>validator</name>
<class>org.apache.velocity.tools.struts.ValidatorTool</class>
<scope>request</scope>
<parameter name="strip-markup" value="true"/>
</tool>
in the their toolbox.xml if they want the tool to automatically strip out
markup for them.
> Inconsistency between display in javascript and non-javascript error messages
> containing HTML
> ---------------------------------------------------------------------------------------------
>
> Key: VELTOOLS-77
> URL: https://issues.apache.org/jira/browse/VELTOOLS-77
> Project: Velocity Tools
> Issue Type: Bug
> Components: VelocityStruts
> Environment: Struts 1.3.5 / Velocity 1.4 / Velocity Tools 1.2
> Reporter: Christopher Schultz
> Priority: Trivial
> Attachments: VELTOOLS-77.diff
>
>
> When error messages contain HTML markup, the messages are displayed as
> expected by $error.getMsgs(fieldName), but not in javascript messages.
> Easy to demonstrate:
> 1. Start with typical struts/validator/velocity/velocity-tools setup
> 2. Modify stock error message "errors.required" from
> errors.required=The field {0} is required.
> to:
> errors.required=The field <i>{0}</i> is required.
> 3. Induce form rejection (required field) with javascript turned OFF
> Result: Error message is displayed with fieldname in italics.
> 4. Repeat form failure with javascript turned ON
> Result: Error message is displayed in javascript alert with unsightly <i> and
> </i> markup displayed. (Same problem occurs with more likely things such as
> HTML entities (i.e. &)).
> Expected: Markup removed?
> I realize that javascript popups are not generally expected to properly
> render markup. Perhaps error messages put into javascript validation could
> have markup removed. I also realize that this is a non-trivial fix and kind
> of a minefield. ;)
> Feel free to re-categorize this issue as something other than a "bug". I just
> figured that inconsistent behavior (IMO) called for "bug" status. Since I'm
> not offering a solution just yet, I didn't want to categorize it as an
> "improvement".
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]