⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 strategyserv.jsp

📁 这个是j2eejava web 编程精要十五讲的全部源码。对学习java web编程的人来说是很能得的资料
💻 JSP
字号:


<%@ page contentType="text/html; charset=GB2312" %>
<%@ page import="foton.util.*" %>
<%@ page import="foton.strategy.*" %>
<%@ page import="java.util.*" %>
<%@ page import="java.io.*" %>

<SCRIPT language=javascript>
 var isSure=false;
function OpenWin(theURL,winName,features)
{
  window.open(theURL,winName,features);
}

function toOpen(str1,str2)
{
  
	if(str1==str2)
  { 
    OpenWin('../job/job_insert.jsp','newWin','scrollbars=yes,width=800,height=600');
  }
  else
  {
    alert("密码不对!");
    return false;
  }
  
}
</SCRIPT>

<html> <body>

<%

          
		    String ID = request.getParameter("ID");
			String caption = request.getParameter("caption");
			String content = request.getParameter("content");
			content=content.trim();
			String choice = request.getParameter("action");

			transCode trans = new transCode();

            choice = trans.transCode(choice);

	      //if(choice.equals("保存")) choice="STORE";
		  if(choice.equals("更新")) choice="UPDATE";

         strategyDAO dao = new strategyDAO();
         strategyInfo info=dao.getStrategy(ID);

		 info.setID(ID);
		 info.setCaption(caption);
		 info.setContent(content);

         /*
		 String serverName=request.getServerName();  //服务器名称
         int serverPort=request.getServerPort();  //服务器端口号
         String serverWeb=request.getContextPath();  //WEB目录名称

		 //serverAll = new StringBuffer();
		 /*
		 StringBuffer serverAll=new StringBuffer();
             serverAll.append("http://");
            serverAll.append(serverName);
           serverAll.append(":");
          serverAll.append(serverPort);
         serverAll.append(serverWeb);
		 serverAll.append("/RMS/strategy/");

	  String path = serverAll.toString();
	  */

	 // String path="d:/Tomcat 4.1/webapps/frms/RMS/strategy/";

		 // String password1 = trans.retransCode(password);
        /*  if (choice.equals("STORE")) {
         dao.insertStrategy(info);
         System.out.println("Here is jobAction!! Successful to insert data into datbase!!!");
         //prompt = "INSERT";
       }
	   */

         if(choice.equals("UPDATE"))
        {  System.out.println("UPDATE begin!!!");
          dao.updateStrategy(info);
          System.out.println("successful to UPDATE datbase!!!");
          
     


		 // FileReader is = new FileReader(path+"chinese.txt");
		  //File file=new File("strategy.txt");
        // FileWriter fos=new FileWriter(path+"strategy.txt");
		  //FileWriter fos=new FileWriter("strategy.txt");

         //FileOutputStream os=new FileOutputStream("walker.txt");
        //System.out.println(is);
       /*
		int n = content.length();
        System.out.println("The number of content is:"+n);
        char ch[]=new char[n];
        byte by[] = new byte[n];

		//content.getBytes(0,n,by,0);
		
        for(int i=0; i<n; i++) {
            //by[i]=(byte)is.read();
            ch[i]=(char)content.charAt(i);
			System.out.println("ch[i]="+ch[i]);
           by[i]=(byte)ch[i];
            //ch[i]+=32;
            fos.write(ch[i]);
			
           // os.write(by[i]);
        }
		
       System.out.println("The content has been input!!");
		// fos.write(by);
		
        fos.close();
        //os.close();
		*/

		//char[] ch = new char[3000];
		//is.read(ch);
		//fos.write(trans.transCode(content));
       // fos.close();


          //out.println("数据已经更新!请返回!");
		  //out.println("数据已经更新!请返回!");
		 

			   %>
				 <jsp:forward page="../strategy/strategy_h.jsp"/>
				 <%
	     
          //prompt = "UPDATE";
        }

		 
			

        %>




</body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -