Pregunta

I have links in the project, with render with spaces: href="/plugins/configure/Poulpe Auth Plugin" - this is an example from page source.

Of course browser encodes spaces as %20 before send it to server, but I have an error in W3C validator:

 Bad value /plugins/configure/Poulpe Auth Plugin for attribute href on element a: Whitespace in path component. Use %20 in place of spaces.

As I saw in other resources, in similar situations spaces were replaced with '-', '+' or '_'. I'm not sure I can rewrite spaces in data before saving to db, so should I handle them before set parameters to request? Could somebody please explain me where should I handle query parameters spaces before display them in urls?

¿Fue útil?

Solución

I've found the decision:

<a href="<spring:url value="${pageContext.request.contextPath}/plugins/configure/{pluginName}">
                                <spring:param name="pluginName" value="${plugin.name}" />
                            </spring:url>"
                                 title="<spring:message code='label.plugins.plugin.configure.hint'/>">
                                <spring:message code="label.plugins.plugin.configure"/>
                            </a>

And I've got:

<a href="/plugins/configure/Poulpe%20Auth%20Plugin" data-original-title="Press to configure this plugin">Configure</a>
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top