java.lang.NullPointerException 求帮忙 。。。。。

大神们给我看看为啥空指针吧
2015-05-25 16:20:32,830 ERROR [500.jsp] 72 - <>
java.lang.NullPointerException
at org.hibernate.hql.ast.util.SessionFactoryHelper.findSQLFunction(SessionFactoryHelper.java:365)
at org.hibernate.hql.ast.tree.IdentNode.getDataType(IdentNode.java:289)
at org.hibernate.hql.ast.tree.SelectClause.initializeExplicitSelectClause(SelectClause.java:165)
at org.hibernate.hql.ast.HqlSqlWalker.useSelectClause(HqlSqlWalker.java:831)
at org.hibernate.hql.ast.HqlSqlWalker.processQuery(HqlSqlWalker.java:619)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:672)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:288)
at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:231)
at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:254)
at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:185)
at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:136)
at org.hibernate.engine.query.HQLQueryPlan.(HQLQueryPlan.java:101)
at org.hibernate.engine.query.HQLQueryPlan.(HQLQueryPlan.java:80)
at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:94)
at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:156)
at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:135)
at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1651)
at com.iflytek.iframework.orm.hibernate.HibernateGenericDao.createQuery(HibernateGenericDao.java:436)
at com.iflytek.iframework.orm.hibernate.HibernateGenericDao.findPage(HibernateGenericDao.java:223)
at net.zx.hxjr.zzjggl.interfaces.AbstractZzjggl.getPage(AbstractZzjggl.java:33)
at net.zx.hxjr.zzjggl.interfaces.AbstractZzjggl$$FastClassByCGLIB$$c3aea1a3.invoke()
at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)
at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:628)
at net.zx.hxjr.zzjggl.service.ZzjgManager$$EnhancerByCGLIB$$efd93d18.getPage()
at net.zx.hxjr.zzjggl.controller.ZzjgController.zzjgList(ZzjgController.java:38)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.doInvokeMethod(HandlerMethodInvoker.java:421)
at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:136)
at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:326)
at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:313)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:807)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:501)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1093)
at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:726)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:206)
at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:324)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:829)
at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514)
at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:488)

2015-05-25 16:20:35,638 ERROR [500.jsp] 72 - <>![图片说明](https://img-ask.csdn.net/upload/201505/25/1432544386_412533.png)图片说明

4个回答

图片说明

应该是你的500.jsp里面写的有问题 吧

zhangli19940710
知己而知彼 我可以说没有500.jsp嘛
4 年多之前 回复

有值为空null,空指针异常了

debug下,可以看看具体的错误,我觉得有可能是你hql的问题,或者根本找不到。

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
java.lang.NullPointerException 求帮忙 。。。。。
大神们给我看看为啥空指针吧n2015-05-25 16:20:32,830 ERROR [500.jsp] 72 - <>njava.lang.NullPointerExceptionn at org.hibernate.hql.ast.util.SessionFactoryHelper.findSQLFunction(SessionFactoryHelper.java:365)n at org.hibernate.hql.ast.tree.IdentNode.getDataType(IdentNode.java:289)n at org.hibernate.hql.ast.tree.SelectClause.initializeExplicitSelectClause(SelectClause.java:165)n at org.hibernate.hql.ast.HqlSqlWalker.useSelectClause(HqlSqlWalker.java:831)n at org.hibernate.hql.ast.HqlSqlWalker.processQuery(HqlSqlWalker.java:619)n at org.hibernate.hql.antlr.HqlSqlBaseWalker.query(HqlSqlBaseWalker.java:672)n at org.hibernate.hql.antlr.HqlSqlBaseWalker.selectStatement(HqlSqlBaseWalker.java:288)n at org.hibernate.hql.antlr.HqlSqlBaseWalker.statement(HqlSqlBaseWalker.java:231)n at org.hibernate.hql.ast.QueryTranslatorImpl.analyze(QueryTranslatorImpl.java:254)n at org.hibernate.hql.ast.QueryTranslatorImpl.doCompile(QueryTranslatorImpl.java:185)n at org.hibernate.hql.ast.QueryTranslatorImpl.compile(QueryTranslatorImpl.java:136)n at org.hibernate.engine.query.HQLQueryPlan.(HQLQueryPlan.java:101)n at org.hibernate.engine.query.HQLQueryPlan.(HQLQueryPlan.java:80)n at org.hibernate.engine.query.QueryPlanCache.getHQLQueryPlan(QueryPlanCache.java:94)n at org.hibernate.impl.AbstractSessionImpl.getHQLQueryPlan(AbstractSessionImpl.java:156)n at org.hibernate.impl.AbstractSessionImpl.createQuery(AbstractSessionImpl.java:135)n at org.hibernate.impl.SessionImpl.createQuery(SessionImpl.java:1651)n at com.iflytek.iframework.orm.hibernate.HibernateGenericDao.createQuery(HibernateGenericDao.java:436)n at com.iflytek.iframework.orm.hibernate.HibernateGenericDao.findPage(HibernateGenericDao.java:223)n at net.zx.hxjr.zzjggl.interfaces.AbstractZzjggl.getPage(AbstractZzjggl.java:33)n at net.zx.hxjr.zzjggl.interfaces.AbstractZzjggl$$FastClassByCGLIB$$c3aea1a3.invoke()n at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149)n at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:628)n at net.zx.hxjr.zzjggl.service.ZzjgManager$$EnhancerByCGLIB$$efd93d18.getPage()n at net.zx.hxjr.zzjggl.controller.ZzjgController.zzjgList(ZzjgController.java:38)n at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)n at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)n at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)n at java.lang.reflect.Method.invoke(Method.java:597)n at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.doInvokeMethod(HandlerMethodInvoker.java:421)n at org.springframework.web.bind.annotation.support.HandlerMethodInvoker.invokeHandlerMethod(HandlerMethodInvoker.java:136)n at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.invokeHandlerMethod(AnnotationMethodHandlerAdapter.java:326)n at org.springframework.web.servlet.mvc.annotation.AnnotationMethodHandlerAdapter.handle(AnnotationMethodHandlerAdapter.java:313)n at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875)n at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:807)n at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)n at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:501)n at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)n at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)n at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)n at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1093)n at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)n at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)n at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)n at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)n at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)n at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1084)n at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:360)n at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)n at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)n at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:726)n at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)n at org.mortbay.jetty.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:206)n at org.mortbay.jetty.handler.HandlerCollection.handle(HandlerCollection.java:114)n at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)n at org.mortbay.jetty.Server.handle(Server.java:324)n at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)n at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:829)n at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514)n at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)n at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)n at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)n at org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:488)nn2015-05-25 16:20:35,638 ERROR [500.jsp] 72 - <>![![图片说明](https://img-ask.csdn.net/upload/201505/25/1432544386_412533.png)图片说明](https://img-ask.csdn.net/upload/201505/25/1432544371_665958.png)
java.lang.NullPointerException 求高手帮忙
程序运行到下面这个位置的时候报了一个:java.lang.NullPointerExceptionrnrn[code=Java] // 从指定文件名读入配置信息rn public ConfDataLoader(String fileName) rn try rn URL fileURL = this.getClass().getClassLoader().getResource(fileName);rn rn //FileInputStream fin = new FileInputStream(fileName);rn config.load(fileURL.openStream()); // 载入文件rn //fin.close();rn catch (Exception ex) rn ex.printStackTrace();rn rn fn = fileName;rn [/code]rnrn求高手帮忙!
求达人帮忙jdbc sqlserver2005报错java.lang.NullPointerException
原程序封装类DB.javarn package com.bjsxt.bbs;rnrnimport java.sql.Connection;rnimport java.sql.DriverManager;rnimport java.sql.PreparedStatement;rnimport java.sql.ResultSet;rnimport java.sql.SQLException;rnimport java.sql.Statement;rnrnpublic class DB rn public static Connection getConn() rn Connection conn = null;rn try rn Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver");rn conn = DriverManager.getConnection("jdbc:microsoft:sqlserver://localhost:1433;databaseName=bbs", "sa" , "123");rn catch (ClassNotFoundException e) rn e.printStackTrace();rn catch (SQLException e) rn e.printStackTrace();rn rn return conn;rn rn rn public static Statement createStmt(Connection conn) rn Statement stmt = null;rn try rn stmt = conn.createStatement();rn catch (SQLException e) rn e.printStackTrace();rn rn return stmt;rn rn rn public static ResultSet executeQuery(Statement stmt, String sql) rn ResultSet rs = null;rn try rn rs = stmt.executeQuery(sql);rn catch (SQLException e) rn e.printStackTrace();rn rn return rs;rn rn rn /*public static ResultSet executeQuery(Connection conn, String sql) rn Statement stmt = null;rn ResultSet rs = null;rn try rn stmt = conn.createStatement();rn rs = stmt.executeQuery(sql);rn catch (SQLException e) rn e.printStackTrace();rn rn rn// finally rn// close(stmt);rn// rn rn rn return rs;rn */rn rn public static int executeUpdate(Connection conn, String sql) rn int ret = 0;rn Statement stmt = null;rn try rn stmt = conn.createStatement();rn ret = stmt.executeUpdate(sql);rn catch (SQLException e) rn e.printStackTrace();rn finally rn close(stmt);rn rn return ret;rn rn rn public static PreparedStatement prepareStmt(Connection conn, String sql) rn PreparedStatement pstmt = null;rn try rn pstmt = conn.prepareStatement(sql);rn catch (SQLException e) rn e.printStackTrace();rn rn return pstmt;rn rn rn public static PreparedStatement prepareStmt(Connection conn, String sql, int autoGeneratedKeys) rn PreparedStatement pstmt = null;rn try rn pstmt = conn.prepareStatement(sql, autoGeneratedKeys);rn catch (SQLException e) rn e.printStackTrace();rn rn return pstmt;rn rn rn public static void close(Connection conn) rn if(conn != null) rn try rn conn.close();rn catch (SQLException e) rn e.printStackTrace();rn rn conn = null;rn rn rn rn public static void close(Statement stmt) rn if(stmt != null) rn try rn stmt.close();rn catch (SQLException e) rn e.printStackTrace();rn rn stmt = null;rn rn rn rn public static void close(ResultSet rs) rn if(rs != null) rn try rn rs.close();rn catch (SQLException e) rn e.printStackTrace();rn rn rs = null;rn rn rnrnrnrnrn
java.lang.NullPointerException 问题 帮忙看看
代码如下:rnpackage factory;rnrnimport java.sql.*;rnimport java.util.ArrayList;rnimport java.util.List;rnrnimport jdbc.Connect;rnrnpublic class AssistFactory rn public static List getMatch() throws SQLException rn rn rn rn String sql = "select name,assist,t_name from statistics";rn Statement stmt = Connect.con.createStatement();rn ResultSet rs = stmt.executeQuery(sql);rn rs.beforeFirst();rnrnrn // TODO 自动生成 catch 块rn List list = new ArrayList();rnrn rn AssistEntity test = new AssistEntity();rn test.setRank("123");rn test.setT_name("123");rn test.setName("123");rn list.add(test);rn rn /*while(rs.next())rn AssistEntity assist = new AssistEntity();rn assist.setName(rs.getString(2));rn assist.setAssist(rs.getString(3));rn assist.setT_name(rs.getString(4));rnrn list.add(assist);rn */rn rn rn return list;rnrnrnrn出错的是这句:Statement stmt = Connect.con.createStatement();rn但是在别的类里同样的语句 正常运行rn好几天了没解决rnrn编译器错误提示:rnjava.lang.NullPointerExceptionrn at factory.AssistFactory.getMatch(AssistFactory.java:15)rn at swt.MainWindow.createButton_7_Comp(MainWindow.java:787)rn at swt.MainWindow.open(MainWindow.java:333)rn at swt.MainWindow.main(MainWindow.java:87)rn感谢 回复rn
java.lang.NullPointerException帮忙找一下吧?
type Exception reportrnrnmessage Internal Server Errorrnrndescription The server encountered an internal error (Internal Server Error) that prevented it from fulfilling this request.rnrnexception rnrnjava.lang.NullPointerExceptionrn at org.apache.jsp.filter_0005fwrite_0005fexcel$jsp._jspService(filter_0005fwrite_0005fexcel$jsp.java:216)rn at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:107)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)rn at org.apache.jasper.servlet.JspServlet$JspServletWrapper.service(JspServlet.java:201)rn at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:381)rn at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:473)rn at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)rn at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:247)rn at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)rn at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)rn at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)rn at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)rn at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)rn at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:190)rn at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)rn at org.apache.catalina.valves.CertificatesValve.invoke(CertificatesValve.java:246)rn at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)rn at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)rn at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)rn at org.apache.catalina.core.StandardContext.invoke(StandardContext.java:2347)rn at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:180)rn at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)rn at org.apache.catalina.valves.ErrorDispatcherValve.invoke(ErrorDispatcherValve.java:170)rn at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)rn at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:170)rn at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)rn at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:468)rn at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:564)rn at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)rn at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)rn at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:174)rn at org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)rn at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:472)rn at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:943)rn at org.apache.catalina.connector.http.HttpProcessor.process(HttpProcessor.java:1027)rn at org.apache.catalina.connector.http.HttpProcessor.run(HttpProcessor.java:1125)rn at java.lang.Thread.run(Thread.java:536)rnrn请问是那的错误
错误:java.lang.NullPointerException,求指教!
jsp+sql2000+Tomcat 5.0,ie浏览器打开用户登录界面,提示以下错误rnrnHTTP Status 500 - rnrn--------------------------------------------------------------------------------rnrntype Exception reportrnrnmessage rnrndescription The server encountered an internal error () that prevented it from fulfilling this request.rnrnexception rnrnjava.lang.NullPointerExceptionrn com.bean.LoginBean.login(LoginBean.java:20)rn com.servlet.LoginServlet.doGet(LoginServlet.java:41)rn com.servlet.LoginServlet.doPost(LoginServlet.java:76)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:709)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:802)rnrn我纯菜鸟,请问高手怎么解决啊?rnrn
java.lang.NullPointerException 空指针异常 求解决
java.lang.NullPointerExceptionrn com.psger.dao.UserBeanDao.getUserBeanByUsername(UserBeanDao.java:33)rn com.psger.servlet.LoginServlet.doPost(LoginServlet.java:68)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:637)rn javax.servlet.http.HttpServlet.service(HttpServlet.java:717)rn com.psger.servlet.EncodingFilter.doFilter(EncodingFilter.java:25)rnrnpackage com.psger.dao;rnrnimport java.sql.Connection;rnimport java.sql.PreparedStatement;rnimport java.sql.ResultSet;rnimport java.sql.SQLException;rnimport java.util.ArrayList;rnimport java.util.List;rnrnimport com.psger.entity.UserBean;rnrnrnrnpublic class UserBeanDao rn rn private Connection conn = null;rn private PreparedStatement pstmt = null;rn private ResultSet rs = null;rn rn UserBean user = null;rn rn /**rn * 根据用户名取得用户对象rn * @param username 传入的用户名rn * @return 查询到的用户对象rn */rn public UserBean getUserBeanByUsername(String userName) rn //UserBean user = null;rn String sql = "SELECT * FROM tb_user WHERE userName=?";rn rn conn = CommonDao.getConn();rn try rn pstmt = conn.prepareStatement(sql);rn pstmt.setString(1, userName);rn rn rs = pstmt.executeQuery();rn if(rs.next())rn user = new UserBean();rn user.setUserId(rs.getInt("userId"));rn user.setUserName(rs.getString("userName"));rn user.setUserPassword(rs.getString("userPassword"));rn user.setUserSex(rs.getString("userSex"));rn user.setUserAge(rs.getInt("userAge"));rn user.setTelephone(rs.getString("telephone"));rn user.setAddress(rs.getString("address"));rn user.setRoleId(rs.getInt("roleId"));rn rn rn catch (SQLException e) rn e.printStackTrace();rn finallyrn CommonDao.shutDown();rn rn return user;rn rn rn /**rn * 获取所有用户列表,同时通过多表连接查询出权限rn * @return rn */rn public List getAllUsers()rn List user_list = new ArrayList();rn rn String sql = "select u.*,r.roleName from TB_USER u,TB_ROLE r where u.roleId=r.roleId order by userId";rn conn = CommonDao.getConn();rn try rn pstmt = conn.prepareStatement(sql);rn rs = pstmt.executeQuery();rn rn while (rs.next())rn user = new UserBean();rn rn user.setUserId(rs.getInt("userId"));rn user.setUserName(rs.getString("userName"));rn user.setUserPassword(rs.getString("userPassword"));rn user.setUserSex(rs.getString("userSex"));rn user.setUserAge(rs.getInt("userAge"));rn user.setTelephone(rs.getString("telephone"));rn user.setAddress(rs.getString("address"));rn user.setRoleId(rs.getInt("roleId"));rn user.setRoleName(rs.getString("roleName"));rn rn user_list.add(user);rn rn catch (SQLException e) rn e.printStackTrace();rn finally rn CommonDao.shutDown();rn rn rn return user_list;rn rnrn /**rn * @param idrn * @return 根据用户id,返回对应用户信息rn */rn public UserBean getUserInfoById(String id) rn rn String sql = "select u.*,r.roleName from TB_USER u,TB_ROLE r where u.roleId=r.roleId and u.userId=?";rn rn conn = CommonDao.getConn();rn try rn pstmt = conn.prepareStatement(sql);rn pstmt.setString(1,id);rn rn rs = pstmt.executeQuery();rn rn if (rs.next())rn user = new UserBean();rn rn user.setUserId(rs.getInt("userId"));rn user.setUserName(rs.getString("userName"));rn user.setUserPassword(rs.getString("userPassword"));rn user.setUserSex(rs.getString("userSex"));rn user.setUserAge(rs.getInt("userAge"));rn user.setTelephone(rs.getString("telephone"));rn user.setAddress(rs.getString("address"));rn user.setRoleId(rs.getInt("roleId"));rn user.setRoleName(rs.getString("roleName"));rn rnrn rn catch (SQLException e) rn e.printStackTrace();rn finally rn CommonDao.shutDown();rn rn return user;rn rn /**rn * @pramat namern * @return 根据用户名返回用户信息rn */ rn public UserBean getUserInfoByName(String name)rn rn String sql = "select u.*,r.roleName from TB_USER u,TB_ROLE r where u.roleId=r.roleId and u.userName=?";rn rn conn = CommonDao.getConn();rn try rn pstmt = conn.prepareStatement(sql);rn pstmt.setString(1,name);rn rn rs = pstmt.executeQuery();rn rn if (rs.next())rn user = new UserBean();rn rn user.setUserId(rs.getInt("userId"));rn user.setUserName(rs.getString("userName"));rn user.setUserPassword(rs.getString("userPassword"));rn user.setUserSex(rs.getString("userSex"));rn user.setUserAge(rs.getInt("userAge"));rn user.setTelephone(rs.getString("telephone"));rn user.setAddress(rs.getString("address"));rn user.setRoleId(rs.getInt("roleId"));rn user.setRoleName(rs.getString("roleName"));rn rn rn catch (SQLException e) rn e.printStackTrace();rn finally rn CommonDao.shutDown();rn rn return user;rn rn rn /**rn * 根据权限名获得权限IDrn */rn public int getIdByRoleName(String name)rn rn int id = 0; rn String sql = "select roleId from tb_role where roleName=?";rn rn// rs = CommonDao.query(sql,name);rn try rn conn = CommonDao.getConn();rn pstmt = conn.prepareStatement(sql); rn pstmt.setString(1,name );rn rs = pstmt.executeQuery();rn if (rs.next()) rn id = rs.getInt("roleId");rn rn rn catch (SQLException e) rn // TODO Auto-generated catch blockrn e.printStackTrace();rn finallyrn CommonDao.shutDown();rn rn rn return id;rn rn rn rnrn /**rn * 添加用户信息rn * rn */rn public boolean addUserInfo(UserBean ub)rn String sql ="insert into TB_USER values(?,?,?,?,?,?,?,?)";rn rn// System.out.println(ub.getUserId());rn// System.out.println(ub.getUserName());rn// System.out.println(ub.getUserPassword());rn// System.out.println(ub.getUserSex());rn// System.out.println(ub.getUserAge());rn// System.out.println(ub.getTelephone());rn// System.out.println(ub.getAddress());rn// System.out.println(ub.getUserId());rnrn rn String[] info =ub.getUserId()+"",ub.getUserName(),ub.getUserPassword(),ub.getUserSex(),rn ub.getUserAge()+"",ub.getTelephone(),ub.getAddress(),ub.getRoleId()+"";rn rn return CommonDao.update(sql, info)>0;rn rn rnrn rn rn /**rn * 修改用户信息rn * rn */rn public boolean updateUserInfo(UserBean ub)rn rn String sql = "UPDATE TB_USER set userName=?,userSex= ?,userAge=?,telephone=?,address=? WHERE userId=?";rn rn String[] info=ub.getUserName(),ub.getUserSex(),rn ub.getUserAge()+"",ub.getTelephone(),ub.getAddress(),ub.getUserId()+""; rn return CommonDao.update(sql, info)>0;rn rn /**rn * 根据用户id,删除用户信息rn * rn */rn public boolean deleteUserById(String id) rn rn String sql = "delete from TB_USER where userId=?";rn rn return CommonDao.update(sql, new String[]id)>0;rn rn rn /**rn *@param userbeanrn *@return 根据用户id,修改密码rn */rn public boolean updateUserPasswd(UserBean userbean)rn rn String sql = "update TB_USER set userPassword=? where userId=?";rn rn return CommonDao.update(sql, new String[]userbean.getUserPassword(),userbean.getUserId()+"")>0 ? true : false;rn rnrnrnrn/**rn * rn */rnpackage com.psger.servlet;rnrnimport java.io.IOException;rnimport java.util.List;rnrnimport javax.servlet.ServletException;rnimport javax.servlet.http.HttpServlet;rnimport javax.servlet.http.HttpServletRequest;rnimport javax.servlet.http.HttpServletResponse;rnimport javax.servlet.http.HttpSession;rnrnrnimport com.psger.dao.RoleRightDao;rnimport com.psger.dao.UserBeanDao;rnimport com.psger.entity.RightBean;rnimport com.psger.entity.UserBean;rnrn/**rn * @author Psgerrn * rn */rn@SuppressWarnings("serial")rnpublic class LoginServlet extends HttpServlet rnrn public void doGet(HttpServletRequest request, HttpServletResponse response)rn throws ServletException, IOException rnrn this.doPost(request, response);rn rnrn public void doPost(HttpServletRequest request, HttpServletResponse response)rn throws ServletException, IOException rnrn // 处理乱码rn request.setCharacterEncoding("UTF-8");rnrn String flag = request.getParameter("flag");rn rn String path ="./index.jsp";rnrn HttpSession session = request.getSession();// 用户存放用户信息rn if (flag.equals("loginIn")) rn // 接收用户的输入rn String username = request.getParameter("username");rn String userpass = request.getParameter("password");rn String input = request.getParameter("checkCode");rn String rand = (String) session.getAttribute("rCode");rnrn // 服务端验证rn if (username == null || "".equals(username.trim())) rn response.sendRedirect(path);rn rn if (userpass == null || "".equals(userpass.trim())) rn response.sendRedirect(path);rn rn if (!input.equals(rand)) rn String msg = " ";rn request.setAttribute("err", msg);rn request.getRequestDispatcher(path).forward(request,response);rn return;rn rnrn // 调用ado层,根据用户名取得用户对象rn UserBeanDao userDao = new UserBeanDao();rn UserBean user = userDao.getUserBeanByUsername(username);rnrn // 判断rn boolean result = false;rn if (user != null) // 用户名存在rn if (user.getUserPassword().equals(userpass)) // 密码也对rn // 登录成功rn result = true;rn rn rnrn if (result) rn // 登录成功rn // HttpSession session = request.getSession();rn session.setAttribute("USER", user);rn session.setAttribute("user_name", user.getUserName());// 用于防止非法登录rnrn // 读取该用户所拥有的菜单权限rn RoleRightDao roleRightDao = new RoleRightDao();rn List list = roleRightDao.getRightsByRoleId(userrn .getRoleId());rnrn // 把list传入到firmest里去rn session.setAttribute("rightList", list);rnrn response.sendRedirect("/supermarket/jsp/main.jsp");rnrn else rn String msg = " ";rn request.setAttribute("err", msg);rn request.getRequestDispatcher(path).forward(request,response);rn rn else if (flag.equals("loginOut")) rn session.invalidate();rnrn request.getRequestDispatcher("/jsp/logout.jsp").forward(request,rn response);rn return;rn rnrnrn rnrnrn
报错java.lang.NullPointerException,求指点
在输出单个建站性价比时OK,但后面就报错了,应该是134,135行有错,但不知道怎么改,请教大神rn[code=java]import java.util.*;rnrnclass site implements Cloneablern rn char name;rn int cost ;rn int sale ;rn site[] relations;rn rn rn site(char a,int c,int b)rn rn this.name = a;rn this.cost = c;rn this.sale = b;rn rn rn site(site s)rn this.name = s.name;rn this.cost = s.cost;rn this.sale = s.sale;rn this.relations = s.relations;rnrnrn rn rn void set_relations(site[] s)rn this.relations = s;rn rn rn int saleadditor()rn int sum = this.sale;rn for(int i = 0;i
java.lang.NullPointerException的问题请大家帮忙
public FastVector freq_2()//fre-2rn rn FastVector vtemp=new FastVector();rn vectoralltemp.removeAllElements();rn rn Item temp1=new Item();rn Item temp2=new Item();rn Item temp3=new Item();rn String key1,key2;rn String key="";rn int tempcon=0;rn boolean b1=false,b2=false;rn for(int i=0;i0)rn rn I3.setKey(s3+s2+","+s1+",");rn rn temp1.addElement(I3);rn s1=s2=s3=s4="";rn rn elsern rn I3.setKey(s3+s1+","+s2+",");rn rn temp1.addElement(I3);rn s1=s2=s3=s4="";rn rn txt=txt+I3.getKey()+"PP ";rn rn rn elsern s1=s2=s3=s4="";rn rn rn rn rn rn return temp1;rn rn public FastVector odd(FastVector c_k2,FastVector freq_k,int k2)//c_k2为c_k+1的侯选集freq_k为k阶频繁集 k2为k+1 item里面含有的个数rn rn FastVector ck2=new FastVector();rn FastVector fk=new FastVector();rn FastVector fk2=new FastVector();rn boolean isfk=false;rn ck2=c_k2;rn fk=freq_k;rn //fk=fullFreq[2];rn int count=0;rn for(int i=0;i=1)//set minsup没有设置用1先代替rn rn Itemp.setcon(count);rn count=0;rn rn fk2.addElement(Itemp);rn rn //Itemp.removekey();rn //txt=txt+Itemp.getKey()+"pp\n";rn isfk=false;rn count=0;rn rn elsern rn count=0;rn rn rn rn fullFreq[k2]=fk2;rn rnrn return fullFreq[k2];rn rn rn public FastVector freq_k(FastVector freq_k,int k )//fre_k---->fre_k+1rn //由ck 与odd完成\rn int k2=k;rn k2++;rn freq_1();rn FastVector c_k2=new FastVector();rn FastVector freq_k2=new FastVector();rn FastVector f_k=new FastVector();rn f_k=freq_k;rn c_k2=ck(f_k,k);rn freq_k2=odd(c_k2,f_k,k2);//////////////////////////////////////////////////错误提示处rn fullFreq[k+1]=freq_k2;rn rn Item kk=new Item();rn rn for(int x=0;x=1)rn rnrn temp=freq_k(fullFreq[k2],key);///////////////////////////错误提示处rn rn k2++;rn fullFreq[k2]=temp;rn kfullSet=k2;rn key++;rn txt=txt+k2+"s"+key+" YY";rn Item kk=new Item();rn txt=txt+"WWWWW"+fullFreq[k2].size()+"WWWWW";rn for(int x=0;x
大家帮忙看一下,java.lang.NullPointerException问题
我是初学者,在网上下了个"好易多网上书店"的源码,运行是出现一下问题,我看了好长时间也没弄懂问题出在哪? 请各位大侠帮忙看看!rn出现如下错误提示:rnError 500--Internal Server Error rnjava.lang.NullPointerExceptionrn at org.pan.web.bookclasslist.excute(bookclasslist.java:38)rn at jsp_servlet._bookstore.__index._jspService(__index.java:154)rn at weblogic.servlet.jsp.JspBase.service(JspBase.java:33)rn at weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run(ServletStubImpl.java:1053)rn at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:387)rn at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:431)rn at weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubImpl.java:305)rn at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:6310)rn at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:317)rn at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:118)rn at weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppServletContext.java:3622)rn at weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestImpl.java:2569)rn at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:197)rn at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:170) rnrnjsp调用如下:rnrn<% if (classlist.excute())rn for (int i=0;irnrnbookclasslist的源码如下:rn package org.pan.web;rnrnimport java.sql.*;rnimport java.util.Vector;rnimport org.pan.util.*;rnimport org.pan.web.book.bookclass;rnrnpublic class bookclasslist extends DataBase rn private Vector classlist; rn public bookclasslist() throws Exceptionrn super();rn rnrn public Vector getClasslist() rn return classlist;rn rnrn public String getSql() rn String sqlStr = "select id,classname from my_Bookclass order by id";rn return sqlStr;rn rnrn public boolean excute() throws Exception rn int id = 0;rn String classname = "";rn int rscount = 0;rn try rnrn rs = stmt.executeQuery(getSql());rn rscount = stmt.getMaxRows();rn classlist = new Vector(rscount+1);rn classlist.clear();rn while (rs.next())rn id = rs.getInt("id");rn classname = rs.getString("classname");rn bookclass bc = new bookclass(id,classname);rn classlist.addElement(bc);rnrnrnrn rn rs.close();rn return true;rn rn catch (SQLException sqle)rn System.out.println(sqle);rn return false;rn rn rn;rnrnrnDataBase代码如下:rnpackage org.pan.web;rnimport java.sql.*;rnimport org.pan.util.*;rnrnpublic class DataBase rn protected Connection conn = null; //Connection接口rn protected Statement stmt = null; //Statement接口rn protected ResultSet rs = null; //记录结果集rn protected PreparedStatement prepstmt = null; //PreparedStatement接口rn protected String sqlStr; //sql Stringrn protected boolean isConnect=true; //与数据库连接标识rnrn public DataBase() rn tryrn rn sqlStr = "";rn DBConnectionManager dcm = new DBConnectionManager();rn conn = dcm.getConnection();rn stmt = conn.createStatement();rn rn catch (Exception e)rn rn System.out.println(e);rn isConnect=false;rn rnrn rnrn public Statement getStatement() rn return stmt;rn rnrn public Connection getConnection() rn return conn;rn rnrn public PreparedStatement getPreparedStatement() rn return prepstmt;rn rnrn public ResultSet getResultSet() rn return rs;rn rnrnrn public String getSql() rn return sqlStr;rn rnrn public boolean execute() throws Exception rn return false;rn rnrn public boolean insert() throws Exception rn return false;rn rnrn public boolean update() throws Exception rn return false;rn rnrn public boolean delete() throws Exception rn return false;rn rn public boolean query() throws Exception rn return false;rn rnrn public void close() throws SQLException rn if ( stmt != null )rn rn stmt.close();rn stmt = null;rn rn conn.close();rn conn = null;rn rnrn;rnrnDBConnectionManager 类的代码:rnpackage org.pan.util;rnimport java.sql.*;rnpublic class DBConnectionManager rn private String driverName = "com.microsoft.jdbc.sqlserver.SQLServerDriver"; //"oracle.jdbc.driver.OracleDriver";rn private String url = "jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=bookstore"; //"jdbc:oracle:thin:@127.0.0.1:1521:oracle";rn private String user = "sa";rn private String password = "sa";rnrn public void setDriverName(String newDriverName) rn driverName = newDriverName;rn rn public String getDriverName() rn return driverName;rn rnrn public void setUrl(String newUrl) rn url = newUrl;rn rn public String getUrl() rn return url;rn rn public void setUser(String newUser) rn user = newUser;rn rn public String getUser() rn return user;rn rn public void setPassword(String newPassword) rn password = newPassword;rn rn public String getPassword() rn return password;rn rnrn public Connection getConnection() rn try rn Class.forName(driverName);rn return DriverManager.getConnection(url, user, password);rn rn catch (Exception e) rn e.printStackTrace();rn return null;rn rn rnrn public static void main(String[] args) rn // DBConnectionManager DBConnectionManager1 = new DBConnectionManager();rnrnrn tryrnrn DBConnectionManager dcm = new DBConnectionManager();rn Connection conn = dcm.getConnection();rn Statement stmt=conn.createStatement();rn ResultSet rs=stmt.executeQuery("select * from my_BookAdminuser");rnrnrn // stmt = conn.createStatement();rnrn while(rs.next())rn System.out.print("名称: "+rs.getString(1));rn System.out.print("\tpassword: "+rs.getString(2));rn System.out.println();rn rn //stmt.executeUpdate( "insert into my.txt values ('Ruby',27,'网络部')"); //*/rn catch(Exception e)rn e.printStackTrace();rn rn rnrnrn
java.lang.NullPointerException
public List selectOne()rn List ls=null;rn DBConnection dbc=new DBConnection();rn Connection con=dbc.getDBConnection();rn Statement st=null;rn ResultSet rs=null;rn String sql="select * from newpro";rn if(con!=null)rn try rn st=con.createStatement();rn rs=st.executeQuery(sql);rn rn if(rs.next())rn dorn Pro pr=new Pro();rn pr.setPro_Id(rs.getInt(1));rn pr.setPro_Name(rs.getString("newpro_name"));rn pr.setPro_Photo(rs.getString("newpro_photo"));rn ls.add(pr);rn while(rs.next());rn rn catch (SQLException e) rn // TODO Auto-generated catch blockrn e.printStackTrace();rn rn rn elsern System.out.print("error");rn rn rn return ls;rn
java.lang.NullPointerException ????????
==============连接数据库的Bean======================rnpackage bbsclass;rnimport java.sql.*;rnrnpublic class bbsconnrn String sDBDriver = "sun.jdbc.odbc.JdbcOdbcDriver";rn String sConnStr = "jdbc:odbc:bbs";rn Connection conn = null;rn ResultSet rs = null;rnrnpublic bbsconn() rntry rn Class.forName(sDBDriver); rnrncatch(java.lang.ClassNotFoundException e) rn System.err.println("bbsreg(): " + e.getMessage());rnrnrnrnpublic ResultSet executeQuery(String sql) rnrs = null;rntry rn conn = DriverManager.getConnection(sConnStr); rn Statement stmt = conn.createStatement();rn rs = stmt.executeQuery(sql);rn rncatch(SQLException ex) rn System.err.println("aq.executeQuery: " + ex.getMessage());rn System.err.println("aq.executeQuerystrSQL: " + sql);rnrnreturn rs;rnrn.....rnrn=========只是知执行一个查询的过程==========================rnimport bbsclass.bbsconn;rnimport java.io.PrintStream;rnimport java.sql.ResultSet;rnimport java.sql.SQLException;rnrnpublic class TestBbs implements java.io.Serializablernrn bbsconn bbsCon=null;rn ResultSet rs;rn rn public void TestBbs()rn rn bbsCon = new bbsconn();rn rs=null;rn rnrn public boolean search()rn rn ResultSet rs = null;rn tryrn rn rs = bbsCon.executeQuery("select * from user");rn if (rs.next())rn rn return true;rn rn elsern return false;rn rn catch (SQLException e)rn rn System.err.println(e.getMessage());rn System.out.println(e.getMessage());rn return false;rn rn rnrn public static void main(String[] args)rn rn TestBbs testBbs = new TestBbs();rn if (testBbs.search())rn rn System.out.print("有数据!");rn rn elsern rn System.out.print("没有数据!");rn rn rnrnrn执行TestBbs 的时候总是报:rnjava.lang.NullPointerExceptionrn at TestBbs.search(TestBbs.java:22)rn at TestBbs.main(TestBbs.java:40)rnException in thread "main" Normal Terminationrn我该怎么处理???? rnrnrnrnrnrnrnrn
java.lang.NullPointerException???
小弟我正在做个聊天程序,服务器已经连接上了,当运行登录界面后就出现如下错误,请各位大侠指点下,不胜感激……rnException in thread "AWT-EventQueue-0" java.lang.NullPointerExceptionrn at New.login_mouseClicked(New.java:125)rn at New$1.mouseClicked(New.java:60)rn at java.awt.AWTEventMulticaster.mouseClicked(Unknown Source)rn at java.awt.Component.processMouseEvent(Unknown Source)rn at javax.swing.JComponent.processMouseEvent(Unknown Source)rn at java.awt.Component.processEvent(Unknown Source)rn at java.awt.Container.processEvent(Unknown Source)rn at java.awt.Component.dispatchEventImpl(Unknown Source)rn at java.awt.Container.dispatchEventImpl(Unknown Source)rn at java.awt.Component.dispatchEvent(Unknown Source)rn at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)rn at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)rn at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)rn at java.awt.Container.dispatchEventImpl(Unknown Source)rn at java.awt.Window.dispatchEventImpl(Unknown Source)rn at java.awt.Component.dispatchEvent(Unknown Source)rn at java.awt.EventQueue.dispatchEvent(Unknown Source)rn at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)rn at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)rn at java.awt.EventDispatchThread.pumpEvents(Unknown Source)rn at java.awt.EventDispatchThread.pumpEvents(Unknown Source)rn at java.awt.EventDispatchThread.run(Unknown Source)rnrn
java.lang.NullPointerException?
报错“java.lang.NullPointerException“是怎么回事啊?rn
相关热词 c# 去空格去转义符 c#用户登录窗体代码 c# 流 c# linux 可视化 c# mvc 返回图片 c# 像素空间 c# 日期 最后一天 c#字典序排序 c# 截屏取色 c#中的哪些属于托管机制