有没有办法让spring(v.3.0)解析文件中的占位符.properties?我知道我可以写自己的PropertyPlaceholderConfigurer但我正在寻找一种"更清洁"的方式来做到这一点.
编辑:
更具体地说,我实际想要做的是替换.sql文件中的占位符.因此占位符的值存储在其中,.properties但占位符用于.sql文件中.
基本上我每个都有2个带有'小部件'的列表,其中一些可能非常大.我已将所有代码简化为此.这是javascript
<script type="text/javascript">
$(function() {
$(".homepage-right" ).sortable({
revert: 200,
connectWith:["#homepage-left","#homepage-right"],
placeholder: "homepage-element-placeholder",
cancel: ".homepage-disable-drag",
opacity:0.7,
distance:30,
handle:".box-title",
start: function (event,ui) {
height = $(ui.item).outerHeight();
left_height = $("#homepage-right").height();
$("#homepage-left").attr(\'height\',(height+left_height)+\'px\');
$(".homepage-left" ).css(\'padding-bottom\',height*2);
$(".homepage-element-placeholder").css(\'height\',height);
},
receive: function(event,ui) {
homepage_reload_node(event,ui,2);
},
stop: function(event,ui) {
homepage_save_layout();
$(".homepage-left" ).css(\'padding-bottom\',\'0px\');
$(".homepage-right" ).css(\'padding-bottom\',\'0px\');
}
});
$(".homepage-left" ).sortable({
revert: 200,
connectWith:["#homepage-left","#homepage-right"],
placeholder: "homepage-element-placeholder",
cancel: ".homepage-disable-drag",
opacity:0.7,
handle:".box-title",
start: function (event,ui) {
height = $(ui.item).outerHeight();
left_height = $("#homepage-right").height();
$("#homepage-right").attr(\'height\',(height+left_height)+\'px\');
$(".homepage-right" ).css(\'padding-bottom\',height*2);
$(".homepage-element-placeholder").css(\'height\',height);
},
receive: function(event,ui) {
homepage_reload_node(event,ui,1);
},
stop: function(event,ui) …Run Code Online (Sandbox Code Playgroud) 不知道如何在jsFiddle中重现这个,但我会尽力解释这个问题.
我们将购买的字体导入CSS:
@font-face {
font-family: 'ForoItalicRegular';
src: url('../Fonts/foro_italic/ForoIta-webfont.eot');
src: url('../Fonts/foro_italic/ForoIta-webfont.eot?#iefix') format('embedded-opentype'),
url('../Fonts/foro_italic/ForoIta-webfont.woff') format('woff'),
url('../Fonts/foro_italic/ForoIta-webfont.ttf') format('truetype'),
url('../Fonts/foro_italic/ForoIta-webfont.svg#Foro-ItalicRegular') format('svg');
font-weight: normal;
font-style: normal;
}
Run Code Online (Sandbox Code Playgroud)
然后我们将该字体应用于具有占位符属性的输入标记:
.m_hdr_glb_search input { width:230px; margin:0; padding:13px 0px 12px 5px; text-overflow:ellipsis; background:transparent; color:#221b33; font-size:0.750em; font-family:ForoItalicRegular,Georgia,serif; border:none; }
Run Code Online (Sandbox Code Playgroud)
我们的网站支持法语,因此当法语重音字符被引入占位符时,问题文本会显示出来:
<input type="text" placeholder="Quartier, ville ou numéro">
Run Code Online (Sandbox Code Playgroud)
结果如下:

经过仔细的检查和一些测试后,我发现"numero"这个词的重音"e"正在从字体堆栈降级到格鲁吉亚.
我能想到的唯一原因是重音字符在该大小中不可用,但经过更多测试后情况并非如此.我可以将导入的字体调整为其他标签中的任何大小(即 - div,p,span等),重音字符不会降级为格鲁吉亚.
它只发生在输入标记的占位符属性中.我能够在所有主流浏览器中重现.
这是对占位符属性的实施的疏忽吗?
好的,我有一个输入标签.我使用了jquery输入提示,因此它显示了title ="password".但是,如果它的类型是密码,它将不会显示它只是看起来*的标题.所以我需要将输入设置为"text"类型,然后将其更改为在焦点上键入:"password",并在焦点失焦时返回文本.我如何用jquery做到这一点?
<input name="pwd" type="text" class="pwd" value="" title="Password"/>
// look like below on focus and back to text on focus out
<input name="pwd" type="password" class="pwd" value="" title="Password"/>
Run Code Online (Sandbox Code Playgroud) 此代码提交了一个表单,并且可以正常工作,但更改textarea的占位符除外 id=message
$('#submit').click(function(){
$.post("mail.php", $("#contact").serialize(), function(response) {
$('#message').attr('placeholder', response);
$('#success').html(response);
});
});
Run Code Online (Sandbox Code Playgroud)
Firebug中没有错误。
我正在尝试在我的占位符中为登录页面添加一个字体很棒的图标.这就是我到目前为止所拥有的.我无法弄清楚如何获得字体真棒图标内的文本(如占位符)
@Html.TextBoxFor(m => m.UserName, new { @class = "form-control login-input", placeholder = "Username or Email"})
Run Code Online (Sandbox Code Playgroud)
我找到了如何在这里添加占位符的问题,而不是如何添加图标.
谢谢!
在Bootstrap 3.2.2中有声明:
.form-control:-ms-input-placeholder {
color: #999;
}
Run Code Online (Sandbox Code Playgroud)
IE 11.0.17(可能还有其他版本)无法正确呈现,占位符仍为黑色.
css internet-explorer placeholder html-rendering twitter-bootstrap
有没有像一个ng-placeholder或类似的东西?
我想放一个默认的占位符Risk,即输入是一个计算输入,有时计算最后2秒,所以我想删除那个Risk占位符并将一个loader/spinner放在那里.这就是我的方式
<div>
<div>
<span ng-show="betLoader"><div class="spinner"></div></span>
<div ng-show="!betLoader">Win</div>
</div>
<input placeholder="Risk"
ng-model="parlayData.win">
</div>
Run Code Online (Sandbox Code Playgroud)
我有一个$scope变量betLoader,当它是true加载器/微调器出现时,当它是假的时,出现div单词Win.我想做同样但不在那里,我想在输入中使用占位符Risk,当betLoader为真时,然后隐藏Risk单词.
你有什么建议?
编辑
考虑到微调器div与类同在spinner.所以,我需要将该微调器放在输入中.
我试图在<p>标签中添加占位符,我尝试了以下方式,但dint工作.
我需要在<p>标记中使用占位符,它应该替换为输入文本中的值.
$( "#incharge" )
.keyup(function() {
var value = $( this ).val();
$( "p#incharge" ).text( value );
})
.keyup();Run Code Online (Sandbox Code Playgroud)
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<input type="text" placeholder="The manager in charge name" data-toggle="tooltip" data-placement="right" id="incharge" name="incharge" title="Provide The manager in charge name">
<br>
<br>
<p id="incharge" placeholder="Some Placeholder text comes here"></p>Run Code Online (Sandbox Code Playgroud)
我正在将angular6与angular材料一起使用来创建这个简洁的网站。
我正在使用mat-form-fieldwith,mat-input因此显示带有文本的文本输入元素placeholder。
占位符文本位置具有两种状态。
一!当文本输入为空并且您没有专注于该元素时:
当您专注于输入文本和/或输入文本不为空时,另一个
我希望mat-input元素处于第二状态。在文本输入元素上方显示占位符,即使其中没有文本并且我也不关注该元素。
我知道我可以解决这个问题,并为元素的值添加某种空白空间。但是,有没有更优雅的方法来实现我所需要的?
谢谢!!!
placeholder ×10
jquery ×4
html ×3
css ×2
javascript ×2
angular ×1
angularjs ×1
asp.net ×1
asp.net-mvc ×1
attr ×1
font-awesome ×1
font-face ×1
forms ×1
html5 ×1
input ×1
java ×1
list ×1
mat-input ×1
passwords ×1
properties ×1
spring ×1
textarea ×1
widget ×1