小编fra*_*acz的帖子

背面 - 可见性在Firefox中无法正常工作(在Safari中有效)

我有背面可见性的问题.它在Safari/Chrome中的运行方式非常有用,但由于某些原因它在Firefox中无法正常工作.

当盒子翻转时,我得到了正面的镜像.

css-transitions css-transforms

19
推荐指数
3
解决办法
7917
查看次数

一个域上的ProxyPass和DocumentRoot

假设我有以下配置:

<VirtualHost domain.com>
    # Server names, admins, logs etc...

    ProxyVia On
    ProxyRequests Off
    <Location "/">
        ProxyPass http://localhost:8080/tomcat-webapp/
        ProxyPassReverse http://localhost:8080/tomcat-webapp/
        Order allow,deny
        Allow from all
    </Location>
</VirtualHost>
Run Code Online (Sandbox Code Playgroud)

现在,我希望地址domain.com/forum显示我的MyBB论坛的内容,哪些文件在/var/www/forum目录中.怎么做到这一点?

apache proxypass document-root

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

如何使用私钥对字符串进行签名

我怎样才能使用字符串的签名SHA1withRSA,如果我已经有了私钥byte[]String

java sign digital-signature public-key private-key

17
推荐指数
2
解决办法
3万
查看次数

尝试使用ng-file-upload上传Spring中的许多文件时,清单<MultipartFile>

我有以下控制器方法一次上传多个文件,受此博客文章的启发以及这个问题的答案:

@RequestMapping(value = "/{user}/attachment", method = RequestMethod.POST)
@PreAuthorize(...)
public void upload(@PathVariable User user, 
                   @RequestParam("file") List<MultipartFile> files) {
  // handle files
}
Run Code Online (Sandbox Code Playgroud)

但是,尽管请求包含文件列表,但文件列表始终为空.

如果我将第三个MultipartRequest参数添加到方法:

public void upload(@PathVariable User user, 
                   @RequestParam("file") List<MultipartFile> files,
                   MultipartRequest request)
Run Code Online (Sandbox Code Playgroud)

我可以看到它正确包含我上传的文件:

请求内容

什么可能是空的原因List<MultipartFile>

我正在使用ng-file-upload提交文件,但我不认为它与问题有关.春季4.2.4.

java spring spring-mvc angularjs ng-file-upload

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

如何使用Javascript WebCrypto API加载PKCS#12数字证书

我正在尝试使用WebCrypto API签名数据,但是我不想创建私钥/公钥并将其导出到pkcs#1或8,我真的想使用用户的PKCS#12来签署数据.我已经阅读了W3C规范,但不能做很多,也找不到任何关于如何做到这一点的好材料.现在我想把ActiveX和Java小程序放在一边.有没有办法调整以下内容:

var buffer = encode(prompt("Please enter your password"));
    //TODO:
    //implement a prompt for a pfx or cert

  return crypto.subtle.importKey("raw", buffer, "PBKDF2", false, usages);
    //TODO:
    //instead of importing it, ask for the certificate's pass to sign data
    //with crypto.subtle.sign
Run Code Online (Sandbox Code Playgroud)

有什么指针吗?

更新 这是我一直在工作的代码

<script src="forge.min.js"></script>

<script>
    var errorsReportedByVerifier;
    errorsReportedByVerifier = checkStorage() && checkBrowserAPIs();
    if (!errorsReportedByVerifier){
        console.log("adding click event");
        document.getElementById('btnPfx').addEventListener('click', handlePFXFile, false);
        storeVariables();
        getVariables();
    }


    function handlePFXFile(evnt) {
        console.log("handling pfx")
        //alert(document.getElementById('pfx').value);

        //error happens in 1st line
        //error object does not accept property …
Run Code Online (Sandbox Code Playgroud)

javascript digital-certificate digital-signature webcrypto-api

15
推荐指数
1
解决办法
8620
查看次数

文件下载链接与angulars UI-Router

我正在尝试在angularJS应用程序中创建一个简单的链接到已上载的文件.我没有问题产生链接,因为这是非常微不足道的.然而,我遇到的问题是路由系统我拦截链接并尝试在角度内加载它,当然这会失败并返回默认路由.当然,这并不是我想要的行为.我的链接是使用

<a href="{{doc.url}}">{{doc.name}}</a>
Run Code Online (Sandbox Code Playgroud)

我也试过了

<a ng-href="{{doc.url}}">{{doc.name}}</a>
Run Code Online (Sandbox Code Playgroud)

但显然这不会改变最终的链接.生成的HTML是

<a class="ng-binding" href="/uploads/attachment/file/13/FILENAME.pdf">FILENAME.pdf</a>
Run Code Online (Sandbox Code Playgroud)

哪个是对的.但现在,当我点击链接时,我才会回到默认路线.我该怎么做才能阻止ui-router尝试处理这个链接?

angularjs angularjs-routing angular-ui-router

14
推荐指数
1
解决办法
6276
查看次数

如何从angularjs ng-route中删除hash#

我试图使用locationProvider从角度js中的url路由中删除主题标签,但它给了我错误.

app.js

var eclassApp = angular.module('eclassApp', 
    ['ngRoute', 'eclassControllers', ]
);

eclassApp.config(['$routeProvider','$locationProvider',
    function ($routeProvider, $locationProvider){
        $routeProvider.
            when('/',{
                templateUrl: '/html/student-list.html',
                controller: 'StudentsListCtrl',
            }).
            when('/students/:studentId',{
                templateUrl: '/html/student-details.html',
                controller: 'StudentDetailsCtrl',

            }).otherwise({
                redirectTo: '/students'
            });
            $locationProvider.htmlMode(true);
    }]
);
Run Code Online (Sandbox Code Playgroud)

错误:

 Uncaught Error: [$injector:modulerr] http://errors.angularjs.org/1.3.13/$injector/modulerr?p0=eclassApp&p1=TypeE…oogleapis.com%2Fajax%2Flibs%2Fangularjs%2F1.3.13%2Fangular.min.js%3A17%3A1)
Run Code Online (Sandbox Code Playgroud)

我错过了什么吗?

编辑:用这样的选项对象调用html5Mode函数

$locationProvider.html5Mode({
    enabled:true
})
Run Code Online (Sandbox Code Playgroud)

我得到以下错误(更改为角度已满,以获得更好的错误解释而不是缩小版本)

Error: [$location:nobase] $location in HTML5 mode requires a <base> tag to be present!
Run Code Online (Sandbox Code Playgroud)

http://errors.angularjs.org/1.3.13/$location/nobase

javascript angularjs angular-routing

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

如何使用Spring管理的事务性EntityManager执行自定义SQL查询

我有一个基于Spring的应用程序.我让Spring完成了所有的@Transactional魔法,只要我操作映射到Java对象的实体,一切都运行正常.

但是,当我想在未映射到任何Java实体的表上执行某些自定义作业时,我陷入困境.前段时间,我找到了一个执行自定义查询的解决方案,如下所示:

// em is instance of EntityManager
em.getTransaction().begin();
Statement st = em.unwrap(Connection.class).createStatement();
ResultSet rs = st.executeQuery("SELECT custom FROM my_data");
em.getTransaction().commit();
Run Code Online (Sandbox Code Playgroud)

当我使用@PersistenceContext注释从Spring注入的实体管理器尝试这个时,我收到了几乎明显的异常:

java.lang.IllegalStateException: 
Not allowed to create transaction on shared EntityManager - 
use Spring transactions or EJB CMT instead
Run Code Online (Sandbox Code Playgroud)

我终于设法提取非共享的实体管理器,如下所示:

@Inject
public void myCustomSqlExecutor(EntityManagerFactory emf){
    EntityManager em = emf.createEntityManager();
    // the em.unwrap(...) stuff from above works fine here
}
Run Code Online (Sandbox Code Playgroud)

不过,我发现这种解决方案既不舒适也不优雅.我只是想知道在这个Spring-transactional驱动的环境中是否还有其他方法可以运行自定义SQL查询?

对于那些好奇的人 - 当我尝试在我的应用程序和相关论坛中同时创建用户帐户时出现了这个问题 - 我不希望论坛的用户表被映射到我的任何Java实体.

java spring jpa spring-transactions

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

如何消除错误“'.'” 为 MEAN 堆栈运行“npm install”时,不被识别为内部或外部命令?

从mean.io下载了mean stck zip,几分钟后进行了npm安装,但出现错误。请看截图。我该怎么办?

截屏

npm http 200 https://registry.npmjs.org/event-emitter/-/event-e
mitter-0.2.2.tgz

> mean@1.0.0 postinstall C:\ss\D1\google\04\mean\mean-stack
> ./node_modules/bower/bin/bower install

'.' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! weird error 1
npm ERR! not ok code 0
Run Code Online (Sandbox Code Playgroud)

stack node.js npm express mean-stack

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

通过注释修改代码的coffeelint规则

是否可以添加一些注释来忽略或修改某个块上的coffeeling规则(缩进)?

我在脚本上使用了最多80列的规则,但是我有一些超过该值的objetc的字符串值,并且打破这些行会使代码更糟糕.

例:

##
# @coffeelint ignore max_line_length
##
object:
  attr: "some/huge/line/string/with/embed/#{values}.that/surpasses/the/max/column/width"
Run Code Online (Sandbox Code Playgroud)

lint coffeescript coffeelint

9
推荐指数
1
解决办法
1238
查看次数