|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
那这个对象有什么意义?现在很多用javabean的人就不能保证对象有完整的意义,不成熟的使用模式等导致代码疯狂增长,调试维护的时间要得多得多。在说性能之前,先说说你这个比较的来历。据说微软为了证明。net比java好。
【hello.jsp】内容:
<%@pagecontentType="text/html;charset=UTF-8"language="java"%>
<%@tagliburi="/WEB-INF/struts-bean.tld"prefix="bean"%><%@tagliburi="/WEB-INF/struts-html.tld"prefix="html"%><%@tagliburi="/WEB-INF/struts-logic.tld"prefix="logic"%>
<html:htmllocale="true"><head><title><bean:messagekey="hello.jsp.title"/></title><html:base/></head>
<body><p><h2><bean:messagekey="hello.jsp.page.heading"/></h2></p><html:errors/><p><logic:presentname="helloForm"scope="request"><h2>Hello<bean:writename="helloForm"property="person"/>!</h2></logic:present>
<html:formaction="helloWorld.do"focus="person"><bean:messagekey="hello.jsp.prompt.person"/><html:textproperty="person"size="20"maxlength="20"/><br><html:submitproperty="submit"value="提交"/><html:reset/></html:form><br>
<html:imgpage="/struts-power.jpg"alt="PoweredbyStruts"/></body>
</html:html>
【struts-config.xml】内容:
<?xmlversion="1.0"encoding="UTF-8"?><!DOCTYPEstruts-configPUBLIC"-//ApacheSoftwareFoundation//DTDStrutsConfiguration1.1//EN""http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd">
<struts-config><form-beans><form-beanname="helloForm"type="com.javer.test.struts.HelloFrom"/></form-beans>
<action-mappings><actionpath="/helloWorld"type="com.javer.test.struts.HelloAction"name="helloForm"scope="request"validate="true"input="/hello.jsp"><forwardname="SayHello"path="/hello.jsp"/></action></action-mappings>
<message-resourcesparameter="com.javer.test.struts.Application"/></struts-config>
【web.xml】内容:
<?xmlversion="1.0"encoding="UTF-8"?><!DOCTYPEweb-appPUBLIC"-//SunMicrosystems,Inc.//DTDWebApplication2.3//EN""http://java.sun.com/dtd/web-app_2_3.dtd"><web-app><filter><filter-name>TheWebappFrameworkSetCharacterEncoding</filter-name><filter-class>com.javer.test.struts.EncodingFilter</filter-class><init-param><param-name>encoding</param-name><param-value>UTF-8</param-value></init-param></filter><filter-mapping><filter-name>TheWebappFrameworkSetCharacterEncoding</filter-name><url-pattern>/*</url-pattern></filter-mapping>
<servlet><servlet-name>action</servlet-name><servlet-class>org.apache.struts.action.ActionServlet</servlet-class><init-param><param-name>config</param-name><param-value>/WEB-INF/struts-config.xml</param-value></init-param><load-on-startup>2</load-on-startup></servlet>
<servlet-mapping><servlet-name>action</servlet-name><url-pattern>*.do</url-pattern></servlet-mapping>
<taglib><taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri><taglib-location>/WEB-INF/lib/struts-bean.tld</taglib-location></taglib><taglib><taglib-uri>/WEB-INF/struts-html.tld</taglib-uri><taglib-location>/WEB-INF/lib/struts-html.tld</taglib-location></taglib><taglib><taglib-uri>/WEB-INF/struts-logic.tld</taglib-uri><taglib-location>/WEB-INF/lib/struts-logic.tld</taglib-location></taglib></web-app>
市场分额,java比asp高一点,因为C#是仿照java开发的,所以哦C#能做的java都能做到,但是java能做的,C#不一定都能做到。毕竟是抄袭吗。 |
|