小编Ale*_*lex的帖子

JBoss缓存类文件吗?

我正在努力解决一个奇怪的问题:当我在localhost JBoss实例中对POJO或Seam组件进行更改时,重新启动它并加载页面,可以看到更改.但是,在我们的服务器上运行相同版本的JBoss,当我停止实例,删除WAR文件,上传最新版本并重新启动JBoss时,它不会显示一些新的服务器端功能.

具体来说,更改是一个POJO类,它实现了javax.faces.validator.Validator类.然后在XHTML Facelet中使用它,如下所示:

<h:inputText value="#{outsideaccount.accountOrganizationEmail}" maxlength="50"
  id="txtOrganizationSupportEmail" 
  validatorMessage="Organization Support Email is not valid. It must be in the pattern 'some_id@some_domain.com'.">
  <f:validator validatorId="AnyEmailValidator"/>
</h:inputText>  
Run Code Online (Sandbox Code Playgroud)

我可以正确使用我的localhost JBoss上的电子邮件验证程序; 在开发服务器上,它在同一页面上使用相同的电子邮件抛出验证错误.很奇怪.JBoss是否在某处缓存了类文件?如何清除JBoss开发服务器缓存中的所有内容?

我在本地使用Win XP Pro; 开发服务器在JVM版本1.5.0_16-b02上使用JBoss 4.2.3.GA,使用Unix SunOS 5.10.谢谢.

java jsf jboss caching pojo

5
推荐指数
1
解决办法
1万
查看次数

HTML5流媒体视频 - 有可能吗?

是否可以使用HTML5的视频标签并将其连接到RMTP流?谢谢.

video html5

5
推荐指数
1
解决办法
996
查看次数

有 PHP HTML 标签库吗?

是否有用于做服务器端 HTML 标签的 PHP HTML 标签库?Java 和 ASP.NET 有这些,但它们是编译语言而不是脚本语言。例如,在 ASP.NET 中,您可以使用以下命令定义文本框控件:

<asp:TextBox />
Run Code Online (Sandbox Code Playgroud)

您可以在服务器端引用它并分配属性等。不确定 PHP 是否存在这种功能。谢谢。

html php tags

5
推荐指数
1
解决办法
2373
查看次数

Bootstrap Carousel - 如何缓慢地在幻灯片之间淡入淡出

我正在使用最新的Bootstrap Carousel,需要在幻灯片之间缓慢(大约5s)褪色.我已经看了一些例子,并试图实现这个一个.问题是幻灯片之间的淡入淡出太快(不到一秒钟).如何将其更改为更长的淡入淡出?

这是我的代码:

<div class="carousel slide" id="slideshow-carousel-1" data-ride="carousel">
    <div class="carousel-inner" role="listbox">
        <!-- Slide 1 -->
        <div class="item item-1 slide-image active">
            <img class="img-responsive bg-item parallax" data-speed="1" data-width="1980" data-height="1485" src="~/images/slideshow/bottle1.png" alt="Slide 1 Background">
            <div class="carousel-caption">
                <h1 class="title">Caption 1</h1>
            </div>
        </div>
        <!-- End Slide 1 -->

        <!-- Slide 2 -->
        <div class="item item-2 slide-image">
            <img class="img-responsive bg-item parallax" data-speed="1" data-width="1980" data-height="1485" src="~/images/slideshow/bottle2.jpg" alt="Slide 2 Background">
            <div class="carousel-caption">
                <h1 class="title">Or Bottle!</h1>
            </div>
        </div>
        <!-- End Slide 2 -->
    </div>
</div>
Run Code Online (Sandbox Code Playgroud)

这是CSS:

.carousel-inner …
Run Code Online (Sandbox Code Playgroud)

css3 twitter-bootstrap

5
推荐指数
1
解决办法
3万
查看次数

Bootstrap - 将DIV与顶部,中间和底部对齐

我需要在容器DIV中有三个DIV,所有DIV都水平居中.第一个需要与容器的垂直顶部对齐,第二个与垂直中心对齐,第三个与垂直底部对齐.这是垂直定位div 的答案,但不解决其他项目.这里有另一个答案,但是你如何添加需要垂直对齐顶部和底部的DIV?

这是HTML:

<div class="carousel-caption"> <!-- outer container; all items horizontally centered -->
    <div class="row align-top"> <!-- align this DIV to top -->
        <h1 class="col-sm-12">Top DIV</h1>
    </div>
    <div class="row align-vertical-center"> <!-- align this DIV to center -->
        <div class="col-sm-12 ">Middle DIV</div>
    </div>
    <div class="row align-vertical-bottom">
        <div class="align-vertical-bottom">Bottom DIV</div>
    </div>
</div>
Run Code Online (Sandbox Code Playgroud)

html css twitter-bootstrap twitter-bootstrap-3

5
推荐指数
1
解决办法
2万
查看次数

iOS Safari - 将焦点放在窗口上

我有这个jsFiddle,它有一个简单div的 jQuery 点击处理程序:

<div class="testDiv" 
   data-target="http://www.stackoverflow.com" 
   data-open="false">
</div>

$(document).ready(function(){
    var newWindow;
    $('.testDiv').on('click', function(e){
        var target = $(this).data('target');
        var open = $(this).data('open');

        if (!open){
            $(this).data('open','true');
            newWindow = window.open(target);
        }
        else {
            if (newWindow.closed){
                newWindow = window.open(target);
            }
            newWindow.focus();
        }
    });
})
Run Code Online (Sandbox Code Playgroud)

上的点击处理程序 div旨在打开一个尚未打开的新窗口;如果它是打开的,它会给那个窗口焦点。这在 Win 7 x64 上的 Chrome 中运行良好,但在 iOS 8.3 的 Safari(在 iPhone 6 上)上,一旦窗口打开,单击div不会将焦点切换到打开的窗口。您必须关闭窗口并再次打开它才能获得焦点。

这个 iOS Safari 焦点问题的任何解决方案?

html javascript jquery mobile-safari ios

5
推荐指数
1
解决办法
1139
查看次数

MVVM WPF中的ReportViewer

我正在使用Visual Studio 2015构建MVVM Light WPF应用程序。该应用程序需要在本地显示一些SQL Server Reporting Services报告。

存在以下两种解决方案:

尽管第一个是MVVM,但它将UI与视图模型混合在一起。第二个是纯代码隐藏的。

以下是第一个示例的建议:

WindowsFormsHost windowsFormsHost = new WindowsFormsHost();
reportViewer = new ReportViewer();
windowsFormsHost.Child = reportViewer;
this.Viewer = windowsFormsHost
Run Code Online (Sandbox Code Playgroud)

请注意,这ReportViewer是一个UI控件。第二种解决方案使用一个代码隐藏文件:

private void ReportViewer_Load(object sender, EventArgs e)
{
   //...
}
Run Code Online (Sandbox Code Playgroud)

有没有办法将本地SSRS报告嵌入到WPF应用程序中并遵循良好的MVVM做法?谢谢。

更新:不必狂热!如果需要一些代码隐藏,我可以接受。

c# wpf xaml mvvm reporting-services

5
推荐指数
1
解决办法
1818
查看次数

WebSocket Windows服务侦听端口8080

我是Windows服务开发的新手,需要在C#中构建一个将在端口上侦听8080数据的数据,然后解析它.我发现有关的信息System.Net.WebSockets,System.Net.Sockets以及第三方库,如SuperSocket.有这个例子,但不确定我的Windows服务类的方法OnStart()和内容是什么OnStop().另一个例子是在这里,但是这也不能覆盖Windows服务明确.对于基本的Windows服务开发,有这篇MSDN文章.

我在想这个OnStart():

Socket serverSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.IP);
serverSocket.Bind(new IPEndPoint(IPAddress.Any, 8080));
serverSocket.Listen(128);
serverSocket.BeginAccept(null, 0, OnAccept, null);
Run Code Online (Sandbox Code Playgroud)

我会把什么投入OnStop()?

进入的数据流不需要任何身份验证.我还需要握手吗?

非常感谢您的帮助.

c# sockets windows-services websocket

5
推荐指数
1
解决办法
827
查看次数

在部分视图中使用AJAX的ASP.NET MVC PagedList

我正在使用Visual Studio 2015构建一个ASP.NET MVC 5应用程序.搜索在第一次尝试时工作正常,但是如果我单击MVC PagedList组件中的任何页码,它会抛出一个Internal Server Error.这是AJAX表单; 请注意,它将从搜索中收到的数据传递到部分视图:

@using (Ajax.BeginForm("SearchCustomers", "Permits",
new AjaxOptions
{
    UpdateTargetId = "targetElement",
    OnSuccess = "onAjaxSuccess",
    OnFailure = "onAjaxFailure"
},
new { @class = "form-horizontal form-small", role = "form", id="customerSearchForm" }))
{
    @Html.AntiForgeryToken()
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h4>Customer Search</h4>
    </div>
    <div class="modal-body">
        @Html.ValidationSummary(true, "", new { @class = "text-danger" })
        <div class="form-group-sm clearfix">
            @Html.LabelFor(m => m.SearchVm.SearchCustomerNameNumber, new { @class = "control-label col-xs-5 col-md-5" })
            <div class="col-xs-5 col-md-5">
                <div class="input-group"> …
Run Code Online (Sandbox Code Playgroud)

c# asp.net ajax asp.net-mvc jquery

5
推荐指数
1
解决办法
4063
查看次数

防止通过 AddClaimAsync 添加重复声明

我们在 MVC 5 应用程序中使用 ASP.NET Identity。我们有一个页面,允许管理员添加用户及其声明。但是,使用以下几行,我可以继续添加具有相同角色声明的用户,从而创建重复的项目(该AspNetUserClaims表有一个主键“自动编号”列,因此我们可以继续向同一用户添加相同的角色):

var userManager = HttpContext.GetOwinContext().GetUserManager<ApplicationUserManager>();
await userManager.AddClaimAsync("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
    new Claim(ClaimTypes.Role, "SomeRole"));
Run Code Online (Sandbox Code Playgroud)

请注意,我添加的是任意用户的声明,而不是登录用户的声明。如果是登录用户,我可以简单地调用User.IsInRole("SomeRole"). 是xxxx用户的 GUID。

在这种情况下,我正在考虑在添加角色之前使用以下数据库调用进行检查:

public static async Task<bool> UserHasClaim(string userId, 
    string claimType, string claimValue)
{
    using (var db = new MyEntities())
    {
        return await db.AspNetUserClaims
            .AnyAsync(x => x.UserId == userId && x.ClaimType == 
                  claimType && x.ClaimValue == claimValue);
    }
}
Run Code Online (Sandbox Code Playgroud)

有一个更好的方法吗?我知道它ClaimsPrincipal包含一个方法.HasClaim(...),但我不知道如何ClaimsPrincipal从该用户创建一个方法,然后运行该方法。谢谢。

c# asp.net authentication asp.net-mvc claims-based-identity

5
推荐指数
0
解决办法
1500
查看次数