隨筆-159  評論-114  文章-7  trackbacks-0
          <% @?page?contentType = " text/html;charset=gbk " ?pageEncoding = " gbk " ? %>
          <% @?page?language = " java " %>
          <% @?taglib?uri = " http://jakarta.apache.org/struts/tags-bean " ?prefix = " bean " %> ?
          <% @?taglib?uri = " http://jakarta.apache.org/struts/tags-html " ?prefix = " html " %>
          <% @?page?import = " com.infogo.data.CodeManager " %>
          <%
          ?pageContext.setAttribute(
          " paymentMap " ,CodeManager.getInstance().getPaymentStyle());
          %>
          < html > ?
          ?
          < head >
          ??
          < title > JSP?for?newuserForm?form </ title >
          ?
          </ head >
          ?
          < body >
          ??
          < html:form? action ="/newuser.do" >
          ???name?:?
          < html:text? property ="name" />< html:errors? property ="name" />< br />
          ???password?:?
          < html:text? property ="password" />< html:errors? property ="password" />< br />
          ???sex?:?男
          < html:radio? property ="sex" ?value ="1" /> ?女 < html:radio? property ="sex" ?value ="2" />< html:errors? property ="sex" />< br />
          ???
          < html:select? property ="paymentStyle" >
          ????
          < html:options? collection ="paymentMap" ?property ="key" ?labelProperty ="value" />
          ???
          </ html:select >
          ???
          < html:submit />< html:cancel />
          ??
          </ html:form >
          ?
          </ body >
          </ html >

          ?

          package ?com.infogo.data;

          import ?java.util.HashMap;
          import ?java.util.Map;

          public ? class ?CodeManager? {
          ????
          ????
          private ? static ?CodeManager?_instance? = ? new ?CodeManager();

          ????
          private ?Map?paymentStyle? = ? new ?HashMap();
          ????
          ????
          private ?CodeManager()? {
          ????????
          super ();
          ????????paymentStyle.put(
          new ?Integer( 1 ), " 網上支付 " );
          ????????paymentStyle.put(
          new ?Integer( 2 ), " 信用卡 " );
          ????}

          ????
          ????
          public ? static ?CodeManager?getInstance()
          ????
          {
          ????????
          return ?_instance;
          ????}

          ????
          ????
          public ?Map?getPaymentStyle()
          ????
          {
          ????????
          return ? this .paymentStyle;
          ????}


          }



          ?

          // Created?by?MyEclipse?Struts
          // ?XSL?source?(default):?platform:/plugin/com.genuitec.eclipse.cross.easystruts.eclipse_4.1.0/xslt/JavaClass.xsl

          package ?com.infogo.struts.form;

          import ?javax.servlet.http.HttpServletRequest;

          import ?org.apache.struts.action.ActionErrors;
          import ?org.apache.struts.action.ActionForm;
          import ?org.apache.struts.action.ActionMapping;

          /** ?
          ?*?MyEclipse?Struts
          ?*?Creation?date:?04-19-2006
          ?*?
          ?*?XDoclet?definition:
          ?*?@struts.form?name="newuserForm"
          ?
          */

          public ? class ?NewuserForm? extends ?ActionForm? {

          ????
          // ?---------------------------------------------------------?Instance?Variables

          ????
          /** ?sex?property? */
          ????
          private ?Integer?sex? = ? new ?Integer( 1 );

          ????
          /** ?password?property? */
          ????
          private ?String?password;

          ????
          /** ?name?property? */
          ????
          private ?String?name;
          ????
          ????
          private ?Integer?paymentStyle;

          ????
          // ?---------------------------------------------------------?Methods

          ????
          public ?Integer?getPaymentStyle()? {
          ????????
          return ?paymentStyle;
          ????}


          ????
          public ? void ?setPaymentStyle(Integer?paymentStyle)? {
          ????????
          this .paymentStyle? = ?paymentStyle;
          ????}


          ????
          /** ?
          ?????*?Method?validate
          ?????*?
          @param ?mapping
          ?????*?
          @param ?request
          ?????*?
          @return ?ActionErrors
          ?????
          */

          ????
          public ?ActionErrors?validate(
          ????????ActionMapping?mapping,
          ????????HttpServletRequest?request)?
          {

          ????????
          // ?TODO?Auto-generated?method?stub
          ???????? return ? null ;
          ????}


          ????
          /** ?
          ?????*?Method?reset
          ?????*?
          @param ?mapping
          ?????*?
          @param ?request
          ?????
          */

          ????
          public ? void ?reset(ActionMapping?mapping,?HttpServletRequest?request)? {

          ????????
          // ?TODO?Auto-generated?method?stub
          ????}


          ????
          /** ?
          ?????*?Returns?the?sex.
          ?????*?
          @return ?Integer
          ?????
          */

          ????
          public ?Integer?getSex()? {
          ????????
          return ?sex;
          ????}


          ????
          /** ?
          ?????*?Set?the?sex.
          ?????*?
          @param ?sex?The?sex?to?set
          ?????
          */

          ????
          public ? void ?setSex(Integer?sex)? {
          ????????
          this .sex? = ?sex;
          ????}


          ????
          /** ?
          ?????*?Returns?the?password.
          ?????*?
          @return ?String
          ?????
          */

          ????
          public ?String?getPassword()? {
          ????????
          return ?password;
          ????}


          ????
          /** ?
          ?????*?Set?the?password.
          ?????*?
          @param ?password?The?password?to?set
          ?????
          */

          ????
          public ? void ?setPassword(String?password)? {
          ????????
          this .password? = ?password;
          ????}


          ????
          /** ?
          ?????*?Returns?the?name.
          ?????*?
          @return ?String
          ?????
          */

          ????
          public ?String?getName()? {
          ????????
          return ?name;
          ????}


          ????
          /** ?
          ?????*?Set?the?name.
          ?????*?
          @param ?name?The?name?to?set
          ?????
          */

          ????
          public ? void ?setName(String?name)? {
          ????????
          this .name? = ?name;
          ????}


          }


          ?

          // Created?by?MyEclipse?Struts
          // ?XSL?source?(default):?platform:/plugin/com.genuitec.eclipse.cross.easystruts.eclipse_4.1.0/xslt/JavaClass.xsl

          package ?com.infogo.struts.action;

          import ?javax.servlet.http.HttpServletRequest;
          import ?javax.servlet.http.HttpServletResponse;

          import ?org.apache.struts.action.ActionForm;
          import ?org.apache.struts.action.ActionForward;
          import ?org.apache.struts.action.ActionMapping;
          import ?org.apache.struts.actions.MappingDispatchAction;

          import ?com.infogo.struts.form.NewuserForm;

          /** ?
          ?*?MyEclipse?Struts
          ?*?Creation?date:?04-19-2006
          ?*?
          ?*?XDoclet?definition:
          ?*?@struts.action?path="/newuser"?name="newuserForm"?input="/user/user.jsp"?scope="request"?validate="true"
          ?
          */

          public ? class ?NewuserAction? extends ?MappingDispatchAction? {

          ????
          // ?---------------------------------------------------------?Instance?Variables

          ????
          // ?---------------------------------------------------------?Methods

          ????
          /** ?
          ?????*?Method?execute
          ?????*?
          @param ?mapping
          ?????*?
          @param ?form
          ?????*?
          @param ?request
          ?????*?
          @param ?response
          ?????*?
          @return ?ActionForward
          ?????
          */

          ????
          public ?ActionForward?execute(
          ????????ActionMapping?mapping,
          ????????ActionForm?form,
          ????????HttpServletRequest?request,
          ????????HttpServletResponse?response)?
          {
          ????????NewuserForm?newuserForm?
          = ?(NewuserForm)?form;
          ????????System.out.println(
          " [SEX]: " ? + ?newuserForm.getSex());
          ????????System.out.println(
          " [PAYMENTSTYLE]: " ? + ?newuserForm.getPaymentStyle());
          ????????
          return ? null ;
          ????}


          }


          ?

          <? xml?version="1.0"?encoding="UTF-8" ?>
          <! DOCTYPE?struts-config?PUBLIC?"-//Apache?Software?Foundation//DTD?Struts?Configuration?1.2//EN"?"http://struts.apache.org/dtds/struts-config_1_2.dtd"? >
          < struts-config >
          ????
          < form-beans >
          ????????
          < form-bean? name ="newuserForm" ?type ="com.infogo.struts.form.NewuserForm" ? />
          ????
          </ form-beans >
          ????
          < action-mappings >
          ????
          < action
          ??????
          attribute ="newuserForm"
          ??????input
          ="/user.jsp"
          ??????name
          ="newuserForm"
          ??????path
          ="/newuser"
          ??????scope
          ="request"
          ??????type
          ="com.infogo.struts.action.NewuserAction" ? />
          ????
          < action? forward ="/user.jsp" ?path ="/toAdd" ? />
          ????????
          ????
          </ action-mappings >
          ????
          < message-resources? parameter ="com.infogo.struts.ApplicationResources" ? />
          </ struts-config >


          ?=======================

          <% @?page?contentType = " text/html;charset=gbk " ?pageEncoding = " gbk " ? %>
          <% @?page?language = " java " %>
          <% @?taglib?uri = " http://jakarta.apache.org/struts/tags-bean " ?prefix = " bean " %> ?
          <% @?taglib?uri = " http://jakarta.apache.org/struts/tags-html " ?prefix = " html " %>
          <% @?taglib?uri = " http://struts.apache.org/tags-logic " ?prefix = " logic " %>
          <% @?page?import = " com.infogo.data.CodeManager " %>
          <%
          ????pageContext.setAttribute(
          " paymentMap " ,CodeManager.getInstance().getPaymentStyle());
          ????pageContext.setAttribute(
          " pricingList " ,CodeManager.getInstance().getPricingList());
          %>
          < html > ?
          ????
          < head >
          ????????
          < title > JSP?for?newuserForm?form </ title >
          ????
          </ head >
          ????
          < body >
          ????????
          < html:form? action ="/newuser.do" >
          ????????????name?:?
          < html:text? property ="name" />< html:errors? property ="name" />< br />
          ????????????password?:?
          < html:text? property ="password" />< html:errors? property ="password" />< br />
          ????????????sex?:?男
          < html:radio? property ="sex" ?value ="1" /> ?女 < html:radio? property ="sex" ?value ="2" />< html:errors? property ="sex" />< br />
          ????????????
          < html:select? property ="paymentStyle" >
          ????????????????
          < html:options? collection ="paymentMap" ?property ="key" ?labelProperty ="value" />
          ????????????
          </ html:select >
          ????????????
          < html:submit />< html:cancel />
          ????????
          </ html:form >
          ????????
          <% -- ?? < logic:iterate?id = " pricing " ?collection = " <%=CodeManager.getInstance().getPricingList()%> " > ? -- %>
          ????????
          < logic:iterate? id ="pricing" ?name ="pricingList" >
          ????????????
          < bean:write? name ="pricing" ?property ="pricingName" />
          ????????????
          < html:link? target ="_blank" ?action ="/user/toAdd.do" ?paramId ="pid" ?paramName ="pricing" ?paramProperty ="id" > pricing </ html:link >
          ????????
          </ logic:iterate >
          ????????
          ????
          </ body >
          </ html >


          主站蜘蛛池模板: 根河市| 喀什市| 香港 | 保德县| 张北县| 开封市| 集安市| 凭祥市| 黑水县| 达州市| 安福县| 商河县| 科技| 江安县| 昆山市| 乌恰县| 舒城县| 巴彦县| 商洛市| 含山县| 巴中市| 浠水县| 大理市| 房产| 肥西县| 习水县| 景德镇市| 常宁市| 丘北县| 中西区| 始兴县| 金川县| 桃源县| 宜宾县| 巩留县| 都兰县| 芦山县| 连城县| 磐安县| 扶风县| 珠海市|