All Downloads are FREE. Search and download functionalities are using the official Maven repository.

test.config.user.xml Maven / Gradle / Ivy

<?xml version="1.0" encoding="UTF-8"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:noNamespaceSchemaLocation="http://url2sql.vsame.net/xml/0.0.0.7/url2sqlConfig.xsd">
	<action url="aaaaaaaaaaaaaaaa">
		<desc>这是测试用的</desc>
		<vars>
			<var name="sql">select * from xxx</var>
		</vars>
		<params>
			<v name="id">校验规则</v>
			<v name="name">校验规则</v>
		</params>
		<js>
			这是JS代码
		</js>
		<cachescript>
		return session.get('user.itemid');
		</cachescript>
		<cleanCache>
		return session.get('user.id');
		</cleanCache>
	</action>
	
 	<action url="js/a">
		<desc>这是测试用的</desc>
		<js>
			context.put("a", "this is use java method a.");
		</js>
	</action>
	
	<action url="js/b">
		<vars>
			<var name="queryAll">select * from student</var>
			<var name="querybyId">select * from student where id=?</var>
		</vars>
		<js>
			context.put("b", "this is use java method b.");
			var queryAll = urlConfig.getVar("queryAll");
			context.put("queryAll", queryAll);
			context.put("queryAll2", vars.queryAll);
			context.put("queryAllResult", SqlHelper.query("queryAll"));
		</js>
	</action>
	
	<action url="js/querybyId">
		<vars>
			<var name="querybyId">select * from student where id=${id}</var>
		</vars>
		<js>
			var querybyId = urlConfig.getVar("querybyId");
			context.put("querybyIdResult", SqlHelper.query(querybyId));
		</js>
	</action>
	<action url="js/add">
		<vars>
			<var name="1">INSERT INTO student (`name`, `age`) VALUES (${name}, ${age})</var>
		</vars>	
	</action>
	<action url="js/updata">
		<vars>
			<var name="1">UPDATE student SET `age`=${age} WHERE (`id`=${id})</var>
		</vars>
	</action>
	<action url="js/delete">
		<vars>
			<var name="1">DELETE FROM student WHERE (`id`=${0})</var>
		</vars>
	</action>
	<action url="js/queryAll">
		<vars>
			<var name="1">select * from student</var>
		</vars>
	</action>
	<action url="js/page">
		<vars>
			<var name="sql">select id, name from student</var>
		</vars>
		<js>
		    context.put("pv", SqlHelper.page(vars.sql));
		</js>
	</action>
	
	
</config>




© 2015 - 2025 Weber Informatics LLC | Privacy Policy