web.xml
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/classes/applicationContext*.xml
</param-value>
</context-param>
<servlet>
<servlet-name>SpringContextServlet</servlet-name>
<servlet-class>
org.springframework.web.context.ContextLoaderServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>
org.apache.struts.action.ActionServlet
</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>
/WEB-INF/struts-config.xml,/WEB-INF/struts-config-incident.xml,/WEB-INF/struts-config-survey.xml,
/WEB-INF/struts-config-stock.xml,
/WEB-INF/struts-config-bizOrder.xml,/WEB-INF/struts-config-productList.xml,
/WEB-INF/struts-config-account.xml,/WEB-INF/struts-config-user.xml,
/WEB-INF/struts-config-rolepower.xml,/WEB-INF/struts-config-supplier.xml,
/WEB-INF/struts-config-login.xml,/WEB-INF/struts-config-salesProject.xml,
/WEB-INF/struts-config-salesContract.xml,/WEB-INF/struts-config-orgorganization.xml,
/WEB-INF/struts-config-orgposition.xml,/WEB-INF/struts-config-employee.xml,
/WEB-INF/struts-config-work.xml,/WEB-INF/struts-config-kms.xml,
/WEB-INF/struts-config-project.xml,/WEB-INF/struts-config-finance.xml,
/WEB-INF/struts-config-calender.xml,
/WEB-INF/struts-config-financeFee.xml,
/WEB-INF/struts-config-common.xml,
/WEB-INF/struts-config-financeEmployeeFee.xml,
/WEB-INF/struts-config-inPurchase.xml,
/WEB-INF/struts-config-software.xml
</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>3</param-value>
</init-param>
<init-param>
<param-name>detail</param-name>
<param-value>3</param-value>
</init-param>
<load-on-startup>0</load-on-startup>
</servlet>
<servlet>
<servlet-name>freemarker</servlet-name>
<servlet-class>
freemarker.ext.servlet.FreemarkerServlet
</servlet-class>
<!-- FreemarkerServlet settings: -->
<init-param>
<param-name>TemplatePath</param-name>
<param-value>/</param-value>
</init-param>
<init-param>
<param-name>NoCache</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>ContentType</param-name>
<param-value>text/html</param-value>
</init-param>
<!-- FreeMarker settings: -->
<init-param>
<param-name>template_update_delay</param-name>
<param-value>0</param-value>
<!-- 0 is for development only! Use higher value otherwise. -->
</init-param>
<init-param>
<param-name>default_encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
<init-param>
<param-name>locale</param-name>
<param-value>zh_CN</param-value>
</init-param>
<init-param>
<param-name>number_format</param-name>
<param-value>0.##########</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- ================================================================================= -->
<!-- 定时任务处理 tsing -->
<!-- ================================================================================= -->
<!-- <servlet>
<servlet-name>TaskServlet</servlet-name>
<servlet-class>com.sino.mis.incident.task.TaskManagerServlet</servlet-class>
<init-param>
<description>定时任务列表</description>
<param-name>task</param-name>
<param-value>
com.sino.mis.incident.task.AssignTask,
com.sino.mis.incident.task.UpgradeTask
</param-value>
</init-param>
<init-param>
<description>定时任务执行周期(分钟)</description>
<param-name>period</param-name>
<param-value>1</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>-->
<servlet-mapping>
<servlet-name>freemarker</servlet-name>
<url-pattern>*.ftl</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<!--close by wm :reason is the spring has CharacterEncodingFilter-->
<!-- filter>
<description>character encoding</description>
<display-name>character encoding</display-name>
<filter-name>CharacterEncodingFilter</filter-name>
<filter-class>com.sino.mis.equipment.common.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>utf-8</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>CharacterEncodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping-->
<!-- edit by wm in 2007-02-08-->
<filter>
<filter-name>clickstreamFilter</filter-name>
<filter-class>
com.opensymphony.clickstream.ClickstreamFilter
</filter-class>
</filter>
<filter>
<filter-name>encodingFilter</filter-name>
<filter-class>
org.springframework.web.filter.CharacterEncodingFilter
</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
<init-param>
<param-name>forceEncoding</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter>
<filter-name>hibernateFilter</filter-name>
<filter-class>
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
</filter-class>
</filter>
<filter>
<filter-name>rewriteFilter</filter-name>
<filter-class>
org.tuckey.web.filters.urlrewrite.UrlRewriteFilter
</filter-class>
<init-param>
<param-name>logLevel</param-name>
<param-value>commons</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>encodingFilter</filter-name>
<url-pattern>*.do</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>encodingFilter</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>hibernateFilter</filter-name>
<url-pattern>*.do</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>clickstreamFilter</filter-name>
<url-pattern>*.do</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>rewriteFilter</filter-name>
<url-pattern>/*</url-pattern>
<!--dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher-->
</filter-mapping>
<!-- ==================================================== -->
<!-- 身份认证 tsing-->
<!-- ==================================================== -->
<filter>
<filter-name>AuthenticationFilter</filter-name>
<filter-class>
com.sino.mis.system.web.servlet.AuthenticationFilter
</filter-class>
<init-param>
<param-name>loginPage</param-name>
<param-value>/login.jsp</param-value>
</init-param>
<init-param>
<param-name>loginAction</param-name>
<param-value>/login.do?actionType=setSession</param-value>
</init-param>
<init-param>
<param-name>enabled</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>AuthenticationFilter</filter-name>
<url-pattern>*.do</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>AuthenticationFilter</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping>
<listener>
<listener-class>
com.opensymphony.clickstream.ClickstreamListener
</listener-class>
</listener>
<listener>
<listener-class>
org.springframework.web.util.IntrospectorCleanupListener
</listener-class>
</listener>
<session-config>
<session-timeout>240</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<!-- 捕获常见的Http错误 tsing -->
<error-page>
<error-code>500</error-code>
<location>/error.jsp</location>
</error-page>
<error-page>
<error-code>400</error-code>
<location>/error.jsp</location>
</error-page>
<error-page>
<error-code>403</error-code>
<location>/error.jsp</location>
</error-page>
<error-page>
<error-code>404</error-code>
<location>/error.jsp</location>
</error-page>
<!--
<jsp-config>
<taglib>
<taglib-uri>/WEB-INF/displaytag-11.tld</taglib-uri>
<taglib-location>/WEB-INF/displaytag-11.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/extremecomponents.tld</taglib-uri>
<taglib-location>/WEB-INF/extremecomponents.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-html.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-logic.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-template.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-template.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-tiles.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-tiles.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-nested.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-nested.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/sino-common.tld</taglib-uri>
<taglib-location>/WEB-INF/sino-common.tld</taglib-location>
</taglib>
</jsp-config>
-->
</web-app>
=================================
package com.sino.mis.system.web.servlet;
import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.sino.mis.common.Global;
public class AuthenticationFilter implements Filter {
private FilterConfig config;
private String loginPage;
private String loginAction;
private boolean isFromLoginPage = false;
private boolean enabled = true;
public void init(FilterConfig config) throws ServletException {
this.config = config;
loginPage = config.getInitParameter("loginPage");
if(loginPage == null)
loginPage = "/login.jsp";
loginAction = config.getInitParameter("loginAction");
if(loginAction == null)
loginAction = "/login.do";
String e = config.getInitParameter("enabled");
if(e != null && !Boolean.parseBoolean(e))
enabled = false;
}
public void destroy() {
this.config = null;
}
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException {
if(enabled){
//验证是否己登录
HttpServletRequest req = (HttpServletRequest)request;
HttpServletResponse res = (HttpServletResponse)response;
if (!isLogin(req)) {
String forwardURL = getForwardURL(req);
ServletContext context = config.getServletContext();
RequestDispatcher reqDisp = context.getRequestDispatcher(forwardURL);
if (reqDisp == null)
res.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,"Login page doesn't exist");
reqDisp.forward(req,res);
return ;
}
}
chain.doFilter(request, response);
}
private boolean isLogin(HttpServletRequest request) {
// 简单验证用户标示是否存在
return request.getSession().getAttribute(Global.USER_ID) != null;
}
private String getForwardURL(HttpServletRequest req) {
StringBuffer url = null;
isFromLoginPage = "true".equals(req.getParameter("loginFlag")) ? true: false;
if (isFromLoginPage)
url = new StringBuffer(loginAction);
else {
url = new StringBuffer(loginPage);
}
return url.toString();
}
}
=========================
<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" version="2.4"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
/WEB-INF/classes/applicationContext*.xml
</param-value>
</context-param>
<servlet>
<servlet-name>SpringContextServlet</servlet-name>
<servlet-class>
org.springframework.web.context.ContextLoaderServlet
</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet>
<servlet-name>action</servlet-name>
<servlet-class>
org.apache.struts.action.ActionServlet
</servlet-class>
<init-param>
<param-name>config</param-name>
<param-value>
/WEB-INF/struts-config.xml,/WEB-INF/struts-config-incident.xml,/WEB-INF/struts-config-survey.xml,
/WEB-INF/struts-config-stock.xml,
/WEB-INF/struts-config-bizOrder.xml,/WEB-INF/struts-config-productList.xml,
/WEB-INF/struts-config-account.xml,/WEB-INF/struts-config-user.xml,
/WEB-INF/struts-config-rolepower.xml,/WEB-INF/struts-config-supplier.xml,
/WEB-INF/struts-config-login.xml,/WEB-INF/struts-config-salesProject.xml,
/WEB-INF/struts-config-salesContract.xml,/WEB-INF/struts-config-orgorganization.xml,
/WEB-INF/struts-config-orgposition.xml,/WEB-INF/struts-config-employee.xml,
/WEB-INF/struts-config-work.xml,/WEB-INF/struts-config-kms.xml,
/WEB-INF/struts-config-project.xml,/WEB-INF/struts-config-finance.xml,
/WEB-INF/struts-config-calender.xml,
/WEB-INF/struts-config-financeFee.xml,
/WEB-INF/struts-config-common.xml,
/WEB-INF/struts-config-financeEmployeeFee.xml,
/WEB-INF/struts-config-inPurchase.xml,
/WEB-INF/struts-config-software.xml
</param-value>
</init-param>
<init-param>
<param-name>debug</param-name>
<param-value>3</param-value>
</init-param>
<init-param>
<param-name>detail</param-name>
<param-value>3</param-value>
</init-param>
<load-on-startup>0</load-on-startup>
</servlet>
<servlet>
<servlet-name>freemarker</servlet-name>
<servlet-class>
freemarker.ext.servlet.FreemarkerServlet
</servlet-class>
<!-- FreemarkerServlet settings: -->
<init-param>
<param-name>TemplatePath</param-name>
<param-value>/</param-value>
</init-param>
<init-param>
<param-name>NoCache</param-name>
<param-value>true</param-value>
</init-param>
<init-param>
<param-name>ContentType</param-name>
<param-value>text/html</param-value>
</init-param>
<!-- FreeMarker settings: -->
<init-param>
<param-name>template_update_delay</param-name>
<param-value>0</param-value>
<!-- 0 is for development only! Use higher value otherwise. -->
</init-param>
<init-param>
<param-name>default_encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
<init-param>
<param-name>locale</param-name>
<param-value>zh_CN</param-value>
</init-param>
<init-param>
<param-name>number_format</param-name>
<param-value>0.##########</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>
<!-- ================================================================================= -->
<!-- 定时任务处理 tsing -->
<!-- ================================================================================= -->
<!-- <servlet>
<servlet-name>TaskServlet</servlet-name>
<servlet-class>com.sino.mis.incident.task.TaskManagerServlet</servlet-class>
<init-param>
<description>定时任务列表</description>
<param-name>task</param-name>
<param-value>
com.sino.mis.incident.task.AssignTask,
com.sino.mis.incident.task.UpgradeTask
</param-value>
</init-param>
<init-param>
<description>定时任务执行周期(分钟)</description>
<param-name>period</param-name>
<param-value>1</param-value>
</init-param>
<load-on-startup>1</load-on-startup>
</servlet>-->
<servlet-mapping>
<servlet-name>freemarker</servlet-name>
<url-pattern>*.ftl</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>action</servlet-name>
<url-pattern>*.do</url-pattern>
</servlet-mapping>
<!--close by wm :reason is the spring has CharacterEncodingFilter-->
<!-- filter>
<description>character encoding</description>
<display-name>character encoding</display-name>
<filter-name>CharacterEncodingFilter</filter-name>
<filter-class>com.sino.mis.equipment.common.CharacterEncodingFilter</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>utf-8</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>CharacterEncodingFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping-->
<!-- edit by wm in 2007-02-08-->
<filter>
<filter-name>clickstreamFilter</filter-name>
<filter-class>
com.opensymphony.clickstream.ClickstreamFilter
</filter-class>
</filter>
<filter>
<filter-name>encodingFilter</filter-name>
<filter-class>
org.springframework.web.filter.CharacterEncodingFilter
</filter-class>
<init-param>
<param-name>encoding</param-name>
<param-value>UTF-8</param-value>
</init-param>
<init-param>
<param-name>forceEncoding</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter>
<filter-name>hibernateFilter</filter-name>
<filter-class>
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter
</filter-class>
</filter>
<filter>
<filter-name>rewriteFilter</filter-name>
<filter-class>
org.tuckey.web.filters.urlrewrite.UrlRewriteFilter
</filter-class>
<init-param>
<param-name>logLevel</param-name>
<param-value>commons</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>encodingFilter</filter-name>
<url-pattern>*.do</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>encodingFilter</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>hibernateFilter</filter-name>
<url-pattern>*.do</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>clickstreamFilter</filter-name>
<url-pattern>*.do</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>rewriteFilter</filter-name>
<url-pattern>/*</url-pattern>
<!--dispatcher>REQUEST</dispatcher>
<dispatcher>FORWARD</dispatcher-->
</filter-mapping>
<!-- ==================================================== -->
<!-- 身份认证 tsing-->
<!-- ==================================================== -->
<filter>
<filter-name>AuthenticationFilter</filter-name>
<filter-class>
com.sino.mis.system.web.servlet.AuthenticationFilter
</filter-class>
<init-param>
<param-name>loginPage</param-name>
<param-value>/login.jsp</param-value>
</init-param>
<init-param>
<param-name>loginAction</param-name>
<param-value>/login.do?actionType=setSession</param-value>
</init-param>
<init-param>
<param-name>enabled</param-name>
<param-value>true</param-value>
</init-param>
</filter>
<filter-mapping>
<filter-name>AuthenticationFilter</filter-name>
<url-pattern>*.do</url-pattern>
</filter-mapping>
<filter-mapping>
<filter-name>AuthenticationFilter</filter-name>
<url-pattern>*.jsp</url-pattern>
</filter-mapping>
<listener>
<listener-class>
com.opensymphony.clickstream.ClickstreamListener
</listener-class>
</listener>
<listener>
<listener-class>
org.springframework.web.util.IntrospectorCleanupListener
</listener-class>
</listener>
<session-config>
<session-timeout>240</session-timeout>
</session-config>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<!-- 捕获常见的Http错误 tsing -->
<error-page>
<error-code>500</error-code>
<location>/error.jsp</location>
</error-page>
<error-page>
<error-code>400</error-code>
<location>/error.jsp</location>
</error-page>
<error-page>
<error-code>403</error-code>
<location>/error.jsp</location>
</error-page>
<error-page>
<error-code>404</error-code>
<location>/error.jsp</location>
</error-page>
<!--
<jsp-config>
<taglib>
<taglib-uri>/WEB-INF/displaytag-11.tld</taglib-uri>
<taglib-location>/WEB-INF/displaytag-11.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/extremecomponents.tld</taglib-uri>
<taglib-location>/WEB-INF/extremecomponents.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-bean.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-bean.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-html.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-html.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-logic.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-logic.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-template.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-template.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-tiles.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-tiles.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/struts-nested.tld</taglib-uri>
<taglib-location>/WEB-INF/struts-nested.tld</taglib-location>
</taglib>
<taglib>
<taglib-uri>/WEB-INF/sino-common.tld</taglib-uri>
<taglib-location>/WEB-INF/sino-common.tld</taglib-location>
</taglib>
</jsp-config>
-->
</web-app>
=================================
package com.sino.mis.system.web.servlet;
import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.RequestDispatcher;
import javax.servlet.ServletContext;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.sino.mis.common.Global;
public class AuthenticationFilter implements Filter {
private FilterConfig config;
private String loginPage;
private String loginAction;
private boolean isFromLoginPage = false;
private boolean enabled = true;
public void init(FilterConfig config) throws ServletException {
this.config = config;
loginPage = config.getInitParameter("loginPage");
if(loginPage == null)
loginPage = "/login.jsp";
loginAction = config.getInitParameter("loginAction");
if(loginAction == null)
loginAction = "/login.do";
String e = config.getInitParameter("enabled");
if(e != null && !Boolean.parseBoolean(e))
enabled = false;
}
public void destroy() {
this.config = null;
}
public void doFilter(ServletRequest request, ServletResponse response,
FilterChain chain) throws IOException, ServletException {
if(enabled){
//验证是否己登录
HttpServletRequest req = (HttpServletRequest)request;
HttpServletResponse res = (HttpServletResponse)response;
if (!isLogin(req)) {
String forwardURL = getForwardURL(req);
ServletContext context = config.getServletContext();
RequestDispatcher reqDisp = context.getRequestDispatcher(forwardURL);
if (reqDisp == null)
res.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,"Login page doesn't exist");
reqDisp.forward(req,res);
return ;
}
}
chain.doFilter(request, response);
}
private boolean isLogin(HttpServletRequest request) {
// 简单验证用户标示是否存在
return request.getSession().getAttribute(Global.USER_ID) != null;
}
private String getForwardURL(HttpServletRequest req) {
StringBuffer url = null;
isFromLoginPage = "true".equals(req.getParameter("loginFlag")) ? true: false;
if (isFromLoginPage)
url = new StringBuffer(loginAction);
else {
url = new StringBuffer(loginPage);
}
return url.toString();
}
}
=========================