奔跑的猿
sunjing · 共 76 篇文章
JSF应对Cross-Site Request Forgery (CSRF)攻击
JSF 2.x has already builtin CSRF prevention in flavor of javax.faces.ViewState hidden field in the form when using server side state saving. In JSF 1.x this value was namely pretty weak and too easy predictable (it was actually never intended as CSRF prevention). In JSF 2.0 this has been improved b…
2017-09-05 09:49 · JSF · 评论(0)
JBoss EAP 6常见问题
1. Jboss EAP 6 配置 URI_ENCODING In order to set UTF-8 for URI encoding you have to edit the JBOSS_HOME/standalone/configuration/standalone.xml file and add a system property named org.apache.catalina.connector.URI_ENCODING,(with value set to UTF-8) to the system-properties element. Below is the code…
2017-06-07 22:47 · Jboss · 评论(0)
Jboss EAP 6 JAX-WS和JMS超时设置
1. WS Client Timeout 在Jboss EAP 6中调用web service,发生以下错误: Invoke has thrown exception, unwinding now: org.apache.cxf.interceptor.Fault: Could not send Message java.net.SocketTimeoutException: Read timed out 调用WS有两个超时参数: ConnectionTimeout Specifies the amount of time, in milliseconds, that the client …
2017-05-10 11:02 · Jboss · 评论(0)
Maven文件重命名
最近一直在做老系统的升级项目,其中不同环境的配置文件使用了不同的名字,那怎样利用Maven重命名文件呢?可以使用copy-rename-maven-plugin插件,如下: <build> <resources> <resource> <directory>src/main/resources</directory> <excludes> <exclude>config.properties</exclude> </excludes> </resource> </resources> <plugins> <plugin> <groupId>com.coderplus.maven.plugin…
2017-05-07 14:09 · Maven · 评论(0)
Jboss EAP 6 EJB调用常见问题
1. 调用EJB的三种方法 调用EAP 6 EJB的第一种方法,使用JBoss API,如下: Properties p = new Properties(); p.put("remote.connectionprovider.create.options.org.xnio.Options.SSL_ENABLED", "false"); p.put("remote.connections", "default"); p.put("remote.connection.default.host", "localhost"); p.put("remote.connection.default.po…
2017-03-13 17:59 · Jboss · 评论(0)
常用协议端口号
SSH 22 SMTP 25 DNS(UDP) 53 DNS(TCP) 53 HTTP 80 POP3 110 IMAP 143 LDAP 389 HTTPS 443 SMTPS 465 IMAPS 993 POP3S 995 MS SQL 1433 NFS 2049 MySQL 3306 RDP 3389 RedShift 5439 PostgreSQL 5432 Oracle 1521
2017-02-24 22:12 · Protocol · 评论(0)
Linux zip小知识
1. zip如何排除文件夹 zip -r jason.zip jason/* -x jason/backports-4.4.2-1/\* 以上命令打包jason文件夹,排除其中的backports-4.4.2-1文件夹 如果改成这样: zip -r jason.zip jason/* -x jason/backports-4.4.2-1\* 会排除其中以backports-4.4.2-1开头的文件和文件夹,比如jason下还有文件backports-4.4.2-1.tar.gz,也会被排除。 那这样呢? zip -r jason.zip jason/* -x jason/backports-…
2016-11-11 11:17 · Linux · 评论(0)
Maven打包后为何文件大小改变了
项目中使用了X.509证书,用Maven打包后,测试时报错: java.security.cert.CertificateException: Could not parse certificate: java.io.IOException: Invalid BER/DER data (too huge?) 查找了好一会儿原因,才发现证书文件确实变huge了。这是怎么导致的呢,因为resource使用了filter, maven更改了文件内容,解决方法如下: <plugin> <artifactId>maven-resources-plugin</artifactId> <configura…
2016-10-28 17:39 · Maven · 评论(0)
No EJB receiver available for handling ...
No EJB receiver available for handling ... 在Jboss EAP 6中,调用远程EJB时出现这个错误, 原因可能是JNDI格式写错了。EJB JNDI的格式如下: ejb:<appName>/<moduleName>/<distinctName>/<beanName>!<viewClassName>?stateful 注意appName前是没有"/"的!如没有distinctName,留空,即连续两个”//“。 在jboss-eap-quickstarts-6.4.0.GA提供了样例代码ejb-remote: public interface Rem…
2016-07-02 17:25 · Jboss · 评论(0)
Jboss AS 5/6升级时遇到的问题
1. Jboss AS 6使用jdk7时的异常处理 异常信息为: org.jboss.wsf.stack.cxf.deployment.jms.JMSDescriptorProcessorImpl cannot be cast to org.jboss.wsf.spi.metadata.webservices.WebservicesDescriptorProcessor 解决方法: made a change in JBOSS_HOME/server/<node>/deployers/jbossws.deployer/META-INF/stack-agnostic-jboss-beans.x…
2016-07-02 16:36 · Jboss · 评论(0)
在Jboss EAP 6/Wildfly中使用Hibernate 3和JSF 1.2
在EAP 6中使用JSF1.2 增加jboss-deployment-structure.xml文件,其内容如下: <jboss-deployment-structure> <deployment> <exclusions> <module name="javax.faces.api"/> <module name="com.sun.jsf-impl"/> </exclusions> <dependencies> <module name="javax.faces.api" slot="1.2" export="true"/> <module name="com.sun.jsf-impl" …
2016-04-28 15:39 · Jboss · 评论(0)
JDK 8 静默安装
相信不少朋友遇到过,安装JDK 8 时,运行安装程序后没有任何反应,没有显示安装界面。检查任务管理器,发现是有两个JDK安装进程的: 那安装程序在运行么?实际上安装程序在正常执行,当进程结束后,你会发现JDK已经安装好啦。 原来JDK 8 支持静默安装。安装配置文件位于C:\ProgramData\Oracle\Java\java.settings.cfg,其中有一项: INSTALL_SILENT=1 将其改为0就可以显示安装界面了。 更多安装参数请参考: Installing With a Configuration File
2016-03-25 10:05 · Java · 评论(0)
Connection Refused
There could be many reasons, but the most common are: The port is not open on the destination machine. The port is open on the destination machine, but its backlog of pending connections is full. A firewall between the client and server is blocking access (also check local firewalls). IP address co…
2016-01-21 10:26 · Linux · 评论(0)
FTP FTPS和SFTP
一、协议知识 FTP FTP (File Transfer Protocol, RFC 959 )是TCP/IP网络上用于文件传输的标准协议,基于C/S架构,可以上传、下载、删除文件,创建或改变服务器上的目录。在客户端和服务器间要建立分离的控制和数据连接,控制连接用于Session管理,如交换命令和回复、交换用户标识和密码等,数据连接用于传输数据。FTP使用明文登录协议验证用户名和密码,如果服务器允许也可以匿名连接。 FTP有两种传输模式:主动和被动。主动模式时,客户端创建到服务器的TCP控制连接,发送客户端IP地址和随机的端口号,然后等待服务器初始化数据连接。这种情况下,如果客户端有防火墙…
2016-01-20 13:02 · Protocol · 评论(0)
JavaScript常见兼容性问题
1. window.frames Returns the window itself, which is an array-like object, listing the direct sub-frames of the current window. window.frames[0] is the same thing as document.getElementsByTagName("iframe")[0].contentWindow 2. window.event 在老版本IE或兼容模式中支持,可将方法的第一个参数设为event,如 function click(event) { v…
2016-01-06 17:31 · Javascript · 评论(0)