Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

javaÖÐÉÏ´«Í¼Æ¬

1. ActionFormÖÐÌí¼ÓÊôÐÔ£¬FormFileÀàÐͶÔÏó¡£
private FormFile upLoadFile;
public FormFile getUpLoadFile() {
return upLoadFile;
}
public void setUpLoadFile(FormFile upLoadFile) {
this.upLoadFile = upLoadFile;
}
2. Action ÖÐÔö¼ÓÐ޸ķ½·¨¡£
public ActionForward save(ActionMapping mapping, ActionForm form,
HttpServletRequest request, HttpServletResponse response)
throws Exception {
PayDirMenuForm myForm = (PayDirMenuForm) form;
PayDirMenu myObj = new PayDirMenu();
BeanUtils.copyProperties(myObj, myForm);
PayDirMenuManager mgr = (PayDirMenuManager)
getBean("PayDirMenuManager");
// »ñµÃÎļþ
FormFile file = myForm.getUpLoadFile();//formÖÐÔö¼ÓµÄÊôÐÔ
// »ñµÃTomcateµÄ·¾¶
String objpath = request.getRealPath("plan");
// »ñµÃÉÏ´«µÄÎļþµÄÃû×Ö
String fileName = file.getFileName();//»ñÈ¡ÉÏ´«Í¼Æ¬µÄÎļþÃû
// ½ØÈ¡×Ö·û´®£¬»ñµÃºó׺Ãû 
    StringsuffixFileName =
fileName.substring(fileName.lastIndexOf("."));
//ÅжÏÉÏ´«ÎļþµÄÀàÐÍ
if(!".txt".equals(suffixFileName)&&!".doc".equals(suffixFileName)&&!".xls".equals(suffixFileName)&&!".jpg".equals(suffixFileName)&&!".gif".equals(suffixFileName)&&!".ppt".equals(suffixFileName))
{
request.getSession().setAttribute("msg1", "<font
color='red'>ÉÏ´«µÄÎļþ¸ñʽ²»ÕýÈ·£¡</font>");
return null;
}
// »ñµÃÄÚÈÝ
byte[] fileData = file.getFileData();
if (myObj.getMenuOid() != null && myObj.getMenuOid().intValue() ==
0){  //Ôö¼Ó
//дÈëµ½Á÷ÖÐ
FileOutputStream out = new FileOutputStream(new File(objpath + "\\"
+ fileName));
String filePath = objpath + "\\"+ fileName;
out.write(fileData);
out.close();
out.flush();
//дÈëÊý¾Ý¿â
myObj.setMenuImage(filePath);
mgr.saveObj(myObj);
}
else                                    


Ïà¹ØÎĵµ£º

£¨×ª£©javaÓëflexͨÐÅ

  £¨×ª£©javaÓëflexͨÐÅ
Ò»¡¢×¼±¸£º
·þÎñ¶Ë£ºJDK1.5 £¨Õâ¸ö²»ÓýéÉÜÁË°É£¿£©
·þÎñ¶ËIDE£ºeclipse £¨ËüµÄÖ÷Ò³£©
¿Í»§¶Ë£ºFLEX 3 £¨Adobe&reg; Flex&reg; 3 ÊÇÓÃÓÚ¹¹½¨ºÍά»¤ÔÚËùÓÐÖ÷Òªä¯ÀÀÆ÷¡¢×ÀÃæºÍ²Ù×÷ϵͳһÖµز¿ÊðµÄ¼«¾ß±íÏÖÁ¦µÄ Web Ó¦ÓóÌÐòµÄ¸ßЧÂʵĿª·ÅÔ´Âë¿ò¼Ü¡££©
¿Í»§¶ËIDE£ºFlex Builder 3 ......

¶¨ÖÆÓëÀ©Õ¹Java¼¯ºÏ¿ò¼Ü

 ¸ÅÒª£ºJava¼¯ºÏAPIÔ¶²»Ö¹ÊÇÊý×éµÄÌæ´úÆ·£¬¾¡¹ÜÄÇÊÇÒ»¸ö²»»µµÄÈÏÖªÆðµã¡£Ted NewardչʾÁË5¸öÄܸü´óÀûÓü¯ºÏ¿ò¼ÜµÄÇÏÃÅ£¬°üº¬Ò»¸ö¶¨ÖƲ¢À©Õ¹Java¼¯ºÏAPIµÄÈëÃż¶Ó¦Óá£
    ¶ÔÓÚÐí¶àJava¿ª·¢Õ߶øÑÔ£¬Java¼¯ºÏAPIÊDZê×¼µÄJavaÊý×é¼°ÆäÈ«²¿È±µãµÄ±ØÒªÌæ´úÆ·¡£½«¼¯ºÏ¿ò¼ÜÖ÷ÒªÓëArrayListÁªÏµÆðÀ´²¢²»ÊÇÒ ......

JavaÖÐTimerµÄʹÓÃ

JAVA¼¼ÇÉ(Java¶¨Ê±Ö´ÐÐÈÎÎñµÄʵÏÖ·½·¨)2009Äê02ÔÂ07ÈÕ ÐÇÆÚÁù 10:36¶¨Ê±Ö´ÐÐÈÎÎñµÄÈýÖÖ·½·¨:     
1£©java.util.Timer.     
2£©ServletContextListener.     
3)org.springframework.scheduling.timer.ScheduledTimerTask  & ......

Java ¶¯Ì¬¼ÓÔØÀà


µÚÒ»²¿·Ö£ºJavaÐéÄâ»úÆô¶¯Ê±£¬¹ØÓÚÀà¼ÓÔØ·½ÃæµÄһЩ¶¯×÷
µ±Ê¹ÓÃjava ProgramName.classÔËÐгÌÐòʱ£¬JavaÕÒµ½JRE£¬½Ó×ÅÕÒµ½jvm.dll£¬°Ñ¸Ã¶¯Ì¬¿âÔØÈëÄڴ棬Õâ¾ÍÊÇJVM¡£È»ºó¼ÓÔØÆäËü¶¯Ì¬¿â£¬ ²¢¼¤»îJVM¡£JVM¼¤»îÖ®ºó»á½øÐÐһЩ³õʼ»¯¹¤×÷£¬Ö®ºóÉú³ÉBootstrapLoader£¬¸ÃClass LoaderÊÇÓÉC++дµÄ¡£BootstrapLoader¼ÓÔØLaunche ......

Ubuntu java¿ª·¢»·¾³´î½¨

jdkµÄ°²×°
1¡¢´Ójava.sun.com¸ãÏÂjdk×îеİ汾£¬Ò»°ãÎÒÃÇÓÃ1.6°æ±¾µÄ£¬ÏÂÔØbin¸ñʽµÄjdk£¬¼Ù¶¨ÏÂÔصÄÎļþÃûΪjdk-6u20-linux-i586.bin¡£
2¡¢chmod u+x jdk-6u20-linux-i586.bin;È»ºó  ./jdk-6u20-linux-i586.bin ½âѹ£¬¼Ù¶¨½âѹºóµÄÎļþ¼ÐΪ jdk1.6_20;
3¡¢ÔÚ/usr/local/  ½¨Á¢Ò»¸öinstallµÄĿ¼£¬ È»ºó°Ñ½âÑ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ