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

Java¹ýÂËÆ÷ÑéÖ¤µÇ¼Óû§

1.Ê×ÏÈдһ¸öȨÏÞ¹ýÂËfilterÀà,ʵÏÖFilter½Ó¿Ú
/*Ê×ÏÈдһ¸öȨÏÞ¹ýÂËfilter*/
import javax.servlet.Filter;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.FilterChain;
import java.io.IOException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import javax.servlet.http.HttpServletResponse;
public class RightFilter
    implements Filter {
public void init(FilterConfig filterConfig) throws ServletException {
}
public void doFilter(ServletRequest request, ServletResponse response,
                       FilterChain chain) throws IOException, ServletException {
    HttpServletRequest req = (HttpServletRequest) request;
    HttpServletResponse res = (HttpServletResponse) response;
   
    HttpSession session = req.getSession(true);
    String path = req.getRequestURI();
    //´ÓsessionÀïÈ¡µÄÓû§ÃûÐÅÏ¢
    String username = (String) session.getAttribute("username");
for (int i = 0; i < Constants.NoFilter_Pages.length; i++) {
   if (path.indexOf(Constants.NoFilter_Pages[i]) > -1) {
    chain.doFilter(req, res);
    return;
   }
}
   
    //ÅжÏÈç¹ûûÓÐÈ¡µ½Óû§ÐÅÏ¢,¾ÍÌøתµ½µÇ½ҳÃæ
    if (username == null || "".equals(username)) {
      //Ìøתµ½µÇ½ҳÃæ
      res.sendRedirect(" http://"+req.getHeader("Host")+"/login.jsp ");//ÕâÀïÊÇ·µ»ØÓòÃûµÄ¸ùĿ¼µØÖ·£¬ÈôÖ±½Ó·µ»Øµ±Ç°µÄĿ¼ÏµÄÎļþ£¬ÔòÓÃres.sendRedirect("/login.jsp")
    }
    else {
      //ÒѾ­µÇ½,¼ÌÐø´


Ïà¹ØÎĵµ£º

JPCAP java²Ù×÷ÍøÂç²ã

ÎÄÕÂÀïÓÐһЩ±í¸ñ£¬javaeyeµÄÌûºÃÏñ²»Ö§³Ö±í¸ñÐÎʽ£¬ÓÐÐËȤ¿ÉÒÔµ½ÎÒµÄblog¿´¿´¡£
http://hzxdark.javaeye.com
Ò»£®JPCAP¼ò½é
ÖÚËùÖÜÖª£¬JAVAÓïÑÔËäÈ»ÔÚTCP/UDP´«Êä·½Ãæ¸øÓèÁËÁ¼ºÃµÄ¶¨Ò壬µ«¶ÔÓÚÍøÂç²ãÒÔϵĿØÖÆ£¬È´ÊÇÎÞÄÜΪÁ¦µÄ¡£JPCAPÀ©Õ¹°üÃÖ²¹ÁËÕâÒ»µã¡£
JPCAPʵ¼ÊÉϲ¢·ÇÒ»¸öÕæÕýȥʵÏÖ¶ÔÊý¾ÝÁ´Â·²ãµÄ¿ØÖÆ£¬¶øÊ ......

JAVAʵÏֵĴóÕûÊý¼Ó·¨

public class Test{ 
  public static String addBigNum(String str1,String str2){
     //ÕÒ³öÁ½×Ö·û´®µÄ³¤¶Ì£¬·½±ãºó±ßÒýÓã»
     String longer = str1.length() > str2.length()? str1 : str2;
     String shorter = str1.length( ......

Flex Compile Error: Error: Java heap space

ÓÉÓÚFlex Builder compiler shellÓÐmemory leakµÄÎÊÌ⣬ ¶øSDKĬÈÏµÄµÄ JVM heap size Ö»ÓÐ312M£¬µ±compile±È½Ï´óµÄprojectÈÝÒײ»¹»£¬ËùÒÔÖ»ÒªÐÞ¸ÄSDKµÄJVM²ÎÊý¾Í¿ÉÒÔ¡£
±à¼­ {Flex SDK}/bin/jvm.config ÎļþÈçÏ¡£
java.args=-Xmx512m ...
Èç¹û»¹ÊÇÓÐError£¬¿ÉÒÔÔö¼Óµ½1024»òÕ߸ü¶à¡£ ......

JAVA¹æ·¶Ñ§Ï°——String×ÖÃæ³£Á¿

package testPackage;
class Test {
public static void main(String[] args) {
String hello = "Hello", lo = "lo";
System.out.print((hello == "Hello") + " ");
System.out.print((Other.hello == hello) + " ");
System.out.print((other.Other.hello == hello) + " ");
System.out.print((hello == ("Hel"+"lo ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ