これ
http://www.microsoft.com/japan/athome/umall/win7/lucky7/default.aspx
(^^;)
ラッキー池田がいないのは?
ラッキィじゃないからか(^^;)
(じゃなくって、七福神じゃないだろって ^^;)
<html> <head> <script type="text/javascript"> <!-- function bijin() { window.open("http://www.gmodules.com/ig/ifr?url=http://bijint.com/bijint.xml&synd=open&w=240&h=320&title=%E7%BE%8E%E4%BA%BA%E6%99%82%E8%A8%88%EF%BC%88bijin-tokei%EF%BC%89&border=%23ffffff%7C3px%2C1px+solid+%23999999","_blank", "toolbar=no,status=no,scrollbars=no,location=no,menubar=no,directories=no,width=240,height=320"); window.close(); } //--> </script> </head> <body> </BODY> <INPUT TYPE=BUTTON onClick="bijin()"value="美人時計"/> </html> |
●レーンテーブル (レーンID,ロール(レーン名),親レーンID) ●エッジテーブル (エッジID,エッジ種別、元ノード等ID,先ノード等ID,エッジ説明) ●エッジコネクタテーブル (コネクタID,番号等) ●動作ノード(アクション)テーブル (動作ノードID,動作名、所属レーンID、親動作ノードID,動作ノード種別) ●オブジェクトノードテーブル (オブジェクトノードID、オブジェクト名、親オブジェクトノードID,オブジェクト種別) ●制御ノードテーブル* (制御ノードID,制御ノード種別) ●コメントテーブル (コメントID,コメント内容) |
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %> <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %> <%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %> <%@ page contentType="text/html; charset=utf-8" %> <html:html> <HEAD> <TITLE>検索</TITLE> <script type="text/javascript" language="javascript"> <!-- function zikko() { where = ""; where = addwhere(where,selectForm.basho.value,"LOC","'"); where = addwhere(where,selectForm.dname.value,"DNAME","'"); selectForm.para.value = "SELECT * FROM DEPT"; if ( where != "" ) { selectForm.para.value += " WHERE " + where; } selectForm.submit(); } function addwhere(where,val,key,flg) { if (val != "") { if ( where != "" ) { where += " AND"; } where += ( " "+ key+ "=" + flg + val + flg ); } return where; } // --> </script> </HEAD> <BODY> <html:form action="/select"> <html:hidden property="para"/> 場所<INPUT TYPE=text NAME="basho" size="6"/><BR> 名前<INPUT TYPE=text NAME="dname" size="6"/><BR> <html:button property="b1" onclick="zikko()">検索実行</html:button> </html:form> </BODY> </html:html> |
package dbsample; import org.apache.struts.action.*; public class selectActionForm extends ActionForm { private String para; public String getPara() { return para; } public void setPara(String para) { this.para = para; } } |
package dbsample; import java.sql.*; import java.util.*; import javax.servlet.http.*; import org.apache.struts.action.*; import java.io.*; public class selectAction extends Action { public ActionForward execute( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { // 画面パラメータの取得 selectActionForm myForm = (selectActionForm)form; // セッションの取得 HttpSession session = request.getSession(); try { Connection con = null; Statement stmt = null; // DB接続(testデータベースに、ログイン名root,パスワードpasswordの場合) Class.forName("org.gjt.mm.mysql.Driver"); con = DriverManager.getConnection("jdbc:mysql:///test","root","password"); stmt = con.createStatement(); // SQL(画面から引数para)実行 ResultSet rs = stmt.executeQuery(myForm.getPara()); // 結果をArrayListに ArrayList<HashMap<String,String>> result = new ArrayList<HashMap<String,String>>(); while(rs.next()) // 行数分処理 { HashMap<String,String> map = new HashMap<String,String>(); // 項目数分出力 for(int j = 1 ; j <= rs.getMetaData().getColumnCount() ; j ++) { map.put(rs.getMetaData().getColumnName(j), rs.getString(j)); } result.add(map); } // あとしまつ stmt.close(); con.close(); // 結果をセッションにいれる session.setAttribute("result",result); session.setAttribute("kekka",""); } catch(Exception e) { session.removeAttribute("result"); session.setAttribute("kekka",e.toString()); return mapping.findForward("error"); } return mapping.findForward("success"); } } |
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %> <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %> <%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %> <%@ page contentType="text/html; charset=utf-8" %> <HTML> <HEAD> <TITLE>検索結果</TITLE> </HEAD> <BODY> 結果<BR> <table border=1> <tbody> <logic:notEmpty name="result" scope="session"> <logic:iterate id="me" name="result" scope="session" indexId="idx"> <tr> <td><bean:write name="me" property="DEPTNO" /></td> <td><bean:write name="me" property="DNAME" /></td> <td><bean:write name="me" property="LOC" /></td> </tr> </logic:iterate> </logic:notEmpty> </tbody> </table><BR> <A HREF="index.jsp">戻る</A> </BODY> </HTML> |
<%@ page contentType="text/html; charset=utf-8" %> <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %> <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %> <%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %> <HTML> <HEAD> <TITLE>エラー</TITLE> </HEAD> <BODY> <H2> <bean:write name="kekka" scope="session"/> </H2> <A HREF="index.jsp">戻る</A> </BODY> </HTML> |
<?xml version="1.0" encoding="ISO-8859-1" ?> <!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.3//EN" "http://struts.apache.org/dtds/struts-config_1_3.dtd"> <struts-config> <form-beans> <form-bean name="selectForm" type="dbsample.selectActionForm"/> </form-beans> <action-mappings> <action path="/select" type="dbsample.selectAction" name="selectForm" scope="request" validate="false"> <forward name="success" path="/kekka.jsp"/> <forward name="error" path="/error.jsp"/> </action> </action-mappings> </struts-config> |
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %> <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %> <%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %> <%@ page contentType="text/html; charset=utf-8" %> <html:html> <HEAD> <TITLE>検索</TITLE> <script type="text/javascript" language="javascript"> <!-- function zikko() { where = ""; where = addwhere(where,selectForm.basho.value,"LOC","'"); where = addwhere(where,selectForm.dname.value,"DNAME","'"); where = addwhere(where,selectForm.deptno.value,"DEPTNO",""); selectForm.para.value = "SELECT * FROM DEPT"; if ( where != "" ) { selectForm.para.value += " WHERE " + where; } selectForm.submit(); } function addwhere(where,val,key,flg) { if (val != "") { if ( where != "" ) { where += " AND"; } where += ( " "+ key+ "=" + flg + val + flg ); } return where; } // --> </script> </HEAD> <BODY> <html:form action="/select"> <html:hidden property="para"/> 場所<INPUT TYPE=text NAME="basho" size="6"/><BR> 名前<INPUT TYPE=text NAME="dname" size="6"/><BR> 番号<INPUT TYPE=text NAME="deptno" size="6"/><BR> <html:button property="b1" onclick="zikko()">検索実行</html:button> </html:form> </BODY> </html:html> |
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %> <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %> <%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %> <%@ page contentType="text/html; charset=utf-8" %> <html:html> <HEAD> <TITLE>足し算</TITLE> </HEAD> <SCRIPT language="JavaScript"> <!-- function tashizan() { tashizanForm.submit(); } function hikizan() { hikizanForm.parm1.value=tashizanForm.parm1.value; hikizanForm.parm2.value=tashizanForm.parm2.value; hikizanForm.submit(); } // --> </SCRIPT> <BODY> <html:form action="/tashizan" focus="parm1"> <html:text property="parm1" size="6"/>と <html:text property="parm2" size="6"/>を<BR> <html:button property="tasu" onclick="tashizan()">足す</html:button> <html:button property="hiku" onclick="hikizan()">引く</html:button> </html:form> <html:form action="/hikizan"> <html:hidden property="parm1"/> <html:hidden property="parm2"/> </html:form> </BODY> </html:html> |
package tashizan; import org.apache.struts.action.*; public class tashizanActionForm extends ActionForm { private String parm1; private String parm2; public String getParm1() { return parm1; } public void setParm1(String parm1) { this.parm1 = parm1; } public void setParm2(String parm2) { this.parm2 = parm2; } public String getParm2() { return parm2; } } |
ackage tashizan; import org.apache.struts.action.*; public class hikizanActionForm extends ActionForm { private String parm1; private String parm2; public String getParm1() { return parm1; } public void setParm1(String parm1) { this.parm1 = parm1; } public void setParm2(String parm2) { this.parm2 = parm2; } public String getParm2() { return parm2; } } |
package tashizan; import javax.servlet.http.*; import org.apache.struts.action.*; public class tashizanAction extends Action { public ActionForward execute( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { tashizanActionForm myForm = (tashizanActionForm)form; HttpSession session = request.getSession(); String nextStep="success"; // 次画面 try { int i1 = Integer.parseInt(myForm.getParm1()); int i2 = Integer.parseInt(myForm.getParm2()); session.setAttribute("kekka", String.valueOf(i1+i2)); nextStep = "success"; } catch(Exception e) { session.setAttribute("kekka", "数値を入れてください"); nextStep = "error"; } return (mapping.findForward(nextStep)); } } |
package tashizan; import javax.servlet.http.*; import org.apache.struts.action.*; public class hikizanAction extends Action { public ActionForward execute( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { hikizanActionForm myForm = (hikizanActionForm)form; HttpSession session = request.getSession(); String nextStep="success"; // 次画面 try { int i1 = Integer.parseInt(myForm.getParm1()); int i2 = Integer.parseInt(myForm.getParm2()); session.setAttribute("kekka", String.valueOf(i1-i2)); nextStep = "success"; } catch(Exception e) { session.setAttribute("kekka", "数値を入れてください"); nextStep = "error"; } return (mapping.findForward(nextStep)); } } |
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %> <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %> <%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %> <%@ page contentType="text/html; charset=utf-8" %> <HTML> <HEAD> <TITLE>足し算</TITLE> </HEAD> <BODY> 結果<BR> <H2> <logic:notEmpty name="tashizanForm"> <bean:write name="tashizanForm" property="parm1" scope="request"/>+ <bean:write name="tashizanForm" property="parm2" scope="request"/>= </logic:notEmpty> <logic:notEmpty name="hikizanForm"> <bean:write name="hikizanForm" property="parm1" scope="request"/>- <bean:write name="hikizanForm" property="parm2" scope="request"/>= </logic:notEmpty> <bean:write name="kekka" scope="session"/> </H2> <A HREF="index.jsp">戻る</A> </BODY> </HTML> |
<?xml version="1.0" encoding="ISO-8859-1" ?> <!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.3//EN" "http://struts.apache.org/dtds/struts-config_1_3.dtd"> <struts-config> <form-beans> <form-bean name="tashizanForm" type="tashizan.tashizanActionForm"/> <form-bean name="hikizanForm" type="tashizan.hikizanActionForm"/> </form-beans> <action-mappings> <action path="/tashizan" type="tashizan.tashizanAction" name="tashizanForm" scope="request" validate="false"> <forward name="success" path="/kaito.jsp"/> <forward name="error" path="/error.jsp"/> </action> <action path="/hikizan" type="tashizan.hikizanAction" name="hikizanForm" scope="request" validate="false"> <forward name="success" path="/kaito.jsp"/> <forward name="error" path="/error.jsp"/> </action> </action-mappings> </struts-config> |
<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %> <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %> <%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %> <%@ page contentType="text/html; charset=utf-8" %> <html:html> <HEAD> <TITLE>足し算</TITLE> </HEAD> <SCRIPT language="JavaScript"> <!-- function myfunc(syori_no) { tashizanForm.fugo.value = syori_no; tashizanForm.submit(); } // --> </SCRIPT> <BODY> <html:form action="/tashizan" focus="parm1"> <html:text property="parm1" size="6"/>と <html:text property="parm2" size="6"/>を <html:hidden property="fugo" value="0"/> <html:button property="tasu" onclick="myfunc(0)">足す</html:button> <html:button property="hiku" onclick="myfunc(1)">引く</html:button> </html:form> </BODY> </html:html> |
package tashizan; import java.io.IOException; import java.sql.SQLException; import javax.servlet.ServletException; import javax.servlet.http.*; import org.apache.struts.action.*; public class tashizanAction extends Action { public ActionForward execute( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) { tashizanActionForm myForm = (tashizanActionForm)form; HttpSession session = request.getSession(); String nextStep="success"; // 次画面 try { int i1 = Integer.parseInt(myForm.getParm1()); int i2 = Integer.parseInt(myForm.getParm2()); int f = Integer.parseInt(myForm.getFugo()); if ( f == 0 ) { session.setAttribute("kekka", String.valueOf(i1+i2)); } else { session.setAttribute("kekka", String.valueOf(i1-i2)); } nextStep = "success"; } catch(Exception e) { session.setAttribute("kekka", "数値を入れてください"); nextStep = "error"; } return (mapping.findForward(nextStep)); } } |
●レーンテーブル (レーンID,ロール(レーン名),親レーンID) ●エッジテーブル (エッジID,エッジ種別、元ノード等ID,先ノード等ID,エッジ説明) ●エッジコネクタテーブル (コネクタID,番号等) ●動作ノード(アクション)テーブル (動作ノードID,動作名、所属レーンID、親動作ノードID,動作ノード種別) ●オブジェクトノードテーブル (オブジェクトノードID、オブジェクト名、親オブジェクトノードID,オブジェクト種別) ●制御ノードテーブル* (制御ノードID,制御ノード種別) ●コメントテーブル (コメントID,コメント内容) |
<%@ page contentType="text/html; charset=Shift_JIS" %> <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %> <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %> <html:html> <head><title>exLookupDispatch.jsp</title></head> <body> <html:form action="/ExLookupDispatch"> <html:text property="parm1" size="6"/>と <html:text property="parm2" size="6"/>を<br> <html:submit property="exeMethod"> <bean:message key="submit.a"/> </html:submit> <html:submit property="exeMethod"> <bean:message key="submit.b"/> </html:submit> </html:form> </body> </html:html> |
<%@ page contentType="text/html; charset=Shift_JIS" %> <%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %> <%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %> <html:html> <head><title>結果</title></head> <body> <bean:write name="kekka" scope="session"/><BR> <A HREF="exLookupDispatch.jsp">もどる</A> </body> </html:html> |
<?xml version="1.0" encoding="Shift_JIS"?> <!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="ExLookupDispatch" type="struts.ExLookupDispatchForm"/> </form-beans> <action-mappings> <action path="/ExLookupDispatch" type="struts.ExLookupDispatchAction" name="ExLookupDispatch" parameter="exeMethod"> <forward name="kekka" path="/kekka.jsp"/> </action> </action-mappings> <message-resources parameter="resources.application"/> </struts-config> |
package struts; import org.apache.struts.action.*; public final class ExLookupDispatchForm extends ActionForm { private String parm1; private String parm2; public String getParm1() { return parm1; } public void setParm1(String parm1) { this.parm1 = parm1; } public void setParm2(String parm2) { this.parm2 = parm2; } public String getParm2() { return parm2; } } |
package struts; import javax.servlet.http.*; import javax.servlet.ServletContext; import org.apache.struts.action.*; import org.apache.struts.actions.*; import java.util.*; public final class ExLookupDispatchAction extends LookupDispatchAction { protected Map getKeyMethodMap() { Map map = new HashMap(); map.put("submit.a", "plus"); map.put("submit.b", "minus"); return map; } //足し算 public ActionForward plus(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse res) { ExLookupDispatchForm myForm = (ExLookupDispatchForm)form; HttpSession session = req.getSession(); try { int i1 = Integer.parseInt(myForm.getParm1()); int i2 = Integer.parseInt(myForm.getParm2()); session.setAttribute("kekka", i1+"+"+i2+"="+(i1+i2)); } catch(Exception e) { session.setAttribute("kekka", "Error"); } return (mapping.findForward("kekka")); } //引き算 public ActionForward minus(ActionMapping mapping, ActionForm form, HttpServletRequest req, HttpServletResponse res) { ExLookupDispatchForm myForm = (ExLookupDispatchForm)form; HttpSession session = req.getSession(); try { int i1 = Integer.parseInt(myForm.getParm1()); int i2 = Integer.parseInt(myForm.getParm2()); session.setAttribute("kekka", i1+"-"+i2+"="+(i1-i2)); } catch(Exception e) { session.setAttribute("kekka", "Error"); } return (mapping.findForward("kekka")); } } |
submit.a=足す submit.b=引く |
submit.a=\u8db3\u3059 submit.b=\u5f15\u304f |
javax.servlet.ServletException: サーブレットの実行により例外を投げました |
javax.servlet.ServletException: javax.servlet.ServletException: Action[/ExLookupDispatch]でキーメソッドマップの中にリソース {1} が見つかりません |
submit.a=plus submit.b=minus |
<?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"> <web-app> <filter> <filter-name>EncodeFilter</filter-name> <filter-class>filters.SetCharacterEncodingFilter</filter-class> <init-param> <param-name>encoding</param-name> <param-value>Shift_JIS</param-value> </init-param> </filter> <filter-mapping> <filter-name>EncodeFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <display-name>Struts Blank Application</display-name> <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> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> </web-app> |