Amp is included in struts url tag

In my web application, I use the strust2 url tag to pass parameters like id, etc. For example, I use a link to delete an object, and I use a parameter to pass the identifier of the object to be deleted. And I follow this throughout the web application to add, edit, delete an object.

At runtime, sometimes I cannot get the parameters that will be stored in my bean actions. When I see the link that is generated, I get something like

<a href='/projit1/p/discuss/viewDiscussion.action?d=11&amp;amp;amp;projid=11&amp;amp;disid=4'>

What are these amplifiers for? why do they sit between action calls (made by reference via URL tag actions)? When I go back and forth in my web application, I get 10 and 20 seconds of amplifier sitting in the request URL. What is the problem? Please help.

+3
source share
4 answers

In HTML, XHTML, and XML, certain characters are specially processed. The special characters used most are less (<) and ampersand (&). <is valid only at the beginning of the tag, but is used to encode character objects (special characters, characters that cannot be entered, etc.). Because it is special and cannot be displayed as part of the attribute value, it is encoded as & and although it may seem strange if you do not know why the href value in your question is almost correct. In the same estate, it must be encoded as <to ensure proper browser behavior. Not encoding these characters MAY work, but NOT GUARANTEED to work.

URL- ; , href . & . URL- , amp; - . - URL- , amp; - . , , URL- HTML .

:

<a href='/projit1/p/discuss/viewDiscussion.actiond=11&amp;projid=11&amp;disid=4'>
+1

. , .

includeParams.

+1

, , . :

<s:url id="remoteurlGrid" action="certificationListJSON" includeParams="get">
     <s:param name="population" value="%{getPopulation()}" />
     <s:param name="selectedSalesRepID" value="%{getSelectedSalesRepID()}" />
</s:url>

All I had to do was add “includeParams =“ get. ”It’s strange that it MUST be the default, so why it didn’t work, I don’t know.

Here is the API link: http://struts.apache.org/2.1.6/struts2-core/apidocs/org/apache/struts2/components/URL.html

0
source

Add attribute below URL tag

escapeAmp="false"
0
source

Source: https://habr.com/ru/post/1736421/


All Articles