Jsp/Java代码分离.实现页面真正的代码分离 测试代码是否按想法运行,下载原代码
来源:互联网 发布:删除Mac本上的图片 编辑:程序博客网 时间:2024/05/17 00:03
配置对应的WEB.XML
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<filter>
<filter-name>jxdoPageFilter</filter-name>
<filter-class>JXDO.WebUI.BasePageFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>jxdoPageFilter</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping>
<jsp-config>
<taglib>
<taglib-uri>http://jxdo.webui</taglib-uri>
<taglib-location>/WEB-INF/lib/JXDO.WebUI.jar</taglib-location>
</taglib>
<jsp-property-group>
<url-pattern>*.jsp</url-pattern>
<page-encoding>utf-8</page-encoding>
</jsp-property-group>
</jsp-config>
</web-app>
<web-app version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<filter>
<filter-name>jxdoPageFilter</filter-name>
<filter-class>JXDO.WebUI.BasePageFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>jxdoPageFilter</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping>
<jsp-config>
<taglib>
<taglib-uri>http://jxdo.webui</taglib-uri>
<taglib-location>/WEB-INF/lib/JXDO.WebUI.jar</taglib-location>
</taglib>
<jsp-property-group>
<url-pattern>*.jsp</url-pattern>
<page-encoding>utf-8</page-encoding>
</jsp-property-group>
</jsp-config>
</web-app>
编写index.jsp页面
<%...@ page language="java" pageEncoding="utf-8"%>
<%...@ taglib prefix="jxui" uri="http://jxdo.webui" %>
<jxui:page codeBehind="index.java"/>
<html>
<head><title>test Page</title></head>
<body>
<jxui:form id="frmid">
<jxui:textbox id="tName"/>
<input type="button"
value="submit"
name="button1"
onclick="__doPostBack(this.name,'onclick');">
</jxui:form>
</body>
</html>
<%...@ taglib prefix="jxui" uri="http://jxdo.webui" %>
<jxui:page codeBehind="index.java"/>
<html>
<head><title>test Page</title></head>
<body>
<jxui:form id="frmid">
<jxui:textbox id="tName"/>
<input type="button"
value="submit"
name="button1"
onclick="__doPostBack(this.name,'onclick');">
</jxui:form>
</body>
</html>
编写后台代码index.java
public class index extends JXDO.WebUI.BasePage
...{
protected JXDO.WebUI.TextBox tName;
public void Page_Load()throws Exception
...{
if(!this.isPostBack)this.tName.setText("javasuki代码分离");
}
public void button1_onclick()throws Exception
...{
this.out.print(this.tName.getText());
}
public void Page_Unload()throws Exception
...{
}
}
...{
protected JXDO.WebUI.TextBox tName;
public void Page_Load()throws Exception
...{
if(!this.isPostBack)this.tName.setText("javasuki代码分离");
}
public void button1_onclick()throws Exception
...{
this.out.print(this.tName.getText());
}
public void Page_Unload()throws Exception
...{
}
}
整个框架与测试代码下载
- Jsp/Java代码分离.实现页面真正的代码分离 测试代码是否按想法运行,下载原代码
- Jsp/Java代码分离.实现页面真正的代码分离 实现框架代码,jxui:page标签
- Jsp/Java代码分离.实现页面真正的代码分离 实现框架代码:BasePage,TextBox,BasePageFilter
- Jsp/Java代码分离.实现页面真正的代码分离 前言
- Jsp/Java代码分离.实现页面真正的代码分离 设计原理
- jsp标签实现页面与代码分离
- 使用自定义标签实现JSP页面和Java代码分离
- 使用自定义标签实现JSP页面和代码的分离
- 使用自定义标签实现JSP页面和代码的分离
- 使用JavaBean实现JSP页面和代码分离
- PHP中页面与代码分离的实现
- PHP中页面与代码分离的实现
- PHP中页面与代码分离的实现
- 关于页面和代码分离的
- Asp中代码与页面的分离
- 关于Asp代码与页面的分离
- CommunityServer中的代码页面分离
- 关于页面和代码分离
- virtual pc 2007(vpc2007) 使用中无法显示控制主界面的解决方法
- Oracle的RBO和CBO优化
- php 常用学习站点
- Window Mobile 打包过程2
- 消息队列(Message Queue)简介及其使用
- Jsp/Java代码分离.实现页面真正的代码分离 测试代码是否按想法运行,下载原代码
- 拨叉设计
- mysql中使用grant增加用户和权限,以及mysq加密函数
- JS判断文件上传大小
- ubuntu 7.10 的源 北方网通
- 关于.NET邮件的收发问题总结(带附件)
- msql基本语句使用...
- Funnypoint.SQL
- 数控编程的几何基础