learn tuscany by example II

最简单的+webapp

需要在META-INF下加sca-contribution.xml文件(contribution文件有待进一步认识! )

<?xml version="1.0" encoding="UTF-8"?>
<contribution xmlns="http://www.osoa.org/xmlns/sca/1.0"
              targetNamespace="http://Cal"
              xmlns:sample="http://Cal">
   <deployable composite="sample:Cal"/>
</contribution>

 calTest.jsp

<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%@ taglib uri="http://www.osoa.org/sca/sca_jsp.tld" prefix="sca" %>
<sca:reference name="CalServiceComponent" type="cal.CalService"/>
<html>
<head>
<title>cal test</title>
</head>
<body>
1+2=<%=CalServiceComponent.add(1,2) %>
</body>
</html>
 

你可能感兴趣的:(html,jsp,xml)