BootStrap a label transfer mode frame missing values and solve the problem

Copyright: code word is not easy, please indicate the source ~~ https://blog.csdn.net/m0_37190495/article/details/86167742
Reproduced, please indicate the source:
Original starting in: http://www.zhangruibin.com
article from RebornChang's blog
Bloggers recently in a small function to do the project, encountered a problem, then solve recorded through, if anyone encountered the same problem, would like to see beneficial. First said that under the project infrastructure: the back-end SSM, front-end jQuery + bootStrop. Problem: When a jump tag Bootstrap modal use the block, a front printed label text is correct, but the background portion is received parameter is missing. a label is defined as follows:
<a
                           href="${base}/....../${content.id}?interfaceMonitorStartTime=${query.interfaceMonitorStartTime}&interfaceMonitorEndTime=${query.interfaceMonitorEndTime}"
                           data-toggle="modal" data-backdrop="static" data-target="#myModal">
                       <span class="glyphicon glyphicon-search">查看详情</span>
                   </a>

Type Parameter bloggers want to pass is this:
... InterfaceID = 10001 & STARTIME = 2019-01-01 00:? 00: 00 & endTime = 2019-01-01 23:59:59
background use springMVC receiving link, use @ModelAttribute ( "query") Object query receiving multi-parameter.
Occurs: Since blogger is used to receive reception parameter bean, interfaceId can be received is 10001. But: starTime value of 2019-01-01, endTime is null.
That is, some parameters caused after the jump encapsulated some of the parameters when the missing link by the bootstrap of a jump tag.
Then to analyze the reasons for it:
Possibility 1: link is too long, the latter parameter being intercepted off.
Possibility 2: parameter which contains spaces, the spaces amputated.
Based on the above two kinds of speculation, bloggers began targeted experiments.
Experiment 1: Manual stitching does not contain long strings of spaces jump to a tag, the results can be obtained all of the strings, so that the link should be cut off too long die.
Experiment 2: Two time I want to pass a string of spaces to remove the transmission, after the experiment, the background to successfully obtain parameters.
Conclusion: The use bootStrap of data-toggle = "modal" data -backdrop = "static" data-target = time "# myModal" to the specified parameter field assignment, href a label can not contain spaces, otherwise the parameter space can not be intercepted transmitted, can be specified in the parameter space is removed, or alternatively to special identifier, and the specified data is processed (for example, fill up the space after receiving the parameter condition, or the special identifier to replace spaces).
Throughout all the text, below a few pictures blogger encountered this problem before and after treatment Screenshot:
1: The time you want to convey
Here Insert Picture Description

2: Direct effect of acquisition time passed
Here Insert Picture Description
3: again transmitted after the intermediate time spaces removed string
Here Insert Picture Description4: The time after the treatment reprocessing time format to give the desired
Here Insert Picture Description

Guess you like

Origin blog.csdn.net/m0_37190495/article/details/86167742