Hello,
please help me to find the reason of the problem?
I have a strange situations with sessions.
   Server: Jboss(Tomcat 5.5.17)
   Servlet engine version: 2.4
   Java version: 1.4.2-b28
When I submit the Form using method "POST", I get new session instead of my current session. I see it from method doFilter() in LoginFilter. The Form are submitted from JSP (fileUpload.jsp) that was opened by JavaScript command window.showModalDialog(...) Tomcat works by using cookies. The current session is not expired, JSP (fileUpload.jsp) gets right session and right cookies. I have tried to transfer url to Server in format "http://localhost:8080/xxx/xxx/fileUpload.jsp;jsessionid=xxxxxxxxxxxxxxxxxxxxx"; but Server works by using Cookies only, not URL-rewriting, so it doesn't help me.
Why Server creates new session in my situation?

When fileUpload.jsp is loaded, I can get next information:
from cookies: true
from url: false
is new: false
is valid: true
session is not expired

There is some code fragments:

actions.xml
......
<action url="fileUpload.do" screen="properties/common/fileupload/fileUpload.jsp">
<class>efi.base.web.framework.AckAction</class>
</action>
<action url="loadFile.do" screen="properties/form/loadFile.jsp">
<class>efi.processDef.web.LoadFileAction</class>
</action>
......

web.xml contents:
....
<filter-mapping>
<filter-name>LoginFilter</filter-name>
<url-pattern>*.do</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>Compression Filter</filter-name>
<url-pattern>*.do</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>LoginFilter</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>Compression Filter</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping>
....

LoginFilter.java contents:
....
public void doFilter(
ServletRequest request,
ServletResponse response,
FilterChain chain)
throws IOException, ServletException {
HttpServletRequest hreq = (HttpServletRequest) request;
String currentURL =
hreq.getRequestURI().substring(hreq.getContextPath().length() + 1);
if (! requiresAuthentication(currentURL)) {
chain.doFilter(request, response); // proceed to resource
return;
}
String loggedIn =
(String) hreq.getSession().getAttribute(WebKeys.LOGGED_IN_STRING);
if (loggedIn != null) {
chain.doFilter(request, response);
return;
} else {
filterConfig.getServletContext().getRequestDispatcher(this.loginPage).forward(
request, response);
return;
}
}
}
....

fileUpload.jsp - the jsp page in modal Dialog window:
....
<form name="form" action="loadFile.do" method="POST" enctype="multipart/form-data" onsubmit="checkData();">
....

--
Thanks,
Eugene Razorenov


---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to