我@SessionAttributes在春天使用,但我不知道如何结束会话,我尝试了下面的代码,但我收到错误,请给我一些例子.
谢谢.
@RequestMapping(value ="/LogoutAction")
public String logout(HttpServletRequest request)
{
System.out.println("inside controller");
Resource res = new ClassPathResource("spring-context.xml");
BeanFactory factory = new XmlBeanFactory(res);
HttpSession session = request.getSession();
session.invalidate();
return "Login";
}
Run Code Online (Sandbox Code Playgroud) 我需要在控制器中使用应用程序上下文路径,我尝试了下面的代码,它抛出了NULLPOINTER EXCEPTION.
HttpServletRequest请求;
String Path = request.getContextPath();
请帮帮我
谢谢
请解释这段代码:
void main()
{
int t,
a = 5,
b = 10,
c = 15;
t = (++a && ++b, ++a), ++a || ++c; // need explanation for this line
printf("%d %d %d %d", t, a, b, c);
}
Run Code Online (Sandbox Code Playgroud) 我正在 spring3 项目中工作。当我运行代码时,有时我会收到某些特定功能的 Jdbc 连接异常,但其他功能工作得很好。而且这个异常不是重复发生,而是有时发生,所以我不知道错误会在哪里。请帮助我摆脱这个问题。
<[weblogic.servlet.internal.WebAppServletContext@1b6e978 - appName: '_auto_ generated_ear_', name: 'ae', context-path: '/ae'] ServletException 的根本原因。org.springframework.jdbc.CannotGetJdbcConnectionException:无法获取 JDBC 连接;嵌套异常为 java.sql.SQLException:侦听器拒绝连接,并出现以下错误:ORA-12519,TNS:找不到适当的服务处理程序 客户端使用的连接描述符为:org.springframework.jdbc 处的 localhost:1521:XE。 datasource.DataSourceUtils.getConnection(DataSourceUtils.java:80) 在 org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:573) 在 org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:637)在 org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:666) 在 org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:674) 被截断。请参阅日志文件以获取完整的堆栈跟踪 java.sql.SQLException:侦听器拒绝连接并出现以下错误:ORA-12519,TNS:找不到适当的服务处理程序客户端使用的连接描述符为:oracle.jdbc 上的 localhost:1521:XE .driver.DatabaseError.throwSqlException(DatabaseError.java:112) 在 oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:261) 在 oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:387) 在 Oracle。 jdbc.driver.PhysicalConnection.(PhysicalConnection.java:420) 在 oracle.jdbc.driver.T4CConnection.(T4CConnection.java:165) 被截断。请参阅日志文件以获取完整的堆栈跟踪