`
okcomputer2009
  • 浏览: 35120 次
  • 性别: Icon_minigender_1
  • 来自: singapore
社区版块
存档分类
最新评论
文章列表
7. Exception Handling with Struts An exception handler allows you to declaratively handle an exception in the struts-config.xml file by associating an exception to a user friendly message and a user friendly JSP page that will display if the exception occurs.   Struts-config.xml <action path=& ...
  <html:errors property=”firstName”/> Output the errors associated with this form with html:errors tag. ActionForms have a validate method that can return ActionErrors.      <bean:message key="userRegistration.firstName" />        When you want to output labels in the JSP f ...
3. ActionForm类 ActionForms represents request data coming from the browser. ActionForms are used to populate HTML forms to display to end users and to collect data from HTML forms.   Create JavaBean properties for all the fields that you want to collect from the HTML form. Each getter and setter p ...
  1.    Action类 Actions respond to requests. 它收到browser用户请求(这个请求包含一些列信息),并最终返回一个ActionForward对象名为success作为output view. That output view will be a plain old JSP.   import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.apache.struts.action.Action;
The primary feature of JSP 2.0 is its support for an expression language(EL). An expression language makes it possible to easily access application data stored in javabeans components.   Active and Deactive EL: <%@page isELIgnored=”false | true”%>     EL可以被用在哪里? l         静态文本 ${“static ...
JSTL: Jsp Standard Tag Libraries   JSTL is a collection of custom tags libraries. It provides common functionality that many web applications need. JSTL provides support for presentation logic (core), formatting (format), XML support (XML) and database access (SQL).   Expression Language (EL) On ...
<logic:iterate /> Iterates over a collection, enumerator, iterator, map, or array. It evaluates its body for each item in the collection.   collection是对象的一个属性(在request scope中存在的对象 tagInfo 的 属性 objHobbies是一个 collection)  
<logic:messagesPresent property="property1" message="true"> Message:property1 存在 </logic:messagesPresent> 我们知道,在Action类中我们可以通过将一个ActionErrors或ActionMessages对象添加进request scope saveMessages(request, msgs);
选择标签: 必须是select与其他标签如:option,options和optionsCollection配合使用     <html:select property="selectedCareers" multiple="true">        <html:optionsCollection
Multibox标签的用法: <logic:iterate id="hobby" name="tagInfo" property="hobbies">        <html:multibox property="selectedHobbies">           
信息标签 <html:messages /> Displays a set of messages prepared by a business logic component and stored as an ActionMessages object, ActionErrors object, a String, or a String array in any scope. If such a bean is not found, nothing will be rendered. The messages are placed into the page scope in ...
超链接标签 <html:link/> There are 4 options for rendering the URL of a hyperlink. href, action, forward, page   <html:link forward="global_forward001">Link1</html:link> forward属性表示去struts-config.
几种按钮类型的标签     <html:button property="normalButton" value="只是一个普通按钮" />    只是一个普通按钮,当点击以后不能产生任何作用。要产生作用的话,必须调用事件,如:onclick="form.submit()" 这样也可以是表单提交
最后一种映射类型,就是实体与标量值的组合       @SqlResultSetMapping     (        name="ReturnOrderListWithPartEntityPartScalarType",        entities=        {
OK,现在对同一个查询,再把结果集全部映射进实体对象。   首先 @NamedNativeQueries (     {        @NamedNativeQuery(            name="ReturnOrderListWithFullEntityType",               query="select o.id as order_id,o.create_date as order_creation_date,o.description as order_description,o
Global site tag (gtag.js) - Google Analytics