From: <fza...@us...> - 2005-11-29 23:08:37
|
Update of /cvsroot/struts/ajaxchat/WEB-INF In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21020/WEB-INF Added Files: app-config.xml rooms-config.xml struts-config.xml web.xml Log Message: --- NEW FILE: app-config.xml --- <config> <!-- maxMessages is the maximum number of messages that will be stored in --> <!-- the messages collection of each room. Any time a message is posted --> <!-- to a room, the number of messages in the collection is checked --> <!-- against this value. If the count exceeds this value, the collection --> <!-- is cleared before the new messages is stored. This is just a --> <!-- memory-saving measure, and probably makes things a bit more --> <!-- efficient too. --> <maxMessages>250</maxMessages> </config> --- NEW FILE: rooms-config.xml --- <rooms> <room name="General Topics" /> <room name="Programming" /> <room name="Movies" /> <room name="Music" /> <room name="Television" /> </rooms> --- NEW FILE: struts-config.xml --- <?xml version="1.0" encoding="ISO-8859-1" ?> <!DOCTYPE struts-config PUBLIC "-//Apache Software Foundation//DTD Struts Configuration 1.2//EN" "http://jakarta.apache.org/struts/dtds/struts-config_1_2.dtd"> <struts-config> <!-- Form Beans --> <form-beans> <form-bean name="LobbyActionForm" type="org.apache.struts.apps.ajaxchat.actionform.LobbyActionForm" /> <form-bean name="LoginActionForm" type="org.apache.struts.action.DynaActionForm"> <form-property name="username" type="java.lang.String" /> </form-bean> <form-bean name="ajaxPostMessageActionForm" type="org.apache.struts.action.DynaActionForm"> <form-property name="msgText" type="java.lang.String" /> </form-bean> </form-beans> <!-- Mappings --> <action-mappings> <!-- ***** These are our normal Struts mappings. ***** --> <!-- Used when the user clicks Login on the welcome screen. --> <action path="/login" type="org.apache.struts.apps.ajaxchat.action.LoginAction" name="LoginActionForm" scope="request" validate="false"> <forward name="gotoLobby" path="/lobby.do" /> <forward name="fail" path="/index.jsp" /> </action> <!-- Used when the user clicks Logout on the lobby screen. --> <action path="/logout" type="org.apache.struts.apps.ajaxchat.action.LogoutAction"> <forward name="gotoWelcome" path="/index.jsp" /> </action> <!-- Used to show the lobby. --> <action path="/lobby" type="org.apache.struts.apps.ajaxchat.action.LobbyAction" name="LobbyActionForm" scope="request" validate="false"> <forward name="showLobby" path="/lobby.jsp" /> </action> <!-- Used when the user clicks on a room on the lobby screen. --> <action path="/joinRoom" type="org.apache.struts.apps.ajaxchat.action.JoinRoomAction" name="LobbyActionForm" scope="request" validate="false"> <forward name="showRoom" path="/room.jsp" /> </action> <!-- Used when the user clicks the Leave Room on the room screen. --> <action path="/leaveRoom" type="org.apache.struts.apps.ajaxchat.action.LeaveRoomAction"> <forward name="gotoLobby" path="/lobby.do" /> </action> <!-- ***** These are our Ajax-related mappings. ***** --> <!-- Used to list all the users in the room. --> <action path="/ajaxListUsersInRoom" type="org.apache.struts.apps.ajaxchat.action.ListUsersInRoomAction" /> <!-- Used to post a message to the room. --> <action path="/ajaxPostMessage" type="org.apache.struts.apps.ajaxchat.action.PostMessageAction" name="ajaxPostMessageActionForm" scope="request" validate="false" /> <!-- Used to get messages in the room. --> <action path="/ajaxGetMessages" type="org.apache.struts.apps.ajaxchat.action.GetMessagesAction" /> <!-- Used to get messages in the room. --> <action path="/ajaxLobbyUpdateStats" type="org.apache.struts.apps.ajaxchat.action.LobbyUpdateStatsAction" /> </action-mappings> <message-resources parameter="app_resources" /> </struts-config> --- NEW FILE: web.xml --- <?xml version="1.0" encoding="ISO-8859-1"?> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN" "http://java.sun.com/j2ee/dtds/web-app_2_2.dtd"> <web-app> <display-name>Struts Apps- AjaxChat</display-name> <!-- Parameter for JSTL resource bundle usage. --> <context-param> <param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name> <param-value>app_resources</param-value> </context-param> <!-- Parameters related to application configuration. --> <context-param> <param-name>configFile</param-name> <param-value>/WEB-INF/app-config.xml</param-value> </context-param> <context-param> <param-name>configClass</param-name> <param-value>org.apache.struts.apps.ajaxchat.AjaxChatConfig</param-value> </context-param> <!-- The session checking filter. --> <filter> <filter-name>sessionCheckerFilter</filter-name> <filter-class>org.apache.struts.apps.ajaxchat.filter.SessionCheckerFilter</filter-class> </filter> <filter-mapping> <filter-name>sessionCheckerFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <!-- Context and Session listeners. --> <listener> <listener-class>javawebparts.listener.AppConfigContextListener</listener-class> </listener> <listener> <listener-class>org.apache.struts.apps.ajaxchat.listener.ContextListener</listener-class> </listener> <listener> <listener-class>org.apache.struts.apps.ajaxchat.listener.SessionListener</listener-class> </listener> <!-- Action 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</param-value> </init-param> <init-param> <param-name>application</param-name> <param-value>app_resources</param-value> </init-param> <init-param> <param-name>debug</param-name> <param-value>5</param-value> </init-param> <init-param> <param-name>detail</param-name> <param-value>5</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>action</servlet-name> <url-pattern>*.do</url-pattern> </servlet-mapping> <!-- Session timeout config. --> <session-config> <session-timeout>1</session-timeout> </session-config> <!-- Welcome file config. --> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> </web-app> |