转自:http://jacobcookie.iteye.com/blog/1876798
1.
在sae上使用struts,需要添加的Listener,在com.company.listener中添加SaeListener.java。
- package com.company.listener;
-
- import javax.servlet.ServletContextEvent;
- import javax.servlet.ServletContextListener;
- import javax.servlet.http.HttpSessionAttributeListener;
- import javax.servlet.http.HttpSessionBindingEvent;
- import javax.servlet.http.HttpSessionEvent;
- import javax.servlet.http.HttpSessionListener;
-
-
-
-
- public class SaeListener implements ServletContextListener,HttpSessionListener,HttpSessionAttributeListener{
-
- public void contextDestroyed(ServletContextEvent arg0) {}
-
- public void contextInitialized(ServletContextEvent arg0) {}
-
- public void sessionCreated(HttpSessionEvent arg0) {}
-
- public void sessionDestroyed(HttpSessionEvent arg0) {}
-
- public void attributeAdded(HttpSessionBindingEvent arg0) {}
-
- public void attributeRemoved(HttpSessionBindingEvent arg0) {}
-
- public void attributeReplaced(HttpSessionBindingEvent arg0) {}
-
- }
2.在web.xml文件中添加sae监听器。
-
- <listener>
- <listener-class>
- com.company.listener.SaeListener
- </listener-class>
- </listener>
3、修改mysql数据库连接信息,sae提供的是phpMysql。
- db.username=(sae提供的用户名,在汇总信息那里)
- db.pwd=(sae提供的密码,在汇总信息那里)
- db.driverClassName=com.mysql.jdbc.Driver
- db.url=jdbc:mysql:
4、最后一步让我抓狂,fk。我以为输入域名就会自动访问网站的首页,事实我想错了,尼玛的浪费了我多少时光。
需要在【AppConfig】里的【目录默认页面】添加你的首页【index.jsp】,然后在二级域名后面加上index.jsp,这样就可以访问了。
sina sae 部署 java ssh 项目,布布扣,bubuko.com
sina sae 部署 java ssh 项目
原文:http://www.cnblogs.com/x_wukong/p/3721798.html