在JUnit测试用例中实际使用'fail'是什么?
我正在使用JSF 2.0,我正在寻找一个在性能方面负载最小的copmponent库.如果我在RichFaces和PrimeFaces之间做出选择,哪一个更好用?两者的优点和缺点是什么?
我想要正则表达式模式允许我任何字符,但它不能允许(0-9)数字?
我试图在struts 2中创建一个小型登录应用程序.我的web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="WebApp_ID" version="2.5">
<display-name>StrutsPrj</display-name>
<filter>
<filter-name>struts2</filter-name>
<filter-class>
org.apache.struts2.dispatcher.FilterDispatcher
</filter-class>
</filter>
<filter-mapping>
<filter-name>struts2</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
<welcome-file-list>
<welcome-file>Login.jsp</welcome-file>
</welcome-file-list>
</web-app>
Run Code Online (Sandbox Code Playgroud)
struts.xml中:
<struts>
<package name="default" extends="struts-default" namespace="/">
<action name="login" method="execute"
class="struts2.LoginAction">
<result name="success">Welcome.jsp</result>
<result name="error">Login.jsp</result>
</action>
</package>
</struts>
Run Code Online (Sandbox Code Playgroud)
login.jsp的:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib prefix="s" uri="/struts-tags"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Login Screen - Struts 2</title>
</head>
<body>
<s:actionerror />
<s:form …
Run Code Online (Sandbox Code Playgroud) 我对hibernate有一些疑问,
表:Employee_Master
Id编号名称Varchar工资长
POJO:EmployeeMaster.java
public class EmployeeMaster {
private int id ;
private String name;
private long salary;
//... all field s getter/ setter methods
}
Run Code Online (Sandbox Code Playgroud)
现在我想从这样的id中得到唯一的名字.
SQL查询如:
select name from employee_master where id = 10;
Run Code Online (Sandbox Code Playgroud)
但是我们怎样才能在休眠中实现上述同样的事情呢?
session.createQuery("from EmployeeMaster empMaster where empMaster.id = 10");
Run Code Online (Sandbox Code Playgroud)
我知道这个解决方案,但它将返回整个pojo列表.但我只想要那个字段名称,所以我该怎么办?
如何在数据库中插入印度卢比符号(Oracle 10g,MySql 5.0和Sql Server 2008)?
实际上我有一个表"货币",其中2个字段就像"currencyName"和"currencysymbol",所以我将如何在数据库中插入新的卢比符号.
嗨,当我尝试启动我的 Tomcat 6.0 时,出现了这样的错误,
所以你能给我一些解决方案吗
Mar 9, 2011 5:29:00 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Java\jre6\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:/Java/jre6/bin/client;C:/Java/jre6/bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Java\jdk1.5\bin\;C:\Program Files\TortoiseSVN\bin;C:\Program Files\Liquid Technologies\Liquid XML Studio 2009\XmlDataBinder7\Redist7\cpp\win32\bin;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\MySQL\MySQL Server 5.0\bin
Mar 9, 2011 5:29:00 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8081
Mar 9, 2011 5:29:00 PM org.apache.tomcat.util.net.jsse.JSSESocketFactory getStore
SEVERE: Failed to load keystore type JKS with path C:\Documents and Settings\sanjay.prajapati/.keystore due to C:\Documents and …
Run Code Online (Sandbox Code Playgroud) 想要在spring aop中的声明式事务管理示例........
其实这里
<aop:config>
<aop:advisor advice-ref="addAdvice" pointcut="execution(* com.DAO.*.*(..))"/>
</aop:config>
<tx:advice id="addAdvice" transaction-manager="transactionManager">
<tx:attributes>
<tx:method name="add*" propagation="REQUIRED" rollback-for="" />
</tx:attributes>
</tx:advice>
Run Code Online (Sandbox Code Playgroud)
所以这里我想写的实际上是rollback-for ="",有什么方法或其他吗?如果方法那么该方法将放在哪里?
我的原始文字:“ sanjay” SHA-1文字:“ 25ecbcb559d14a98e4665d6830ac5c99991d7c25”
现在如何从该哈希值中获取原始值-“ sanjay”?
有没有代码,算法或方法?
java ×5
hash ×2
aop ×1
database ×1
hibernate ×1
javascript ×1
jsf ×1
junit ×1
junit4 ×1
primefaces ×1
regex ×1
richfaces ×1
spring ×1
struts2 ×1
tomcat ×1
tomcat6 ×1
transactions ×1
unicode ×1
unit-testing ×1