我有一个.jsp页面,其中有四个名为submit,add,update和delete的按钮:
<%@ 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 uri="/struts-tags" prefix="s" %>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<s:form action="User" >
<s:submit />
<s:submit action="addUser" value="Add" />
<s:submit action="updateUser" value="Update" />
<s:submit action="deleteUser" value="Delete" />
</s:form>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
在每次提交时,它会被重定向到我的struts.xml文件中提到的操作类:
<!DOCTYPE struts PUBLIC
"-//Apache Software Foundation//DTD Struts Configuration 2.0//EN"
"http://struts.apache.org/dtds/struts-2.0.dtd">
<struts>
<package name="default" extends="struts-default">
<action name="User" class="vaannila.UserAction">
<result name="success">/success.jsp</result>
</action>
<action name="addUser" method="add" class="vaannila.UserAction">
<result name="success">/success.jsp</result>
</action>
<action name="updateUser" …
Run Code Online (Sandbox Code Playgroud) 由于我是Apache骆驼,特别是Rest DSL的新手,我想到了尝试Rest DSL的样本.
所以我创建了一个camel-config.xml:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:camel="http://camel.apache.org/schema/spring"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
<!-- use camel-metrics route policy to gather metrics for all routes -->
<!-- bean id="metricsRoutePolicyFactory" class="org.apache.camel.component.metrics.routepolicy.MetricsRoutePolicyFactory"/-->
<!-- a rest service which uses binding to/from pojos -->
<bean id="userRoutes" class="org.apache.camel.example.rest.UserRouteBuilder"/>
<!-- a bean for user services -->
<bean id="userService" class="org.apache.camel.example.rest.UserService"/>
<camelContext id="myCamel" xmlns="http://camel.apache.org/schema/spring">
<routeBuilder ref="userRoutes"/>
</camelContext>
</beans>
Run Code Online (Sandbox Code Playgroud)
我的路线类是:
package org.apache.camel.example.rest;
import org.apache.camel.builder.RouteBuilder;
/**
* Define REST services using the Camel REST DSL
*/
public class …
Run Code Online (Sandbox Code Playgroud) 我正在尝试集成wso2 Governance注册表服务器和ESB服务器.我已经使用这些链接寻求帮助:http ://wso2.org/project/esb/java/4.0.3/docs/deployment_guide.html http://charithaka.blogspot.in/2011/11/wso2-deployment-synchronizer -sharing.html.
我的mysql来自同一网络上的另一台电脑.我已经更改了我的registry.xml,如上面的治理注册表网址所述,但是当我运行治理注册表的wso2server.bat文件时,我得到如下错误: -
TID: [0] [Greg] [2013-02-15 12:50:04,537] INFO {org.wso2.carbon.core.internal.CarbonCoreActivator} - Starting WSO2 Carbon... {org.wso2.carbon.core.internal.CarbonCoreActivator}
TID: [0] [Greg] [2013-02-15 12:50:04,567] INFO {org.wso2.carbon.core.internal.CarbonCoreActivator} - Operating System : Windows 7 6.1, x86 {org.wso2.carbon.core.internal.CarbonCoreActivator}
TID: [0] [Greg] [2013-02-15 12:50:04,568] INFO {org.wso2.carbon.core.internal.CarbonCoreActivator} - Java Home : D:\eclipse\java\jdk1.7.0\jre {org.wso2.carbon.core.internal.CarbonCoreActivator}
TID: [0] [Greg] [2013-02-15 12:50:04,568] INFO {org.wso2.carbon.core.internal.CarbonCoreActivator} - Java Version : 1.7.0 {org.wso2.carbon.core.internal.CarbonCoreActivator}
TID: [0] [Greg] [2013-02-15 12:50:04,568] INFO {org.wso2.carbon.core.internal.CarbonCoreActivator} - Java VM : Java HotSpot(TM) Client VM 21.0-b17,Oracle …
Run Code Online (Sandbox Code Playgroud) 我的请求正文为:
<tns:InputRequest xmlns:tns="http://tempuri.org/">
<tns:ID>ID_001</tns:ID>
<tns:ID>ID_002</tns:ID>
<tns:Description>Description for ID_001</tns:Description>
<tns:Description>Description for ID_002</tns:Description>
</tns:InputRequest>
Run Code Online (Sandbox Code Playgroud)
并获得 ID 和描述的值,我已将属性创建为:
<property xmlns:tns="http://tempuri.org/" name="ID" expression="//tns:ID" scope="default" type="STRING"/>
<property xmlns:tns="http://tempuri.org/" name="Description" expression="//tns:Description" scope="default" type="STRING"/>
Run Code Online (Sandbox Code Playgroud)
但这让我只有一个价值。我如何制作一个属性数组,以便我可以在其中存储多个 ID 和描述值,以及如何从该数组属性中检索?期待您的回复。提前致谢
我如何比较wso2 esb中的属性值,即我想要进行过滤操作,如果property2.value== property1.value
那时它应该进行进一步处理,否则应该删除.但是如何做到这一点我没有得到?请帮忙.提前致谢.
我已经在属性中捕获了我的输入ID,现在我想验证属性是否有数据.这该怎么做?我做过这样的事情:
这是我设置的属性:
<property xmlns:cct="http://www.tempuri.org/" name="ID" expression="//cct:ID" scope="default" type="STRING"/>
Run Code Online (Sandbox Code Playgroud)
这是我的xpath xpression,应该验证属性是否有数据:
count(get-property(ID)[text()])>0
Run Code Online (Sandbox Code Playgroud)
但这种表达是错误的.怎么解决这个问题.请帮忙.提前致谢
我试图使用java.util.zip包解压缩压缩文件夹:
现在我的压缩文件夹结构是:我的压缩文件夹名称是classes.zip在这个zip文件夹里面我有一个类文件夹,里面有子文件夹和文件:
如果你进一步进入www文件夹,那么它又有一个子文件夹,这是一个java包,在包结构文件夹里面我有.class文件.
现在我想解压缩这个压缩文件夹,我的代码是:package www.eor.com;
/**
* A console application that tests the UnzipUtility class
*
*/
public class UnzipUtilityTest {
public static void main(String[] args) {
String zipFilePath = "D:/classes.zip";
String destDirectory = "D:/Dojo";
UnzipUtility unzipper = new UnzipUtility();
try {
unzipper.unzip(zipFilePath, destDirectory);
} catch (Exception ex) {
// some errors occurred
ex.printStackTrace();
}
}
}
Run Code Online (Sandbox Code Playgroud)
而辅助班是:
package www.eor.com;
import java.io.BufferedOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
/**
* This utility extracts files …
Run Code Online (Sandbox Code Playgroud) 我想在每60秒后重复运行代理(传递)或序列(传递类型),所以我开始使用任务计划程序,但我无法弄清楚如何使用任务计划程序实现我的要求.我希望每60秒执行一次我的代理或序列.就像wso2 BPS一样,我们可以使用循环来实现这个功能,同样在esb中有什么可以在一段时间后调度运行代理或序列吗?期待您的回答.提前致谢.
是否有可能在wso2 esb中达到上述要求.请帮忙.