三、 系统开发
1 .程序运行框架
本系统主要基于Spring Web MVC框架开发,
Action配置文件为WEB-INF\springapp-servlet.xml,
View配置文件为WEB-INF\classes\springapp-views.properties
程序运行框架图如图所示:
<xform style="twocolumn"> <title value="Form Demo"> <imgButton label="Cancel" .../> </title> <textField type="int" modelReference="intValue" label="Count" .../> <checkBox modelReference="nestedBean.boolValue" label="Check Me" .../> </xform>
<jsp:useBean id="testbean" class="com.tonbeller.wcf.form.TestBean" scope="session" /> <wcf:form id="formcomp" xmlUri="/WEB-INF/formdemo.xml" model="#{testbean}"/> <form action="formdemo.jsp" method="POST" id="form01"> <wcf:render ref="#{formcomp}" xslUri="/WEB-INF/wcf/wcf.xsl" xslCache="true"/> </form>
<xform style="twocolumn"> <title value="fmt:fetch.title.from.resource.bundle"> <imgButton id="cancel" src="wcf/form/cancel.png" action="revert" label="Cancel" forward="tabledemo.jsp" handler="com.tonbeller.wcf.form.ButtonHandler"/> </title> <!-- Text control --> <textField id="string" type="string" modelReference="stringValue" label="Text:" value="" title="please enter some text"/> <textField id="int" type="int" modelReference="intValue" label="Integer:" value="" title="please enter an integer"/> <textField id="double" type="double" modelReference="doubleValue" label="Decimal number:" value="" title="please enter a decimal number"/> <textField id="date" type="date" modelReference="dateValue" label="Date:" value="" title="please enter a date"/> <textField id="dateTime" type="dateTime" modelReference="dateTimeValue" label="Date/Time:" value="" title="please enter a date/time"/> <!-- Password control --> <password id="password" type="string" modelReference="password" label="Password:" value=""/> <!-- Text area --> <textArea id="textarea" rows="7" cols="40" type="string" modelReference="textArea" label="Text area:" value="This is a text area"/> <checkBox id="checkbox1" modelReference="checkBox1" label="check box 1"/> <checkBox id="checkbox2" modelReference="checkBox2" label="check box 2"/> <!-- ListBox, single selection --> <listBox1 id="list1" type="int" modelReference="list1" label="List, single selection:"> <listItem id="list1.1" value="1" label="list item 1"/> <listItem id="list1.2" value="2" label="list item 2"/> <listItem id="list1.3" value="3" label="list item 3"/> <listItem id="list1.4" value="4" label="list item 4"/> </listBox1> <!-- ListBox, multiple selection --> <listBoxN id="listN" type="int" modelReference="listN" label="List, multiple selection:"> <listItem id="listN.1" value="1" label="list item 1"/> <listItem id="listN.2" value="2" label="list item 2"/> <listItem id="listN.3" value="3" label="list item 3"/> <listItem id="listN.4" value="4" label="list item 4"/> </listBoxN> <!-- ListBox, single selection, dynamic item list --> <listBox1 id="listbox" type="int" modelReference="dynList" label="List, dynamic content:" handler="com.tonbeller.wcf.form.TestItems"/> <label label="This is a label" value="value attribute goes here"/> <label label="Dynamic label (content from TextArea)" modelReference="textArea"/> <radioButton id="radio1" modelReference="radioButton1" group-id="group1" label="radio button 1"/> <radioButton id="radio2" modelReference="radioButton2" group-id="group1" label="radio button 2"/> <buttons> <button id="cancel" action="revert" label="Cancel" forward="tabledemo.jsp" handler="com.tonbeller.wcf.form.ButtonHandler"/> <button id="revert" action="revert" label="Revert" handler="com.tonbeller.wcf.form.ButtonHandler"/> <button id="validate" action="validate" label="Validate" handler="com.tonbeller.wcf.form.ButtonHandler"/> <button id="ok" action="validate" label="OK" forward="tabledemo.jsp" handler="com.tonbeller.wcf.form.ButtonHandler"/> </buttons> </xform>
<jp:mondrianQuery id="query01" queryName="name1"> SELECT ... </jp:mondrianQuery> <jp:mondrianQuery id="query01" queryName="name2"> SELECT ... </jp:mondrianQuery> ... <jp:chooseQuery id="query01" queryName="name1"/>