<struts-config>
??? <form-beans>
??????? <form-bean name="loginForm" type="com.allanlxf.action.LoginForm"/>
??????? <form-bean name="userForm" type="org.apache.struts.action.DynaActionForm">
??????????? <form-property name="userName" type="java.lang.String" />
??????????? <form-property name="password" type="java.lang.String" />
??????? </form-bean>
??? </form-beans>
???
??? <action-mappings>
???
??????? <action?? path="/core/login"? type="com.allanlxf.action.LoginAction"
?????????????????? name="loginForm" input="/core/login.jsp" validate="true" scope="request">
????????? <exception key="errors.root"
?????????????????????? path="/core/error.jsp"
?????????????????????? type="com.allanlxf.biz.IllegalUserException" />
????????? <forward name="success" path="/core/success.jsp" redirect="true"/>
????????? <forward name="fail" path="/core/fail.jsp" />
??????? </action>
???????
??????? <action?? path="/dispatch"? type="com.allanlxf.struts.actions.UserAction" parameter="method">
????????? <forward name="login" path="/actions/pages/login_next.jsp" />
????????? <forward name="find" path="/actions/pages/find_next.jsp" />
????????? <forward name="findById" path="/actions/pages/findById_next.jsp" />
????????? <forward name="remove" path="/actions/pages/remove_next.jsp" />
????????? <forward name="modify" path="/actions/pages/modify_next.jsp" />
????????? <forward name="register" path="/actions/pages/register_next.jsp" />
??????? </action>
???????
??????? <action?? path="/mapping/login"? type="com.allanlxf.struts.actions.UserMappingAction" parameter="login">
????????? <forward name="next" path="/actions/pages/login_next.jsp" />
??????? </action>
???????
??????? <action?? path="/mapping/find"? type="com.allanlxf.struts.actions.UserMappingAction"? parameter="find">
????????? <forward name="next" path="/actions/pages/find_next.jsp" />
??????? </action>
???????
??????? <action?? path="/mapping/findById"? type="com.allanlxf.struts.actions.UserMappingAction"? parameter="findById">
????????? <forward name="next" path="/actions/pages/findById_next.jsp" />
??????? </action>
???????
??????? <action?? path="/mapping/remove"? type="com.allanlxf.struts.actions.UserMappingAction"? parameter="remove">
????????? <forward name="next" path="/actions/pages/remove_next.jsp" />
??????? </action>
???????
??????? <action?? path="/mapping/modify"? type="com.allanlxf.struts.actions.UserMappingAction"? parameter="modify">
????????? <forward name="next" path="/actions/pages/modify_next.jsp" />
??????? </action>
???????
??????? <action?? path="/mapping/register"? type="com.allanlxf.struts.actions.UserMappingAction"? parameter="register">
????????? <forward name="next" path="/actions/pages/register_next.jsp" />
??????? </action>
???????
??????? <action?? path="/lookup"? type="com.allanlxf.struts.actions.UserLookupAction" parameter="method">
????????? <forward name="login" path="/actions/pages/login_next.jsp" />
????????? <forward name="find" path="/actions/pages/find_next.jsp" />
????????? <forward name="findById" path="/actions/pages/findById_next.jsp" />
????????? <forward name="remove" path="/actions/pages/remove_next.jsp" />
????????? <forward name="modify" path="/actions/pages/modify_next.jsp" />
????????? <forward name="register" path="/actions/pages/register_next.jsp" />
??????? </action>
???????
??????? <action?? path="/dyna/register"? type="com.allanlxf.action.RegisterAction"
?????????????????? name="userForm">
????????? <forward name="success" path="/dyna/success.jsp"/>
??????? </action>
???????
??? </action-mappings>
???
??? <message-resources parameter="com.allanlxf.MessageResources" />
?????????????????
</struts-config>
posted @
2007-04-25 16:12 sunny 閱讀(654) |
評論 (0) |
編輯 收藏
import javax.servlet.*;
import javax.servlet.http.*;
import java.io.*;
public abstract class HttpFilter implements Filter
{
??? private FilterConfig config;
???
??? //////////////////////////////////
??? public void init(FilterConfig config) throws ServletException
??? {
??????? this.config = config;
??????? init();
??? }
???
??? public void init() throws ServletException
??? {
??? }
??? ///////////////////////////////
??? public FilterConfig getFilterConfig()
??? {
??????? return config;
??? }
???
??? public String getInitParameter(String name)
??? {
??????? return config.getInitParameter(name);
??? }
???
??? public ServletContext getServletContext()
??? {
??????? return config.getServletContext();
??? }
???
??? public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain)
??????????????????????????????????????????????? throws IOException, ServletException
??? {
??????? doFilter((HttpServletRequest)request, (HttpServletResponse)response, chain);
??? }
???
??? public abstract void doFilter(HttpServletRequest request, HttpServletResponse response, FilterChain chain)
??????????????????????????????????????????????? throws IOException, ServletException;
???
??? public void destroy()
??? {
??? }
}
posted @
2007-04-06 16:31 sunny 閱讀(304) |
評論 (0) |
編輯 收藏