Fujitsu InterseTage Platform APCOORDINATOR (APC) Web application development

xiaoxiao2021-03-06  104

Reference documentation:

L a.1 Jane: /APC/Manual/guide/guideaa/guide291.htm

l uji tag reference: /APC/Manual/tag/index.html

1, basic operational process

l Basic Need: JSP Uji Tags (View), Handler (Controller), DataBean (Model), in line with MVC mode

l Recommended principle: a picture corresponding to 1 JSP page, 1 handler and 1 DATABEAN

l If you share Handler or DataBean (such as the case), logical confusion is prone to development and maintenance

2, control page main.jsp

Sample </ TITLE></p> <p><% @ page contenttype = "text / html; charset = shift_jis"%></p> <p><% @ Taglib URI = "uji-taglib" prefix = "uji"%></p> <p></ HEAD></p> <p><Body></p> <p><uji: dispatch /></p> <p><uji: incrude Pane = "Head" /></p> <p><uji: incrude Pane = "body" /></p> <p></ Body></p> <p></ Html></p> <p>l APC application starts from main.jsp</p> <p>l uji: include tag contains two parts: page and page body</p> <p>l Remove <uji: include Pane = "Head" /> for the APC application that does not require the page.</p> <p>3, DataBean</p> <p>l Headbean.java</p> <p>Package Sample;</p> <p>Public class headbean experts com.fujitsu.uji.databean</p> <p>{</p> <p>Protected int count;</p> <p>protected java.util.date logintime;</p> <p>Public int getCount () {</p> <p>Return count;</p> <p>}</p> <p>Public void setcount (int count) {</p> <p>THIS.COUNT = COUNT;</p> <p>}</p> <p>Public java.util.date getLogintime () {</p> <p>Return Logintime;</p> <p>}</p> <p>Public void setLogintime (java.util.date logintime) {</p> <p>THIS.Logintime = logintime;</p> <p>}</p> <p>}</p> <p>l bodybean.java</p> <p>Package Sample;</p> <p>Public class bodybean extends com.fujitsu.uji.databean</p> <p>{</p> <p>Protected string message;</p> <p>Protected Double VAL1;</p> <p>Protected Double Val2;</p> <p>Protected Double Result;</p> <p>Public string getMessage () {</p> <p>Return Message;</p> <p>}</p> <p>Public void setmessage (string message) {</p> <p>THIS.MESSAGE = Message;}</p> <p>Public double getval1 () {</p> <p>Return VAL1;</p> <p>}</p> <p>Public void setval1 (double val1) {</p> <p>THIS.VAL1 = VAL1;</p> <p>}</p> <p>Public double getVal2 () {</p> <p>Return Val2;</p> <p>}</p> <p>Public void setval2 (double val2) {</p> <p>THIS.VAL2 = VAL2;</p> <p>}</p> <p>Public double getResult () {</p> <p>Return Result;</p> <p>}</p> <p>Public void setResult (double result) {</p> <p>THIS.RESULT = Result;</p> <p>}</p> <p>}</p> <p>l DataBean is a standard JavaBean, you need to expand com.fujitsu.uji.DataBean</p> <p>l DataBean is consistent with the project in the picture definition book</p> <p>L sub-DATABEAN: For the case of the list of items in the screen, use sub-DATABEAN to represent an entry, through the List structure sub-DataBean represents the entire entry list, and as a property of the parent DataBean</p> <p>4, into the exit page</p> <p>l Header.jsp</p> <p><% @ page contenttype = "text / html; charset = shift_jis"%></p> <p><% @ Taglib URI = "uji-taglib" prefix = "uji"%></p> <p><uji: usebean id = "head" CLS = "Sample.Headbean" request = "true" /></p> <p>実 実 回数</p> <p><uji: getproperty bean = "head" property = "count" /> back. <br></p> <p>セショ セショ 时间 时间 时间 时间</p> <p><uji: getproperty bean = "head" property = "logintime" /> す. <br></p> <p><Hr> <br></p> <p>l uji: UseBean tag Specifies the DATABEAN, the id attribute value needs to be consistent with the PANE attribute value of the uji: include in main.jsp, and the CLS property specifies the full path to the DataBean class.</p> <p>l uji: getProperty tag Get the specified property value in the DATABEAN, the bean property is consistent with the UJI: UseBean's ID property, the Property property specifies the properties in the DATABEAN.</p> <p>l Request.jsp</p> <p><% @ page contenttype = "text / html; charset = shift_jis"%></p> <p><% @ Taglib URI = "uji-taglib" prefix = "uji"%></p> <p><uji: usebean id = "body" CLS = "Sample.Bodybean" request = "true" /></p> <p>サ サ プ プ プ プ グ グ ム で, 2 加 减 実 実 実. 実.</p> <p><Form method = "pos"></p> <p><Input Name = "uji.verbs" type = "hidden" value = "add, sub"> <input name = "uji.id" type = "hidden" value = "body"></p> <p>値 1 入: <input name = "VAL1"> <br></p> <p>値 2 入: <input name = "VAL2"> <br></p> <p><Input Name = "Add" type = "submit" value = "plus"></p> <p><Input Name = "Sub" type = "submit" value = "Sublining"></p> <p></ Form></p> <p>l For form processing, you need to provide several special hidden values:</p> <p>Ø uji.verbs: Specify a comma-separated action (button, link, etc.) command list (see the commands.map behind)</p> <p>Ø uji.id: Specify the ID of the DATABEAN, specifying the DATABEAN directly below is equivalent</p> <p><Input name = "uji.bean" type = "hidden" value = "sample.bodybean"></p> <p>l The name attribute of the text box is the same as the corresponding attribute name in the DATABEAN, so that the input value is automatically set to the corresponding attribute in the DataBean.</p> <p>l In practical applications, uji: fieldString is usually used to represent text boxes:</p> <p><uji: FieldString Bean = "body" name = "VAL1"></p> <p>l The name attribute value of the submit button must be consistent with the value in the list of uji.verbs, so that the corresponding action can be performed.</p> <p>l There is no data verification in the sample. For the case where data verification is required in practical applications, JavaScript needs to be processed (here, the name attribute value of the button does not necessarily want to keep the value in the list of uji.verbs).) :</p> <p>Ø Add uji.verb hidden form field</p> <p><Input Name = "uji.verb" type = "hidden" value = ">></p> <p>Ø Change the submission button to a normal button to handle the Click event</p> <p><Input name = "add" type = "button" value = "plus" onclick = "add ()"></p> <p>Ø Set the current action command in the process function, submit the form</p> <p>Function add () {</p> <p>// ... to verify, return</p> <p>Document.Forms [0] .Elements ["uji.verb"]. value = "add";</p> <p>Document.Forms [0], SUBMIT ();</p> <p>}</p> <p>l Response.jsp</p> <p><% @ Page ContentType = "Text / HTML; Charset = Shift_JIS"%> <% @ Taglib Uri = "uji-taglib" prefix = "uji"%></p> <p><uji: usebean id = "body" CLS = "Sample.Bodybean" request = "true" /></p> <p><uji: getproperty bean = "body" property = "message" /> <br></p> <p><uji: getproperty bean = "body" property = "vaal1" /></p> <p><uji: getproperty bean = "body" preordy = "VAL2" /> Calculation results は <br></p> <p><uji: getproperty bean = "body" property = "result" /> す. <br></p> <p><Form method = "pos"></p> <p><Input Name = "uji.verbs" type = "hidden" value = "next"></p> <p><Input Name = "uji.id" type = "hidden" value = "body"></p> <p><Input name = "next" type = "submit" value = "入力 に 戻 戻"></p> <p></ Form></p> <p>5, Handler class</p> <p>Package Sample;</p> <p>Import com.fujitsu.uji.dispatchContext;</p> <p>Public class sampleshandler extends com.fujitsu.uji.GenericHandler</p> <p>{</p> <p>Public SampleHandler () {</p> <p>}</p> <p>Public boolean init () {</p> <p>Return True;</p> <p>}</p> <p>Public Void Add (DispatchContext Context, Bodybean DataBean) {</p> <p>Double Result = DATABEAN.GETVAL1 () DATABEAN.GETVAL2 ();</p> <p>DATABEAN.SETMESSAGE ("Add a bit.");</p> <p>DATABEAN.SETRESULT (RESULT);</p> <p>DATABEAN.SETVERB ("ResMode");</p> <p>Context.setResponseBean ("Body", DATABEAN;</p> <p>Sethead (context);</p> <p>}</p> <p>Public Void Sub (DispatchContext Context, Bodybean DataBean) {</p> <p>Double Result = DATABEAN.GETVAL1 () - DATABEAN.GETVAL2 ();</p> <p>DATABEAN.SETMESSAGE ("减 减 実 実 実 し し.");</p> <p>DATABEAN.SETRESULT (RESULT);</p> <p>DATABEAN.SETVERB ("ResMode");</p> <p>Context.setResponsebean ("Body", DATABEAN); SetHead (Context);</p> <p>}</p> <p>Public void next (DispatchContext Context, Bodybean DataBean) {</p> <p>DATABEAN.SETVERB ("Reqmode");</p> <p>Context.setResponseBean ("Body", DATABEAN;</p> <p>Sethead (context);</p> <p>}</p> <p>Public void startup (dispatchContext context) {</p> <p>Bodybean DataBean = New bodybean ();</p> <p>DATABEAN.SETVERB ("Reqmode");</p> <p>Context.setResponseBean ("Body", DATABEAN;</p> <p>Sethead (context);</p> <p>}</p> <p>PRIVATE Headbean Headbean;</p> <p>Private void sethead (DispatchContext context) {</p> <p>IF (headbean == null) {</p> <p>Headbean = new headbean ();</p> <p>Headbean.setlogintime (new java.util.date ());</p> <p>}</p> <p>Headbean.setcount (headbean.getcount () 1);</p> <p>Context.setResponseBean ("Head", Headbean;</p> <p>}</p> <p>}</p> <p>l Handler class extension com.fujitsu.uji.GenericHandler, mainly containing processing methods corresponding to the action command (defined in Commands.map)</p> <p>l Treatment method usually has two parameters:</p> <p>Ø Context: context environment variable object</p> <p>Ø DATABEAN: Currently handler corresponding to the DataBean object</p> <p>l Use the passed DataBean object to access the data in the DATABEAN (getter / setter)</p> <p>l DATABEAN.SETVERB () method Specifies the migration of the screen (defined in pages.map)</p> <p>l Context.SetResponseBean () Method Specifies the DATABEAN of the response page, the first parameter should be consistent with the value of the PANE attribute value in main.jsp, the second parameter is the DATABEAN of the response page.</p> <p>l Samples will be confusing in logic control because of the use of the same Handler and DataBean. It is not worth recommending.</p> <p>l Used in the actual application given below: 0115Handler migrates from 0115 screen to 0110 picture</p> <p>Public void goto_0110 (DispatchContext Context, EFT_0115Bean Databean) {</p> <p>...</p> <p>EFT_0110Bean EFT0110Bean = New EFT_0110Bean ();</p> <p>EFT0110Bean.SetLDC (DataBean.getLDC ());</p> <p>EFT0110Bean.SetVerb ("resmode");</p> <p>Context.setResponsebean ("Body", EFT0110Bean;</p> <p>}</p> <p>l Startup () is a special method. According to the definition in Commands.map, it will be called when the application starts to display the specified first screen.</p> <p>6, relationship definition file</p> <p>l Commands.map</p> <p># Commands.map</p> <p>Sample.bodybean; add = sample.samplehandler.ad</p> <p>Sample.bodybean; sub = sample.samplehandler.sub</p> <p>Sample.Bodybean; Next = sample.samplehandler.next</p> <p>; = Sample.SampleHandler.Startup</p> <p>l Commands.map line format is: DataBean full path; action command name = handler full path. Method name</p> <p>l The last row is more special, specifying the application of the corresponding handler when the application starts, no DATABEAN full path and action command name</p> <p>l Pages.map</p> <p># pages.map</p> <p>Sample.Headbean; = header.jsp</p> <p>Sample.bodybean; reqmode = request.jsp</p> <p>Sample.Bodybean; ResMode = response.jsp</p> <p>l Pages.map line format is: DATABEAN full path; [Migration Name] = Migration page</p> <p>l For pages that do not need to be migrated, do not specify migration names</p></div><div class="text-center mt-3 text-grey"> 转载请注明原文地址:https://www.9cbs.com/read-103533.html</div><div class="plugin d-flex justify-content-center mt-3"></div><hr><div class="row"><div class="col-lg-12 text-muted mt-2"><i class="icon-tags mr-2"></i><span class="badge border border-secondary mr-2"><h2 class="h6 mb-0 small"><a class="text-secondary" href="tag-2.html">9cbs</a></h2></span></div></div></div></div><div class="card card-postlist border-white shadow"><div class="card-body"><div class="card-title"><div class="d-flex justify-content-between"><div><b>New Post</b>(<span class="posts">0</span>) </div><div></div></div></div><ul class="postlist list-unstyled"> </ul></div></div><div class="d-none threadlist"><input type="checkbox" name="modtid" value="103533" checked /></div></div></div></div></div><footer class="text-muted small bg-dark py-4 mt-3" id="footer"><div class="container"><div class="row"><div class="col">CopyRight © 2020 All Rights Reserved </div><div class="col text-right">Processed: <b>0.034</b>, SQL: <b>9</b></div></div></div></footer><script src="./lang/en-us/lang.js?2.2.0"></script><script src="view/js/jquery.min.js?2.2.0"></script><script src="view/js/popper.min.js?2.2.0"></script><script src="view/js/bootstrap.min.js?2.2.0"></script><script src="view/js/xiuno.js?2.2.0"></script><script src="view/js/bootstrap-plugin.js?2.2.0"></script><script src="view/js/async.min.js?2.2.0"></script><script src="view/js/form.js?2.2.0"></script><script> var debug = DEBUG = 0; var url_rewrite_on = 1; var url_path = './'; var forumarr = {"1":"Tech"}; var fid = 1; var uid = 0; var gid = 0; xn.options.water_image_url = 'view/img/water-small.png'; </script><script src="view/js/wellcms.js?2.2.0"></script><a class="scroll-to-top rounded" href="javascript:void(0);"><i class="icon-angle-up"></i></a><a class="scroll-to-bottom rounded" href="javascript:void(0);" style="display: inline;"><i class="icon-angle-down"></i></a></body></html><script> var forum_url = 'list-1.html'; var safe_token = 'nmPUx6BccgLXmf0lAim5hIY4c_2FazNk4YUSmgKxQCz4SbryZuJa_2BUptkAi27UAjDrPDWgQgaBA7kGxFIE_2BcdoXQ_3D_3D'; var body = $('body'); body.on('submit', '#form', function() { var jthis = $(this); var jsubmit = jthis.find('#submit'); jthis.reset(); jsubmit.button('loading'); var postdata = jthis.serializeObject(); $.xpost(jthis.attr('action'), postdata, function(code, message) { if(code == 0) { location.reload(); } else { $.alert(message); jsubmit.button('reset'); } }); return false; }); function resize_image() { var jmessagelist = $('div.message'); var first_width = jmessagelist.width(); jmessagelist.each(function() { var jdiv = $(this); var maxwidth = jdiv.attr('isfirst') ? first_width : jdiv.width(); var jmessage_width = Math.min(jdiv.width(), maxwidth); jdiv.find('img, embed, iframe, video').each(function() { var jimg = $(this); var img_width = this.org_width; var img_height = this.org_height; if(!img_width) { var img_width = jimg.attr('width'); var img_height = jimg.attr('height'); this.org_width = img_width; this.org_height = img_height; } if(img_width > jmessage_width) { if(this.tagName == 'IMG') { jimg.width(jmessage_width); jimg.css('height', 'auto'); jimg.css('cursor', 'pointer'); jimg.on('click', function() { }); } else { jimg.width(jmessage_width); var height = (img_height / img_width) * jimg.width(); jimg.height(height); } } }); }); } function resize_table() { $('div.message').each(function() { var jdiv = $(this); jdiv.find('table').addClass('table').wrap('<div class="table-responsive"></div>'); }); } $(function() { resize_image(); resize_table(); $(window).on('resize', resize_image); }); var jmessage = $('#message'); jmessage.on('focus', function() {if(jmessage.t) { clearTimeout(jmessage.t); jmessage.t = null; } jmessage.css('height', '6rem'); }); jmessage.on('blur', function() {jmessage.t = setTimeout(function() { jmessage.css('height', '2.5rem');}, 1000); }); $('#nav li[data-active="fid-1"]').addClass('active'); </script>