Tag: struts2 interceptors

用户会话在tomcat上混淆了

我们在IIS7.5之后使用Tomcat 6.29,使用spring,hibernate和struts2框架。 我们现在开始注意到服务器会话正在混淆,特别是在Ajax请求中。 关于这个问题的更多细节 用户1请求page1,用户2请求page2。 但是user1获得了page2,而user2获得了server1。 会话ID也在变化,但在刷新页面时,会提供正确的页面。 当用户数量很多时,问题似乎更频繁发生。 任何指向问题根源的指针都会有所帮助,代码运行正常,用户数量较少,并且没有报告此类实例。 编辑 web.xml中 bm contextConfigLocation classpath:spring/*Context.xml encodingFilter org.springframework.web.filter.CharacterEncodingFilter encoding UTF-8 forceEncoding true struts2 org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter encodingFilter /* struts2 /* org.springframework.web.context.ContextLoaderListener org.apache.struts2.tiles.StrutsTilesListener 在struts.xml dojo\..*,^struts\..* 其他信息 1)用户通过提交表单登录,登录时我们执行以下操作, public class xxxAction extends ActionSupport implements SessionAware { public String execute() { session.clear(); if (session instanceof org.apache.struts2.dispatcher.SessionMap) { try { ((org.apache.struts2.dispatcher.SessionMap) session).invalidate(); } […]

上传文件时出现NullPointerException

上传文件时,出现以下错误: Struts Problem Report Struts has detected an unhandled exception: Messages: File: java/io/File.java Line number: 317 Stacktraces java.lang.NullPointerException java.io.File.(File.java:317) example.uploadFile.execute(uploadFile.java:36) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav‌​a:43) java.lang.reflect.Method.invoke(Method.java:483) 的index.jsp Upload your file uploadFile.java package example; import java.io.File; import org.apache.commons.io.FileUtils; import java.io.IOException; import com.opensymphony.xwork2.ActionSupport; public class uploadFile extends ActionSupport { private File myFile; private String myFileContentType; private String myFileFileName; […]