我的系统运行在Linux Mandriva,RDBMS - MySQL 5上.我需要使用UTF-8创建数据库和表.
这是hibernate.cfg.xml的一个片段-
...
<property name="hibernate.hbm2ddl.auto">create-drop</property>
<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="hibernate.connection.characterEncoding">utf8</property>
...
Run Code Online (Sandbox Code Playgroud)
my.cnf -
# The MySQL server
[mysqld]
...
default-character-set=cp1251
character-set-server=cp1251
collation-server=cp1251_general_ci
init-connect="SET NAMES cp1251"
skip-character-set-client-handshake
...
[mysqldump]
...
default-character-set=cp1251
...
Run Code Online (Sandbox Code Playgroud)
有些课,例如 -
@Entity
@Table(name = "USER")
public class User {
@Id
@Column(name = "USERID")
@GeneratedValue(strategy = GenerationType.AUTO)
private Integer id;
@Column(name = "USERNAME")
private String name;
@Column(name = "USERPASSWORD")
private String password;
@Column(name = "USERIP")
private String ip;
// …
Run Code Online (Sandbox Code Playgroud) 规范说:
2.4.1.1元素
<KeyDescriptor>
该
<KeyDescriptor>
元素提供有关实体用于签名数据或接收加密密钥的加密密钥的信息,以及其他加密详细信息.其KeyDescriptorType
复杂类型包含以下元素和属性:
use
[可选的]可选属性,指定所描述的密钥的用途.值是从KeyTypes枚举中提取的,由值
encryption
和值组成signing
.
<ds:KeyInfo>
[需要]直接或间接标识密钥的可选元素.
据我所知,为了向两个方向发送安全数据,我应该:
我应该在SP元数据中指定什么密钥的证书,并且我可以使用相同的证书进行签名和加密?
IdP的供应商提供了所谓的"元数据模板",其中指出了应该拼写的内容和位置.
这是相关部分(逐字):
...
<md:KeyDescriptor use="signing">
<ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<ds:X509Data>
<ds:X509Certificate>
<!--
TODO It is necessary to insert here the certificate of the signature
key of the service provider in X509 DER format and Base64 encoded
-->
</ds:X509Certificate>
</ds:X509Data>
</ds:KeyInfo>
</md:KeyDescriptor>
<md:KeyDescriptor use="encryption">
<ds:KeyInfo xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
<ds:X509Data>
<ds:X509Certificate>
<!--
TODO It is necessary to insert here the certificate of …
Run Code Online (Sandbox Code Playgroud) 我正在尝试将JSON对象发布到我的Spring MVC控制器,但我只收到Access-Control-Allow-Origin
错误.
我的控制器:
@RequestMapping(value= "/add", method = RequestMethod.POST, headers = {"content-type=application/json"})
public @ResponseBody Reponse addUser(Model model, @RequestBody @Valid @ModelAttribute("user") User user, BindingResult result) {
if (result.hasErrors()) {
Reponse error = new Reponse();
// etc......
return error;
} else {
return service.addUser(user);
}
}
Run Code Online (Sandbox Code Playgroud)
我的Zepto POST:
this.addUser = function (valeur, callback) {
$.ajax({
type: 'POST',
url: 'http://127.0.0.1:8080/AgenceVoyage/user/add',
data: JSON.stringify({"mail" : "toto@toto.fr" , "password" : "titi"}),
dataType: "json",
contentType: "application/json",
success: function(data) {
if(data.reponse == "OK") {
window.location = "main.html"; …
Run Code Online (Sandbox Code Playgroud) 我面临错误:
无法加载资源:服务器响应状态为415(不支持的媒体类型)
我的代码的AJAX部分如下:
$.ajax({
url: '/authentication/editUser',
type: "POST",
contentType: "application/json",
data: JSON.stringify(requestObj), //Stringified JSON Object
success: function(resposeJsonObject) {
//
}
});
Run Code Online (Sandbox Code Playgroud)
和控制器的处理程序方法:
@RequestMapping(value = "/editUser", method = RequestMethod.POST,
headers = {"Content-type=application/json"})
@ResponseBody
public EditUserResponse editUserpost(@RequestBody EditUserRequest editUserRequest) {
System.out.println(editUserRequest);
return new EditUserResponse();
}
Run Code Online (Sandbox Code Playgroud)
如何解决错误?
我需要删除它上面的 <div>
元素id
.我知道我可以使用如下的功能 -
function removeElement(div_id) {
var div = document.getElementById(div_id);
element.parentNode.removeChild(div);
}
Run Code Online (Sandbox Code Playgroud)
但事实是id
- 复合材料.它由一个恒定的部分和每个请求中发生变化的部分组成.这部分是一组随机数.
我知道,在这种情况下我需要使用正则表达式.我会非常感谢一个例子.
有包含JavaScript代码的HTML文件.此JavaScript代码加载图像并将其放置在某个位置.如果失败,则会显示一条消息.
我需要在模板Slim中包含此文件.
我可以通过以下方式将一个Slim模板包含在另一个模板中:
=render 'some/path/some_pattern'
Run Code Online (Sandbox Code Playgroud)
如何将HTML文件包含在我的模板Slim中?
谢谢大家.
ViewResolver(我的jsp位于前缀值指定的右侧文件夹中):
<!-- Resolves views selected for rendering by @Controllers -->
<!-- to .jsp resources in the /WEB-INF/views directory -->
<beans:bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<beans:property name="prefix" value="/WEB-INF/views/" />
<beans:property name="suffix" value=".jsp" />
</beans:bean>
Run Code Online (Sandbox Code Playgroud)
Servlet映射:
<servlet-mapping>
<servlet-name>appServlet</servlet-name>
<url-pattern>*.fst</url-pattern>
</servlet-mapping>
Run Code Online (Sandbox Code Playgroud)
控制器:
@Controller
public class HomeController {
private static final Logger logger =
LoggerFactory.getLogger(HomeController.class);
@RequestMapping("/home")
public ModelAndView home(String user, HttpServletRequest request) {
logger.info("Home controller has been executed");
ModelAndView mv = new ModelAndView();
mv.addObject("userName", user);
mv.addObject("controllerName", request.getRequestURI());
mv.setViewName("home");
return mv;
}
@RequestMapping(value = "/testAjax", method = RequestMethod.POST) …
Run Code Online (Sandbox Code Playgroud) #include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/fs.h>
static int __init hello_start(void)
{
struct file* my_fd;
my_fd = filp_open ("/tmp/foobar", O_WRONLY | O_APPEND, 0);
if (IS_ERR (my_fd))
{
printk (KERN_ERR "Failed to open file. err: %d.\n", my_fd);
}
else
{
my_fd->f_op->write (my_fd, "some data", 10, &my_fd->f_pos);
}
printk(KERN_INFO "Loading hello module...\n");
return 0;
}
static void __exit hello_end(void)
{
printk(KERN_INFO "hello_end.\n");
}
module_init(hello_start);
module_exit(hello_end);
Run Code Online (Sandbox Code Playgroud)
上面的代码在文件中写入时给出错误-14.我在这做错了什么?
这是dmesg
输出:
[19551.674999] Write returned: -14.
[19551.675004] Loading hello module...
Run Code Online (Sandbox Code Playgroud) 这是我的代码.我可以打开浏览器,但不会加载html源代码.
class Browser {
public static void main(String[]args) {
try {
Runtime rtime = Runtime.getRuntime();
String url = "?C:/Program Files (x86)/Internet Explorer/DD.html";
String brow = "C:/Program Files (x86)/Internet Explorer/iexplore.exe";
Process pc = rtime.exec(brow + url);
pc.waitFor();
} catch (Exception e) {
System.out.println("\n\n" + e.getMessage());
}
}
}
Run Code Online (Sandbox Code Playgroud) 有一个简单的WCF Web服务。对Web服务的所有外部请求都必须经过身份验证。
Web服务的合同:
namespace SimpleCustomService
{
[ServiceContract]
public interface UsrIService
{
[OperationContract]
string SayHello();
}
}
Run Code Online (Sandbox Code Playgroud)
Web服务的实现:
namespace SimpleCustomService
{
public class UsrService : UsrIService
{
public string SayHello()
{
return "Hello";
}
}
}
Run Code Online (Sandbox Code Playgroud)
通过使用该wsdl.exe
实用程序,我生成了代理类来调用Web服务的方法。
生成的代码如下:
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.Xml.Serialization;
//
// This source code was auto-generated by wsdl, Version=4.6.1055.0.
//
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "4.6.1055.0")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Web.Services.WebServiceBindingAttribute(Name="BasicHttpBinding_UsrIService", Namespace="http://tempuri.org/")]
public partial class UsrService : System.Web.Services.Protocols.SoapHttpClientProtocol {
private System.Threading.SendOrPostCallback SayHelloOperationCompleted; …
Run Code Online (Sandbox Code Playgroud) 我有一个简单的Apache Camel路由,该路由从队列中获取序列化文件并将其发送到一些外部资源:
public class MyRouteBuilder extends RouteBuilder {
@Override
public void configure() throws Exception {
from("activemq:alfresco-queue")
.process(new Processor() {
public void process(Exchange exchange) throws Exception {
MultipartEntityBuilder multipartEntityBuilder = MultipartEntityBuilder.create();
multipartEntityBuilder.setMode(HttpMultipartMode.BROWSER_COMPATIBLE);
multipartEntityBuilder.addPart("file", new ByteArrayBody(exchange.getIn().getBody(byte[].class),
exchange.getIn().getHeader("fileName", String.class)));
exchange.getIn().setBody(multipartEntityBuilder.build().getContent());
}
})
.setHeader(Exchange.HTTP_METHOD, constant(org.apache.camel.component.http4.HttpMethods.POST))
.to("http4://vm-alfce5-31.....com:8080/alfresco/s/someco/queuefileuploader?guest=true")
.process(new Processor() {
public void process(Exchange exchange) throws Exception {
System.out.println("The response code is: " +
exchange.getIn().getHeader(Exchange.HTTP_RESPONSE_CODE));
}
});
}
}
Run Code Online (Sandbox Code Playgroud)
蓝图配置文件:
<?xml version="1.0"?>
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd
http://camel.apache.org/schema/blueprint http://camel.apache.org/schema/blueprint/camel-blueprint.xsd">
<bean id="myRouteBuilder" class="org.fusesource.example.MyRouteBuilder"/>
<camelContext id="blueprintContext" trace="false" …
Run Code Online (Sandbox Code Playgroud) activemq-classic jms apache-camel apache-httpcomponents jbossfuse
此处描述了类似的问题:GWT IllegalArgumentException:encodedRequest不能为空
我的GWT应用程序部署在Tomcat6中,它通过使用Coyote/JK2连接器与Apache链接.对于SSO,我使用mod_auth_sspi/1.0.4.
当我使用IE8时,页面不显示,但对于Firefox一切正常.在Tomcat日志中,我看到以下内容:
SEVERE: Exception while dispatching incoming RPC call
java.lang.IllegalArgumentException: encodedRequest cannot be empty
at com.google.gwt.user.server.rpc.RPC.decodeRequest(RPC.java:232)
at org.spring4gwt.server.SpringGwtRemoteServiceServlet.processCall(SpringGwtRemoteServiceServlet.java:32)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:248)
at com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:643)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:723)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at gov.department.it.server.RequestInterceptorFilter.doFilter(RequestInterceptorFilter.java:90)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:293)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:311)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:776)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:705)
at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:898)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
at java.lang.Thread.run(Thread.java:619)
Run Code Online (Sandbox Code Playgroud)
到目前为止我尝试了什么:
1)找不到注册表项DisableNTLMPreAuth
(恕我直言,这不是解决方案,因为在我的情况下IE 8是主动使用的).
2)我已经安装并配置了本机Windows身份验证框架WAFFLE
web.xml中:
...
<filter>
<filter-name>NegotiateSecurityFilter</filter-name>
<filter-class>waffle.servlet.NegotiateSecurityFilter</filter-class>
<init-param>
<param-name>waffle.servlet.spi.NegotiateSecurityFilterProvider/protocols</param-name>
<param-value>NTLM</param-value> …
Run Code Online (Sandbox Code Playgroud) 你好,
是否有可能不仅包括在创建故障单和更改故障单时发送的消息中的状态和最新评论?我希望看到更多,比如所有可用的回顾性信息,即整个变更历史记录.
也许有人已经这样配置了Trac.如果是这样,我将非常感谢有关该配置的信息,包括与该应用程序一起使用的Trac版本.
干杯,Thx
ajax ×3
spring ×3
spring-mvc ×3
apache ×1
apache-camel ×1
c ×1
c# ×1
cryptography ×1
haml ×1
hibernate ×1
html ×1
java ×1
javascript ×1
jbossfuse ×1
jms ×1
jpa ×1
jquery ×1
json ×1
linux ×1
linux-kernel ×1
mysql ×1
ntlm ×1
post ×1
ruby ×1
saml-2.0 ×1
shibboleth ×1
slim-lang ×1
soap ×1
tomcat ×1
trac ×1
wcf ×1
web-services ×1
wsdl ×1
zepto ×1